fix(md): avoid normalising markdown "mailto:" links (#173)

The "mailto:" links were being normalised which resulted in them being linking to a broken URL and not working.
pull/190/head
Harlan Wilton 4 years ago committed by GitHub
parent 5ba4ea2ef0
commit 18d18d2eb1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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