Skip to content

Commit e24899a

Browse files
committedJun 9, 2024·
fix(build): don't normalize links containing target or download property
matches the router behavior more closely closes #3947
1 parent 57cd793 commit e24899a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

‎src/node/markdown/plugins/link.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ export const linkPlugin = (
2727
) => {
2828
const token = tokens[idx]
2929
const hrefIndex = token.attrIndex('href')
30-
if (hrefIndex >= 0) {
30+
const targetIndex = token.attrIndex('target')
31+
const downloadIndex = token.attrIndex('download')
32+
if (hrefIndex >= 0 && targetIndex < 0 && downloadIndex < 0) {
3133
const hrefAttr = token.attrs![hrefIndex]
3234
const url = hrefAttr[1]
3335
if (isExternal(url)) {

0 commit comments

Comments
 (0)
Please sign in to comment.