Fix a poorly handled edge case of the scanning parser (#1468)

This commit is contained in:
toasted-nutbread 2021-02-28 15:44:57 -05:00 committed by GitHub
parent 1dfcd3e435
commit ec1a8380b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)) {