]>
BookStack Code Mirror - hacks/commitdiff
projects
/
hacks
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
| inline |
side by side
(parent:
aae83ab
)
Fixed glossary term replacement when words at start of line
author
Dan Brown
<redacted>
Tue, 19 Nov 2024 17:08:28 +0000
(17:08 +0000)
committer
Dan Brown
<redacted>
Tue, 19 Nov 2024 17:08:28 +0000
(17:08 +0000)
content/dynamic-glossary/head.html
patch
|
blob
|
history
diff --git
a/content/dynamic-glossary/head.html
b/content/dynamic-glossary/head.html
index 85028fb982167f01e769b39f44372014000e44a1..9d71789dc8320d5f274864d8be902814af0cf791 100644
(file)
--- a/
content/dynamic-glossary/head.html
+++ b/
content/dynamic-glossary/head.html
@@
-42,7
+42,8
@@
parent.insertBefore(preTextNode, node)
const termEl = createGlossaryNode(word, glossaryVal);
parent.insertBefore(termEl, node);
- node.textContent = node.textContent.replace(preText + ' ' + word, '');
+ const toReplace = parsedWords.length ? preText + ' ' + word : word;
+ node.textContent = node.textContent.replace(toReplace, '');
parsedWords = [];
firstChange = false;
continue;