From 12a1d999ed62aff2d1f0cd12a2a650cfeb6d93eb Mon Sep 17 00:00:00 2001 From: Guy Sartorelli Date: Thu, 5 May 2022 15:54:32 +1200 Subject: [PATCH] FIX Ensure mailto links work as expected. --- src/utils/rewriteLink.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/utils/rewriteLink.ts b/src/utils/rewriteLink.ts index 4203aaf..4e3ed5c 100644 --- a/src/utils/rewriteLink.ts +++ b/src/utils/rewriteLink.ts @@ -41,6 +41,15 @@ const rewriteLink = ( const currentNode = getCurrentNode(); const version = getCurrentVersion(); + // mailto links + if (href.startsWith('mailto:')) { + return createElement( + 'a', + { href }, + domToReact(children, parseOptions) + ); + } + // hash links if (href.startsWith('#')) { return createElement(