forked from bookstack/hacks
Fixed glossary term replacement when words at start of line
This commit is contained in:
parent aae83ab11b
commit 1c29608918
1 changed files with 2 additions and 1 deletions
| @ -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; | ||||
| |
Loading…
Add table
Add a link
Reference in a new issue