markup: Add tabindex="0" to default <pre> wrapper

Currently the generated `<pre>` element isn't fully accessible as it can't be focused by keyboard users.
To make this fully accessible, the attribute `tabindex="0"` should be added to the `<pre>` tag.

Closes #7194
This commit is contained in:
rhymes
2021-07-15 16:48:39 +02:00
committed by GitHub
parent ae6cf93c84
commit f27e542442
5 changed files with 13 additions and 13 deletions

View File

@@ -1731,12 +1731,12 @@ $$$
// Blackfriday does not support this extended attribute syntax.
b.AssertFileContent("public/page1/index.html",
`<pre><code class="language-bash {hl_lines=[1]}" data-lang="bash {hl_lines=[1]}">SHORT</code></pre>`,
`<pre><code class="language-bash {hl_lines=[1]}" data-lang="bash {hl_lines=[1]}">MARKDOWN`,
`<pre tabindex="0"><code class="language-bash {hl_lines=[1]}" data-lang="bash {hl_lines=[1]}">SHORT</code></pre>`,
`<pre tabindex="0"><code class="language-bash {hl_lines=[1]}" data-lang="bash {hl_lines=[1]}">MARKDOWN`,
)
b.AssertFileContent("public/page2/index.html",
`<pre><code class="language-bash {hl_lines=[1]}" data-lang="bash {hl_lines=[1]}">SHORT`,
`<pre tabindex="0"><code class="language-bash {hl_lines=[1]}" data-lang="bash {hl_lines=[1]}">SHORT`,
)
}