about summary refs log tree commit diff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/cheddar/src/lib.rs4
-rw-r--r--tools/cheddar/src/tests.rs8
2 files changed, 12 insertions, 0 deletions
diff --git a/tools/cheddar/src/lib.rs b/tools/cheddar/src/lib.rs
index e5d7aad1e62c..da0eace17556 100644
--- a/tools/cheddar/src/lib.rs
+++ b/tools/cheddar/src/lib.rs
@@ -78,6 +78,10 @@ lazy_static! {
         Shortlink {
             pattern: Regex::new(r#"\b(?P<type>b|cl)/(?P<dest>\d+)\b"#).unwrap(),
             replacement: "[$type/$dest](https://$type.tvl.fyi/$dest)",
+        },
+        Shortlink {
+            pattern: Regex::new(r#"\br/(?P<dest>\d+)\b"#).unwrap(),
+            replacement: "[r/$dest](https://code.tvl.fyi/commit/?id=refs/r/$dest)",
         }
     ];
 }
diff --git a/tools/cheddar/src/tests.rs b/tools/cheddar/src/tests.rs
index 5b7b1cc52a95..c82bba676746 100644
--- a/tools/cheddar/src/tests.rs
+++ b/tools/cheddar/src/tests.rs
@@ -79,6 +79,14 @@ fn highlights_cl_link() {
 }
 
 #[test]
+fn highlights_r_link() {
+    expect_markdown(
+        "Fixed in r/3268.",
+        "<p>Fixed in <a href=\"https://code.tvl.fyi/commit/?id=refs/r/3268\">r/3268</a>.</p>",
+    );
+}
+
+#[test]
 fn highlights_multiple_shortlinks() {
     expect_markdown(
         "Please look at cl/420, b/123.",