Skip to content

Commit

Permalink
glossary: fix overoptimistic automatic linking of defined terms
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
J. Bruce Fields committed Mar 11, 2007
1 parent ef203f0 commit c816eb1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Documentation/sort_glossary.pl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ ($)
';

@keys=sort {uc($a) cmp uc($b)} keys %terms;
$pattern='(\b(?<!link:git-)'.join('\b|\b(?<!link:git-)',reverse @keys).'\b)';
$pattern='(\b(?<!link:git-)'.join('\b|\b(?<!-)',reverse @keys).'\b)';
foreach $key (@keys) {
$terms{$key}=~s/$pattern/sprintf "<<ref_".no_spaces($1).",$1>>";/eg;
print '[[ref_'.no_spaces($key).']]'.$key."::\n"
Expand Down

0 comments on commit c816eb1

Please sign in to comment.