aboutsummaryrefslogtreecommitdiff
path: root/ext/js/display/query-parser.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-03-03 18:06:12 -0500
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-03-07 15:42:32 -0500
commit68e4d1fbd5545953885a673a70cb9ed0e2a55b2a (patch)
tree875604cc95c0cd8cd5a6959cb9085f8437fb2dbf /ext/js/display/query-parser.js
parent83a8ca4a2e3623ec6730d7400bd3ea5d72a4a93b (diff)
Fix text being overwritten when generating the query parser content (#1483)
Diffstat (limited to 'ext/js/display/query-parser.js')
-rw-r--r--ext/js/display/query-parser.js10
1 files changed, 3 insertions, 7 deletions
diff --git a/ext/js/display/query-parser.js b/ext/js/display/query-parser.js
index c21033de..8c5ce331 100644
--- a/ext/js/display/query-parser.js
+++ b/ext/js/display/query-parser.js
@@ -149,7 +149,7 @@ class QueryParser extends EventDispatcher {
this._queryParser.textContent = '';
this._queryParser.dataset.parsed = 'true';
if (!parseResult) { return; }
- this._queryParser.appendChild(this._createParseResult(parseResult.content, false));
+ this._queryParser.appendChild(this._createParseResult(parseResult.content));
}
_updateParserModeSelect(select, parseResults, selectedParser) {
@@ -191,7 +191,7 @@ class QueryParser extends EventDispatcher {
termNode.className = 'query-parser-term';
for (const segment of term) {
if (segment.reading.trim().length === 0) {
- this._addSegmentText(segment.text, termNode);
+ termNode.appendChild(document.createTextNode(segment.text));
} else {
termNode.appendChild(this._createSegment(segment));
}
@@ -214,13 +214,9 @@ class QueryParser extends EventDispatcher {
segmentNode.appendChild(textNode);
segmentNode.appendChild(readingNode);
- this._addSegmentText(segment.text, textNode);
+ textNode.textContent = segment.text;
readingNode.textContent = segment.reading;
return segmentNode;
}
-
- _addSegmentText(text, container) {
- container.textContent = text;
- }
}