Compare commits

..

1 Commits
1.4.2 ... 1.4.3

Author SHA1 Message Date
Dominik Reh
3a47a9b010 Insert results as textContent instead of innerHtml
Fixes #7
2022-10-14 09:38:51 +02:00

View File

@@ -210,7 +210,13 @@ function insertTextAtCursor(textArea, result, tagword) {
sanitizedText = acConfig.replaceUnderscores ? text.replaceAll("_", " ") : text;
}
sanitizedText = acConfig.escapeParentheses ? sanitizedText.replaceAll("(", "\\(").replaceAll(")", "\\)") : sanitizedText;
if (acConfig.escapeParentheses) {
sanitizedText = sanitizedText
.replaceAll("(", "\\(")
.replaceAll(")", "\\)")
.replaceAll("[", "\\[")
.replaceAll("]", "\\]");
}
var prompt = textArea.value;
@@ -269,7 +275,7 @@ function addResultsToList(textArea, results, tagword) {
for (let i = 0; i < results.length; i++) {
let result = results[i];
let li = document.createElement("li");
li.innerHTML = result[0];
li.textContent = result[0];
// Wildcards have no tag type
if (!result[1].startsWith("wildcard")) {