diff --git a/.changeset/young-dryers-call.md b/.changeset/young-dryers-call.md new file mode 100644 index 000000000..cd600cb82 --- /dev/null +++ b/.changeset/young-dryers-call.md @@ -0,0 +1,5 @@ +--- +"gitbook": patch +--- + +Better handling for external link "mailto:" in Hovered Card in GBO diff --git a/packages/gitbook/src/components/DocumentView/InlineLink/InlineLink.tsx b/packages/gitbook/src/components/DocumentView/InlineLink/InlineLink.tsx index e0869e3e9..940b42e89 100644 --- a/packages/gitbook/src/components/DocumentView/InlineLink/InlineLink.tsx +++ b/packages/gitbook/src/components/DocumentView/InlineLink/InlineLink.tsx @@ -46,6 +46,7 @@ export async function InlineLink(props: InlineProps) { ); } const isExternal = inline.data.ref.kind === 'url'; + const isMailto = resolved.href.startsWith('mailto:'); const content = ( ) { nodes={inline.nodes} ancestorInlines={[...ancestorInlines, inline]} /> - {isExternal ? ( + {isMailto ? ( + + ) : isExternal ? (