summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-11-08 12:43:41 -0500
committerGitHub <noreply@github.com>2020-11-08 12:43:41 -0500
commit948605a1fe460eb1215753ef971a8e0ec4081eff (patch)
tree102bdbf0ed54c29726472e1c51c269d7ef7f805b
parent12e6e377854a9163b322a16f3effe816d0222c67 (diff)
Update query parser to properly display multi-line content (#1007)
-rw-r--r--ext/bg/js/query-parser-generator.js3
-rw-r--r--ext/mixed/css/display.css1
2 files changed, 2 insertions, 2 deletions
diff --git a/ext/bg/js/query-parser-generator.js b/ext/bg/js/query-parser-generator.js
index d53183ba..34923c1d 100644
--- a/ext/bg/js/query-parser-generator.js
+++ b/ext/bg/js/query-parser-generator.js
@@ -24,8 +24,7 @@ class QueryParserGenerator {
termNode.className = 'query-parser-term';
termNode.dataset.type = type;
for (const segment of term) {
- if (!segment.text.trim()) { continue; }
- if (!segment.reading.trim()) {
+ if (segment.reading.trim().length === 0) {
this._addSegmentText(segment.text, termNode);
} else {
termNode.appendChild(this._createSegment(segment));
diff --git a/ext/mixed/css/display.css b/ext/mixed/css/display.css
index 3b6e3b3e..4914bfa1 100644
--- a/ext/mixed/css/display.css
+++ b/ext/mixed/css/display.css
@@ -190,6 +190,7 @@ h2 {
#query-parser-content {
margin-top: 0.5em;
font-size: 2em;
+ white-space: pre-wrap;
}
#query-parser-content[data-term-spacing=true] .query-parser-term {