From e923a885866147d1ef9033d266dedef6fef5c078 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Mon, 4 Dec 2023 19:20:17 +0800 Subject: [PATCH] :art: fix https://ld246.com/article/1701670704754 --- app/src/protyle/hint/index.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/src/protyle/hint/index.ts b/app/src/protyle/hint/index.ts index 9181488b7..078822e77 100644 --- a/app/src/protyle/hint/index.ts +++ b/app/src/protyle/hint/index.ts @@ -898,7 +898,14 @@ ${genHintItemHTML(item)} this.lastIndex = -1; this.splitChar = ""; extend.forEach((item) => { - const currentLastIndex = currentLineValue.lastIndexOf(item.key); + let currentLastIndex = currentLineValue.lastIndexOf(item.key); + // https://ld246.com/article/1701670704754 + if (Constants.BLOCK_HINT_KEYS.includes(item.key) && currentLastIndex > -1) { + const thirdLastIndex = currentLineValue.lastIndexOf(item.key + item.key.substring(0, 1)) + if (thirdLastIndex > -1) { + currentLastIndex = Math.min(currentLastIndex, currentLineValue.lastIndexOf(item.key + item.key.substring(0, 1))) + } + } if (this.lastIndex < currentLastIndex) { if (Constants.BLOCK_HINT_KEYS.includes(this.splitChar) && (item.key === ":" || item.key === "#" || item.key === "/" || item.key === "、")) {