From e24899a073d066486e5f7ae0c47ba6d901d5ae51 Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Sun, 9 Jun 2024 09:32:43 +0530 Subject: [PATCH] fix(build): don't normalize links containing target or download property matches the router behavior more closely closes #3947 --- src/node/markdown/plugins/link.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/node/markdown/plugins/link.ts b/src/node/markdown/plugins/link.ts index 6ffed066..978ff33b 100644 --- a/src/node/markdown/plugins/link.ts +++ b/src/node/markdown/plugins/link.ts @@ -27,7 +27,9 @@ export const linkPlugin = ( ) => { const token = tokens[idx] const hrefIndex = token.attrIndex('href') - if (hrefIndex >= 0) { + const targetIndex = token.attrIndex('target') + const downloadIndex = token.attrIndex('download') + if (hrefIndex >= 0 && targetIndex < 0 && downloadIndex < 0) { const hrefAttr = token.attrs![hrefIndex] const url = hrefAttr[1] if (isExternal(url)) {