Skip to content

Commit ef483b6

Browse files
committed
Review
1 parent 8799689 commit ef483b6

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

packages/gitbook/src/components/DocumentView/InlineLink/InlineLink.tsx

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff 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'),

0 commit comments

Comments
 (0)