@@ -46,6 +46,7 @@ export async function InlineLink(props: InlineProps<DocumentInlineLink>) {
4646 ) ;
4747 }
4848 const isExternal = inline . data . ref . kind === 'url' ;
49+ const isMailto = resolved . href . startsWith ( 'mailto:' ) ;
4950 const content = (
5051 < StyledLink
5152 href = { resolved . href }
@@ -63,7 +64,12 @@ export async function InlineLink(props: InlineProps<DocumentInlineLink>) {
6364 nodes = { inline . nodes }
6465 ancestorInlines = { [ ...ancestorInlines , inline ] }
6566 />
66- { isExternal ? (
67+ { isMailto ? (
68+ < Icon
69+ icon = "envelope"
70+ className = "ml-1 inline size-3 links-accent:text-tint-subtle"
71+ />
72+ ) : isExternal ? (
6773 < Icon
6874 icon = "arrow-up-right"
6975 className = "ml-0.5 inline size-3 links-accent:text-tint-subtle"
@@ -96,16 +102,24 @@ function InlineLinkTooltipWrapper(props: {
96102 const { inline, language, resolved, children } = props ;
97103
98104 let breadcrumbs = resolved . ancestors ?? [ ] ;
105+ const isMailto = resolved . href . startsWith ( 'mailto:' ) ;
99106 const isExternal = inline . data . ref . kind === 'url' ;
100107 const isSamePage = inline . data . ref . kind === 'anchor' && inline . data . ref . page === undefined ;
101- if ( isExternal ) {
108+
109+ if ( isMailto ) {
110+ resolved . text = resolved . text . split ( 'mailto:' ) [ 1 ] ?? resolved . text ;
111+ breadcrumbs = [
112+ {
113+ label : tString ( language , 'link_tooltip_email' ) ,
114+ } ,
115+ ] ;
116+ } else if ( isExternal ) {
102117 breadcrumbs = [
103118 {
104119 label : tString ( language , 'link_tooltip_external_link' ) ,
105120 } ,
106121 ] ;
107- }
108- if ( isSamePage ) {
122+ } else if ( isSamePage ) {
109123 breadcrumbs = [
110124 {
111125 label : tString ( language , 'link_tooltip_page_anchor' ) ,
0 commit comments