Created
September 21, 2016 10:49
-
-
Save avar/0229d15e6eabbed0b8937c9c16a1054a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$line = esc_html($line, -nbsp=>1); | |
$line =~ s{ | |
\b | |
( | |
# The output of "git describe", e.g. v2.10.0-297-gf6727b0 | |
# or hadoop-20160921-113441-20-g094fb7d | |
(?<!-) # see strbuf_check_tag_ref(). Tags can't start with - | |
[A-Za-z0-9.-]+ | |
(?!\.) # refs can't end with ".", see check_refname_format() | |
-g[0-9a-fA-F]{7,40} | |
| | |
# Just a normal looking Git SHA1 | |
[0-9a-fA-F]{7,40} | |
) | |
\b | |
}{ | |
$cgi->a({-href => href(action=>"object", hash=>$1), | |
-class => "text"}, $1); | |
}egx; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment