Skip to content

Commit 0bc30b6

Browse files
committed
js: switch type-matching regex to \b
The old regex only accept "type\n" as a hotlink "target", so it fails to link non-pointee types correctly — `git_oid *` never happens, while `git_oid` does. Hence, make the regex use word boundaries to match types to cater for those cases.
1 parent 547279f commit 0bc30b6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

site/js/docurium.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ $(function() {
603603
_.each(types, function(type) {
604604
var typeName = type[0];
605605
var typeData = type[1];
606-
var re = new RegExp(typeName + '\\s', 'gi');
606+
var re = new RegExp('\\b' + typeName + '\\b', 'gi');
607607
var link = $('<a>').attr('href', '#' + typeLink(typeName, version)).append(typeName)[0]
608608
text = text.replace(re, link.outerHTML + ' ')
609609
});

0 commit comments

Comments
 (0)