diff options
author | Samy Pesse <samypesse@gmail.com> | 2016-05-26 21:10:06 +0200 |
---|---|---|
committer | Samy Pesse <samypesse@gmail.com> | 2016-05-26 21:10:06 +0200 |
commit | b47ebaa9d91ecc0a1a1678eb8da79837a3cfee19 (patch) | |
tree | b0768304482c15b1387a41e9c828e1739bdfc52e /lib/output/modifiers/annotateText.js | |
parent | ecd86ec8778fdf54c5a8e6edef618cde89336641 (diff) | |
download | gitbook-b47ebaa9d91ecc0a1a1678eb8da79837a3cfee19.zip gitbook-b47ebaa9d91ecc0a1a1678eb8da79837a3cfee19.tar.gz gitbook-b47ebaa9d91ecc0a1a1678eb8da79837a3cfee19.tar.bz2 |
Use real glossary name when annotating
Diffstat (limited to 'lib/output/modifiers/annotateText.js')
-rw-r--r-- | lib/output/modifiers/annotateText.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/output/modifiers/annotateText.js b/lib/output/modifiers/annotateText.js index d8443cf..2b4b439 100644 --- a/lib/output/modifiers/annotateText.js +++ b/lib/output/modifiers/annotateText.js @@ -62,9 +62,10 @@ function replaceText($, el, search, replace, text_only ) { Annotate text using a list of GlossaryEntry @param {List<GlossaryEntry>} + @param {String} glossaryFilePath @param {HTMLDom} $ */ -function annotateText(entries, $) { +function annotateText(entries, glossaryFilePath, $) { entries.forEach(function(entry) { var entryId = entry.getID(); var name = entry.getName(); @@ -81,7 +82,7 @@ function annotateText(entries, $) { ) return; replaceText($, this, searchRegex, function(match) { - return '<a href="/GLOSSARY.md#' + entryId + '" ' + return '<a href="/' + glossaryFilePath + '#' + entryId + '" ' + 'class="glossary-term" title="' + escape(description) + '">' + match + '</a>'; |