Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] Improve fragment links #18667

Closed
wants to merge 9 commits into from
Prev Previous commit
Next Next commit
Improve a11y of fragment links
- alt in a image within a link should describe the link
- added title to explain purpose for visual browsers
eps1lon committed Dec 4, 2019
commit 210c713fcc514ce45b88249f6b2a3934d0dd3636
4 changes: 2 additions & 2 deletions docs/src/modules/components/MarkdownElement.js
Original file line number Diff line number Diff line change
@@ -32,8 +32,8 @@ renderer.heading = (text, level) => {
return [
`<h${level}>`,
`<a class="anchor-link" id="${fragmentId}"></a>${text}`,
`<a class="anchor-link-style" aria-label="${text}" href="#${fragmentId}">`,
'<svg><use xlink:href="#icons--fragment-link" /></svg>',
`<a class="anchor-link-style" title="link to this heading" href="#${fragmentId}">`,
`<svg alt="${text}"><use xlink:href="#icons--fragment-link" /></svg>`,
`</a>`,
`</h${level}>`,
].join('');