Skip to content

Commit 8d10119

Browse files
authoredSep 21, 2020
feat($theme-default): inform screen readers link opens in new tab/window (fix #2601) (#2603)
1 parent 844b56a commit 8d10119

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed
 

‎packages/@vuepress/core/lib/client/components/OutboundLink.vue

+15-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
1-
<template functional>
1+
<template>
22
<svg
33
class="icon outbound"
44
xmlns="http://www.w3.org/2000/svg"
5-
aria-hidden="true"
5+
aria-labelledby="outbound-link-title"
6+
role="img"
7+
focusable="false"
68
x="0px"
79
y="0px"
810
viewBox="0 0 100 100"
911
width="15"
1012
height="15"
1113
>
14+
<title id="outbound-link-title">{{ openInNewWindowTitle }}</title>
1215
<path
1316
fill="currentColor"
1417
d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"
@@ -20,6 +23,16 @@
2023
</svg>
2124
</template>
2225

26+
<script>
27+
export default {
28+
computed: {
29+
openInNewWindowTitle () {
30+
return this.$themeLocaleConfig.openNewWindowText || '(opens new window)'
31+
}
32+
}
33+
}
34+
</script>
35+
2336
<style>
2437
.icon.outbound {
2538
color: #aaa;

0 commit comments

Comments
 (0)
Please sign in to comment.