feat(cheddar): Implement highlighting of CL and bug shortlinks

Implements highlighting of shortlinks like cl/123, or b/123.

Highlighting works by replacing the input Markdown using a simple
regular expression replacement.

We also considered parsing and replacing these links in the Markdown
AST, but it would have been significantly more complex (due to arena
allocation) for little upside and no obvious performance benefit.

Change-Id: I53f03fb17491046d89d0b7f605929571c11ee9a8
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3082
Tested-by: BuildkiteCI
Reviewed-by: eta <eta@theta.eu.org>
This commit is contained in:
Vincent Ambo 2021-04-30 23:59:24 +02:00 committed by tazjin
parent 57502cfc46
commit a9902dadcf
4 changed files with 51 additions and 1 deletions

View file

@ -11,6 +11,7 @@ lazy_static = "1.4"
rouille = "3.0"
syntect = "4.5.0"
serde_json = "1.0"
regex = "1.4"
[dependencies.serde]
version = "1.0"