Skip to content

Commit

Permalink
feat($theme-default): inform screen readers link opens in new tab/win…
Browse files Browse the repository at this point in the history
…dow (fix #2601) (#2603)
  • Loading branch information
d-pollard authored Sep 21, 2020
1 parent 844b56a commit 8d10119
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions packages/@vuepress/core/lib/client/components/OutboundLink.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
<template functional>
<template>
<svg
class="icon outbound"
xmlns="http://www.w3.org/2000/svg"
aria-hidden="true"
aria-labelledby="outbound-link-title"
role="img"
focusable="false"
x="0px"
y="0px"
viewBox="0 0 100 100"
width="15"
height="15"
>
<title id="outbound-link-title">{{ openInNewWindowTitle }}</title>
<path
fill="currentColor"
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"
Expand All @@ -20,6 +23,16 @@
</svg>
</template>

<script>
export default {
computed: {
openInNewWindowTitle () {
return this.$themeLocaleConfig.openNewWindowText || '(opens new window)'
}
}
}
</script>

<style>
.icon.outbound {
color: #aaa;
Expand Down

0 comments on commit 8d10119

Please sign in to comment.