Skip to content

Commit

Permalink
fix(md): avoid normalising markdown "mailto:" links (#173)
Browse files Browse the repository at this point in the history
The "mailto:" links were being normalised which resulted in them being linking to a broken URL and not working.
  • Loading branch information
harlan-zw authored Dec 23, 2020
1 parent 5ba4ea2 commit 18d18d2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/node/markdown/plugins/link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ export const linkPlugin = (
Object.entries(externalAttrs).forEach(([key, val]) => {
token.attrSet(key, val)
})
} else if (!url.startsWith('#')) {
} else if (
// internal anchor links
!url.startsWith('#') &&
// mail links
!url.startsWith('mailto:')
) {
normalizeHref(hrefAttr)
}
}
Expand Down

1 comment on commit 18d18d2

@vercel
Copy link

@vercel vercel bot commented on 18d18d2 Dec 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.