From 7e9cadf6b0071eeedaef6d0648f37b54881d91b5 Mon Sep 17 00:00:00 2001 From: lin onetwo Date: Sun, 9 Jun 2024 23:05:37 +0800 Subject: [PATCH] Revert "fix: link end position should add ^id 's length" This reverts commit 9c2c6d724ea9cfa7a0ac93371699681404d53222. --- core/modules/parsers/wikiparser/rules/prettylink.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/modules/parsers/wikiparser/rules/prettylink.js b/core/modules/parsers/wikiparser/rules/prettylink.js index f577dba8c..b1172ac4a 100644 --- a/core/modules/parsers/wikiparser/rules/prettylink.js +++ b/core/modules/parsers/wikiparser/rules/prettylink.js @@ -40,7 +40,7 @@ exports.parse = function() { textEndPos = this.matchRegExp.lastIndex - 2; } var linkStart = this.match[2] ? (start + this.match[1].length + 1) : start; - var linkEnd = anchor ? (linkStart + link.length + 1 + anchor.length) : (linkStart + link.length); + var linkEnd = linkStart + link.length; if($tw.utils.isLinkExternal(link)) { // add back the part after `^` to the ext link, if it happen to has one. if(anchor) {