Skip to content

Commit 235a4aa

Browse files
committed
fix($core): vuejs#2627 Dup ID violates HTML5-3
1 parent fa3d481 commit 235a4aa

File tree

1 file changed

+25
-26
lines changed

1 file changed

+25
-26
lines changed

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

+25-26
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,34 @@
11
<template>
2-
<svg
3-
class="icon outbound"
4-
xmlns="http://www.w3.org/2000/svg"
5-
:aria-labelledby="rIdx"
6-
role="img"
7-
focusable="false"
8-
x="0px"
9-
y="0px"
10-
viewBox="0 0 100 100"
11-
width="15"
12-
height="15"
2+
<span
3+
:title="openInNewWindowTitle"
4+
class="sr-only"
135
>
14-
<title :id="rIdx">{{ openInNewWindowTitle }}</title>
15-
<path
16-
fill="currentColor"
17-
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"
18-
/>
19-
<polygon
20-
fill="currentColor"
21-
points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"
22-
/>
23-
</svg>
6+
<svg
7+
class="icon outbound"
8+
xmlns="http://www.w3.org/2000/svg"
9+
aria-hidden="true"
10+
role="img"
11+
focusable="false"
12+
x="0px"
13+
y="0px"
14+
viewBox="0 0 100 100"
15+
width="15"
16+
height="15"
17+
>
18+
<path
19+
fill="currentColor"
20+
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"
21+
/>
22+
<polygon
23+
fill="currentColor"
24+
points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"
25+
/>
26+
</svg>
27+
</span>
2428
</template>
2529

2630
<script>
2731
export default {
28-
data: function () {
29-
return {
30-
rIdx: 'outbound-link-title-' + Math.floor(Math.random() * 1000000)
31-
}
32-
},
3332
computed: {
3433
openInNewWindowTitle () {
3534
return this.$themeLocaleConfig.openNewWindowText || '(opens new window)'

0 commit comments

Comments
 (0)