Skip to content

Commit e4c60ab

Browse files
authored
fix: remove explicit noopener from external links (#871)
1 parent 1ef7a18 commit e4c60ab

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

docs/guide/markdown.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Pages and internal links get generated with the `.html` suffix by default.
4646

4747
### External Links
4848

49-
Outbound links automatically get `target="_blank" rel="noopener noreferrer"`:
49+
Outbound links automatically get `target="_blank" rel="noreferrer"`:
5050

5151
- [vuejs.org](https://vuejs.org)
5252
- [VitePress on GitHub](https://github.com/vuejs/vitepress)

src/client/theme-default/components/VPButton.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const component = computed(() => {
3434
:class="classes"
3535
:href="href ? normalizeLink(href) : undefined"
3636
:target="isExternal ? '_blank' : undefined"
37-
:rel="isExternal ? 'noopener noreferrer' : undefined"
37+
:rel="isExternal ? 'noreferrer' : undefined"
3838
>
3939
{{ text }}
4040
</component>

src/client/theme-default/components/VPLink.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const isExternal = computed(() => props.href && EXTERNAL_URL_RE.test(props.href)
1919
:class="{ link: href }"
2020
:href="href ? normalizeLink(href) : undefined"
2121
:target="isExternal ? '_blank' : undefined"
22-
:rel="isExternal ? 'noopener noreferrer' : undefined"
22+
:rel="isExternal ? 'noreferrer' : undefined"
2323
>
2424
<slot />
2525
<VPIconExternalLink v-if="isExternal && !noIcon" class="icon" />

src/client/theme-default/components/VPSocialLink.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const icons = {
3232
:href="link"
3333
:title="icon"
3434
target="_blank"
35-
rel="noopener noreferrer"
35+
rel="noreferrer"
3636
>
3737
<component :is="icons[icon]" class="icon" />
3838
<span class="visually-hidden">{{ icon }}</span>

src/node/markdown/markdown.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export const createMarkdownRenderer = async (
7878
linkPlugin,
7979
{
8080
target: '_blank',
81-
rel: 'noopener noreferrer',
81+
rel: 'noreferrer',
8282
...options.externalLinks
8383
},
8484
base

src/node/markdownToVue.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export async function createMarkdownToVueRenderFn(
8383
`\n(!) Found dead link ${c.cyan(url)} in file ${c.white(
8484
c.dim(file)
8585
)}\nIf it is intended, you can use:\n ${c.cyan(
86-
`<a href="${url}" target="_blank" rel="noopener noreferrer">${url}</a>`
86+
`<a href="${url}" target="_blank" rel="noreferrer">${url}</a>`
8787
)}`
8888
)
8989
)

0 commit comments

Comments
 (0)