Merge branch 'main' into avm99963-monorail

Merged commit 34d8229ae2b51fb1a15bd208e6fe6185c94f6266

GitOrigin-RevId: 7ee0917f93a577e475f8e09526dd144d245593f4
diff --git a/redirect/templates/redirect.html b/redirect/templates/redirect.html
new file mode 100644
index 0000000..7494735
--- /dev/null
+++ b/redirect/templates/redirect.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<script>
+  const commentRegexp = /#c([0-9]+)/;
+  const url = {{ base_url|tojson }}
+  let hash = window.location.hash;
+
+  // If a monorail style comment is specified then convert it to an
+  // issue tracker style comment. Increment it by one because issue
+  // tracker considers the description as the first comment.
+  const matches = hash.match(commentRegexp);
+  if (matches) {
+    let commentNum = parseInt(matches[1]);
+    hash = hash.replace("#c" + commentNum, "#comment" + (commentNum+1));
+  }
+  window.location = url + hash;
+</script>