Skip to content

Commit e923a88

Browse files
committedDec 4, 2023
1 parent 0d9b8fe commit e923a88

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed
 

‎app/src/protyle/hint/index.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -898,7 +898,14 @@ ${genHintItemHTML(item)}
898898
this.lastIndex = -1;
899899
this.splitChar = "";
900900
extend.forEach((item) => {
901-
const currentLastIndex = currentLineValue.lastIndexOf(item.key);
901+
let currentLastIndex = currentLineValue.lastIndexOf(item.key);
902+
// https://ld246.com/article/1701670704754
903+
if (Constants.BLOCK_HINT_KEYS.includes(item.key) && currentLastIndex > -1) {
904+
const thirdLastIndex = currentLineValue.lastIndexOf(item.key + item.key.substring(0, 1))
905+
if (thirdLastIndex > -1) {
906+
currentLastIndex = Math.min(currentLastIndex, currentLineValue.lastIndexOf(item.key + item.key.substring(0, 1)))
907+
}
908+
}
902909
if (this.lastIndex < currentLastIndex) {
903910
if (Constants.BLOCK_HINT_KEYS.includes(this.splitChar) &&
904911
(item.key === ":" || item.key === "#" || item.key === "/" || item.key === "、")) {

0 commit comments

Comments
 (0)
Please sign in to comment.