From 70a511165b2352966e36c137a3715b0019f8e6fa Mon Sep 17 00:00:00 2001 From: Mickey Rose Date: Mon, 9 Jul 2018 11:31:15 +0200 Subject: [PATCH] scripts/markdown-hyperlinks: prevent unwanted replacements - don't replace @var in code spans with link to github user - don't replace 1234567... in links with link to commit - replace hexadecimal numbers looking like commit hashes only after replacing raw URIs - this together with the previous point prevents inadvertent replacement of long numbers in links [skip ci] --- scripts/markdown-hyperlinks.pl | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/scripts/markdown-hyperlinks.pl b/scripts/markdown-hyperlinks.pl index a09b94e38..9e6e1361f 100755 --- a/scripts/markdown-hyperlinks.pl +++ b/scripts/markdown-hyperlinks.pl @@ -17,9 +17,12 @@ my $repo = qr/ [a-zA-Z] [a-zA-Z0-9.-]* /x; while (<>) { # make links from @username references - # (except when escaped like \@foobar or `@foobar`) - s;(?) { s;(?) { s;(?