Merge branch 'main' into avm99963-monorail

Merged commit 9b72c743236c5333af241ea6eaf89dd7de15777c.

Also, removed files module-*.yaml, since before we excluded them in the
Makefile, but now they are included by default, and we don't want them.

GitOrigin-RevId: de032b6e562c3c0cb63464bf536f7a020f82f663
diff --git a/static_src/shared/md-helper.js b/static_src/shared/md-helper.js
index 8559778..2a0fb46 100644
--- a/static_src/shared/md-helper.js
+++ b/static_src/shared/md-helper.js
@@ -5,7 +5,10 @@
 export const DEFAULT_MD_PROJECTS = new Set(['vulnz', 'vulnz-old', 'twpowertools', 'translateselectedtext', 'misc']);
 
 /** @type {Set} Projects that allow users to opt into Markdown rendering. */
-export const AVAILABLE_MD_PROJECTS = new Set([...DEFAULT_MD_PROJECTS, 'pigweed']);
+export const AVAILABLE_MD_PROJECTS = new Set([...DEFAULT_MD_PROJECTS]);
+
+const EMAIL_REGEX = /^mailto:[-a-zA-Z0-9!#$%&'*+\/=?^_`{|}~]+(?:[.][-a-zA-Z0-9!#$%&'*+\/=?^_`{|}~]+)*@(?:(?:[0-9a-zA-Z](?:[-]*[0-9a-zA-Z]+)*)(?:\.[0-9a-zA-Z](?:[-]*[0-9a-zA-Z]+)*)*)\.(?:[a-zA-Z]{2,9})$/;
+const MONORAIL_USER_REGEX = /\/u\/[-a-zA-Z0-9!#$%&'*+\/=?^_`{|}~]+(?:[.][-a-zA-Z0-9!#$%&'*+\/=?^_`{|}~]+)*@(?:(?:[0-9a-zA-Z](?:[-]*[0-9a-zA-Z]+)*)(?:\.[0-9a-zA-Z](?:[-]*[0-9a-zA-Z]+)*)*)\.(?:[a-zA-Z]{2,9})$/;
 
 /** @type {Set} Authors whose comments will not be rendered as Markdown. */
 const BLOCKLIST = new Set(['sheriffbot@sheriffbot-1182.iam.gserviceaccount.com',
@@ -98,6 +101,15 @@
 };
 
 /**
+* Checks to see if input string matches a href generated by Monorail's autolinking code.
+ * @param {string} string
+ * @return {boolean} Whether input string is an email address.
+ */
+const isEmailLink = (string) => {
+  return EMAIL_REGEX.test(string) || MONORAIL_USER_REGEX.test(string)
+}
+
+/**
  * Renderer option for Marked.
  * See https://marked.js.org/using_pro#renderer on how to use renderer.
  * @type {Object}
@@ -113,7 +125,7 @@
     // components that consume the markdown renderer.
     let linkIcon;
     let tooltipText;
-    if (isValidHttpUrl(href)) {
+    if (isValidHttpUrl(href) || isEmailLink(href)) {
       linkIcon = `<span class="material-icons link">link</span>`;
       tooltipText = `Link destination: ${href}`;
     } else {