diff --git a/javascript/tagAutocomplete.js b/javascript/tagAutocomplete.js index f1755f6..dcee22e 100644 --- a/javascript/tagAutocomplete.js +++ b/javascript/tagAutocomplete.js @@ -489,6 +489,10 @@ async function insertTextAtCursor(textArea, result, tagword, tabCompletedWithout optionalSeparator = TAC_CFG.extraNetworksSeparator || " "; } + // Escape $ signs since they are special chars for the replace function + // We need four since we're also escaping them in replaceAll in the first place + sanitizedText = sanitizedText.replaceAll("$", "$$$$"); + // Replace partial tag word with new text, add comma if needed let insert = surrounding.replace(match, sanitizedText + optionalSeparator);