File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -77,8 +77,6 @@ export const BaseLink = forwardRef<HTMLAnchorElement, LinkProps>(function Link(
77
77
78
78
const commonProps = {
79
79
ref,
80
- target : isExternal ? "_blank" : undefined ,
81
- rel : isExternal ? "noopener" : undefined ,
82
80
...props ,
83
81
className : cn ( className , { [ activeClassName ] : isActive } ) ,
84
82
href,
@@ -87,6 +85,8 @@ export const BaseLink = forwardRef<HTMLAnchorElement, LinkProps>(function Link(
87
85
if ( isExternal ) {
88
86
return (
89
87
< a
88
+ target = "_blank"
89
+ rel = "noopener"
90
90
onClick = { ( ) =>
91
91
trackCustomEvent (
92
92
customEventOptions ?? {
@@ -114,7 +114,9 @@ export const BaseLink = forwardRef<HTMLAnchorElement, LinkProps>(function Link(
114
114
115
115
if ( isInternalPdf ) {
116
116
return (
117
- < a
117
+ < NextLink
118
+ target = "_blank"
119
+ rel = "noopener"
118
120
// disable locale prefixing for internal PDFs
119
121
// TODO: add i18n support using a rehype plugin (similar as we do for
120
122
// images)
@@ -132,7 +134,7 @@ export const BaseLink = forwardRef<HTMLAnchorElement, LinkProps>(function Link(
132
134
{ ...commonProps }
133
135
>
134
136
{ children }
135
- </ a >
137
+ </ NextLink >
136
138
)
137
139
}
138
140
You can’t perform that action at this time.
0 commit comments