From 948605a1fe460eb1215753ef971a8e0ec4081eff Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sun, 8 Nov 2020 12:43:41 -0500 Subject: [PATCH] Update query parser to properly display multi-line content (#1007) --- ext/bg/js/query-parser-generator.js | 3 +-- ext/mixed/css/display.css | 1 + 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 {