diff options
Diffstat (limited to 'lib/utils/page.js')
-rw-r--r-- | lib/utils/page.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/utils/page.js b/lib/utils/page.js index 9b33b96..f24013f 100644 --- a/lib/utils/page.js +++ b/lib/utils/page.js @@ -237,13 +237,16 @@ function normalizeHtml(src, options) { }); // Replace glossary terms - _.each(options.glossary, function(term) { + var glossary = _.sortBy(options.glossary, function(term) { + return -term.name.length; + }); + _.each(glossary, function(term) { var r = new RegExp( "\\b(" + pregQuote(term.name.toLowerCase()) + ")\\b" , 'gi' ); var includedInFiles = false; $("*").each(function() { // Ignore codeblocks - if (_.contains(["code", "pre"], this.name.toLowerCase())) return; + if (_.contains(["code", "pre", "a"], this.name.toLowerCase())) return; replaceText($, this, r, function(match) { // Add to files index in glossary |