File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed
packages/gitbook/src/components/DocumentView/InlineLink Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -69,8 +69,7 @@ export async function InlineLink(props: InlineProps<DocumentInlineLink>) {
6969 icon = "envelope"
7070 className = "ml-1 inline size-3 links-accent:text-tint-subtle"
7171 />
72- ) : null }
73- { isExternal && ! isMailto ? (
72+ ) : isExternal ? (
7473 < Icon
7574 icon = "arrow-up-right"
7675 className = "ml-0.5 inline size-3 links-accent:text-tint-subtle"
@@ -106,22 +105,21 @@ function InlineLinkTooltipWrapper(props: {
106105 const isMailto = resolved . href . startsWith ( 'mailto:' ) ;
107106 const isExternal = inline . data . ref . kind === 'url' ;
108107 const isSamePage = inline . data . ref . kind === 'anchor' && inline . data . ref . page === undefined ;
109- if ( isExternal ) {
108+
109+ if ( isMailto ) {
110+ resolved . text = resolved . text . split ( 'mailto:' ) [ 1 ] ?? resolved . text ;
110111 breadcrumbs = [
111112 {
112- label : tString ( language , 'link_tooltip_external_link ' ) ,
113+ label : tString ( language , 'link_tooltip_email ' ) ,
113114 } ,
114115 ] ;
115- }
116- if ( isMailto ) {
117- resolved . text = resolved . text . split ( 'mailto:' ) [ 1 ] ?? resolved . text ;
116+ } else if ( isExternal ) {
118117 breadcrumbs = [
119118 {
120- label : tString ( language , 'link_tooltip_email ' ) ,
119+ label : tString ( language , 'link_tooltip_external_link ' ) ,
121120 } ,
122121 ] ;
123- }
124- if ( isSamePage ) {
122+ } else if ( isSamePage ) {
125123 breadcrumbs = [
126124 {
127125 label : tString ( language , 'link_tooltip_page_anchor' ) ,
You can’t perform that action at this time.
0 commit comments