Skip to content

Commit

Permalink
perf(a11y): add aria-hidden to line numbers wrapper (#1675)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenxsan authored Dec 9, 2022
1 parent 30924f5 commit 4c5a892
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/node/markdown/plugins/lineNumbers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const lineNumberPlugin = (md: MarkdownIt) => {
.map((line, index) => `<span class="line-number">${index + 1}</span><br>`)
.join('')

const lineNumbersWrapperCode = `<div class="line-numbers-wrapper">${lineNumbersCode}</div>`
const lineNumbersWrapperCode = `<div class="line-numbers-wrapper" aria-hidden="true">${lineNumbersCode}</div>`

const finalCode = rawCode
.replace(/<\/div>$/, `${lineNumbersWrapperCode}</div>`)
Expand Down

0 comments on commit 4c5a892

Please sign in to comment.