@matheusbsbs / matheus-bagliano / commits / c816eb1784
Fork 0

glossary: fix overoptimistic automatic linking of defined terms

The script sort_glossary.pl turns each use of "term" into a link to the definition of "term". To avoid mangling links like gitlink:git-term[1] it doesn't replace any occurence of "term" preceded by "link:git-". This fails for gitlink:git-symbolic-ref[1] when substituting for "ref". So instead just refuse to replace anything preceded by a "-". That could result in missing some opportunities, but that's a less annoying error. Actually I find the automatic substitution a little distracting; some day maybe we should just run it once and commit the result, so it can be hand-tuned. Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>

J. Bruce Fields committed Mar 4, 2007 at 19:13 UTC c816eb1784b324fcf3988253affac4d43bce78c9
1 file changed +1 -1
Documentation/sort_glossary.pl
+1 -1
@@ -48,7 +48,7 @@ This list is sorted alphabetically:
48 ';
49
50 @keys=sort {uc($a) cmp uc($b)} keys %terms;
51 -$pattern='(\b(?<!link:git-)'.join('\b|\b(?<!link:git-)',reverse @keys).'\b)';
51 +$pattern='(\b(?<!link:git-)'.join('\b|\b(?<!-)',reverse @keys).'\b)';
52 foreach $key (@keys) {
53 $terms{$key}=~s/$pattern/sprintf "<<ref_".no_spaces($1).",$1>>";/eg;
54 print '[[ref_'.no_spaces($key).']]'.$key."::\n"