Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrhymes <github@rhymes.dev>2021-07-15 17:48:39 +0300
committerGitHub <noreply@github.com>2021-07-15 17:48:39 +0300
commitf27e542442d19436f1428cc22bb03aca398d37a7 (patch)
tree9f3b53dc99405d4bcd4957a4ada4bd0077d5818c /hugolib/page_test.go
parentae6cf93c84c3584b111f4b9fa3fb4e3f63d37915 (diff)
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
Diffstat (limited to 'hugolib/page_test.go')
-rw-r--r--hugolib/page_test.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/hugolib/page_test.go b/hugolib/page_test.go
index 5bc3db22f..7a1ff6c4e 100644
--- a/hugolib/page_test.go
+++ b/hugolib/page_test.go
@@ -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`,
)
}