From ec1a8380b5dd1b091fcdbb96edcdab56c9df9f9e Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sun, 28 Feb 2021 15:44:57 -0500 Subject: [PATCH] Fix a poorly handled edge case of the scanning parser (#1468) --- ext/js/background/backend.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ext/js/background/backend.js b/ext/js/background/backend.js index 3d8c4c4a..1238673b 100644 --- a/ext/js/background/backend.js +++ b/ext/js/background/backend.js @@ -1045,7 +1045,11 @@ class Backend { text.substring(0, scanningLength), findTermsOptions ); - if (definitions.length > 0 && sourceLength > 0) { + if ( + definitions.length > 0 && + sourceLength > 0 && + (sourceLength !== 1 || this._japaneseUtil.isCodePointJapanese(text[0])) + ) { const {expression, reading} = definitions[0]; const source = text.substring(0, sourceLength); for (const {text: text2, furigana} of jp.distributeFuriganaInflected(expression, reading, source)) {