Files
gerrit/gerrit-httpd
Shawn O. Pearce da866aee7c commentlink: Support raw HTML replacements
Due to JavaScript regex limitations, in order to write a pattern that
matches something specific, an administrator may need to overmatch
on the left hand side of what they actually want the hyperlink to
be around.  In these cases, being able to replace as a raw HTML
string allows the administrator to leave the leading prefix out of
the anchor text by controlling exactly how the replacement is built.

For example, its common in Git to record "Bug: nnn\n" in the footer
area of a commit message.  When matching these we want to key off the
"Bug: " part to avoid matching an arbitrary number in the message,
but we don't want to make "Bug: " part of the hyperlink itself.

  [commentlink "tracker"]
    match = ([Bb]ug:\\s+)(\\d+)
    html = $1<a href=\"http://trak.example.com/$2\">$2</a>

Allows "Bug: " to be matched and preserved in front of the string,
while the anchor is only positioned around the numeric.

Change-Id: Id9db765afd195e194aa7720d310f1402c538a4f5
Signed-off-by: Shawn O. Pearce <sop@google.com>
2009-12-16 15:47:52 -08:00
..
2009-12-12 20:17:29 -08:00