Fix a poorly handled edge case of the scanning parser (#1468)
This commit is contained in:
parent
1dfcd3e435
commit
ec1a8380b5
@ -1045,7 +1045,11 @@ class Backend {
|
|||||||
text.substring(0, scanningLength),
|
text.substring(0, scanningLength),
|
||||||
findTermsOptions
|
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 {expression, reading} = definitions[0];
|
||||||
const source = text.substring(0, sourceLength);
|
const source = text.substring(0, sourceLength);
|
||||||
for (const {text: text2, furigana} of jp.distributeFuriganaInflected(expression, reading, source)) {
|
for (const {text: text2, furigana} of jp.distributeFuriganaInflected(expression, reading, source)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user