hf(md): avoid normalising markdown "mailto:" links

The "mailto:" links were being normalised which resulted in them being linking to a broken URL and not working.
pull/173/head
Harlan Wilton 5 years ago
parent 7c83105e51
commit ee95e5fded

@ -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)
}
}

Loading…
Cancel
Save