From 1b670f929680bad73993fe0a6f6606a89f9c1440 Mon Sep 17 00:00:00 2001 From: Charlie Hsieh Date: Wed, 9 Sep 2026 17:20:39 +0800 Subject: [PATCH 1/2] fix: missing pos/size on linkify text token --- lib/rules_inline/linkify.mjs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/rules_inline/linkify.mjs b/lib/rules_inline/linkify.mjs index fdc817a4a..aa481e05b 100644 --- a/lib/rules_inline/linkify.mjs +++ b/lib/rules_inline/linkify.mjs @@ -45,6 +45,8 @@ export default function linkify (state, silent) { const token_t = state.push('text', '', 0) token_t.content = state.md.normalizeLinkText(url) + token_t.position = pos - proto.length + token_t.size = token_t.content.length const token_c = state.push('link_close', 'a', -1) token_c.markup = 'linkify' From e5437e75d55b7cf087613100d5f51be2e41f249e Mon Sep 17 00:00:00 2001 From: Charlie Hsieh <47630639+galaxian85@users.noreply.github.com> Date: Wed, 9 Sep 2026 18:15:29 +0800 Subject: [PATCH 2/2] fix: use origin text length to calculate token size for linkify Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- lib/rules_inline/linkify.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rules_inline/linkify.mjs b/lib/rules_inline/linkify.mjs index aa481e05b..785fd0db3 100644 --- a/lib/rules_inline/linkify.mjs +++ b/lib/rules_inline/linkify.mjs @@ -46,7 +46,7 @@ export default function linkify (state, silent) { const token_t = state.push('text', '', 0) token_t.content = state.md.normalizeLinkText(url) token_t.position = pos - proto.length - token_t.size = token_t.content.length + token_t.size = url.length const token_c = state.push('link_close', 'a', -1) token_c.markup = 'linkify'