mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-16 20:53:59 +02:00
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:
@@ -123,7 +123,7 @@ type preWrapper struct {
|
||||
|
||||
func (p preWrapper) Start(code bool, styleAttr string) string {
|
||||
w := &strings.Builder{}
|
||||
fmt.Fprintf(w, "<pre%s>", styleAttr)
|
||||
fmt.Fprintf(w, `<pre tabindex="0"%s>`, styleAttr)
|
||||
var language string
|
||||
if code {
|
||||
language = p.language
|
||||
|
Reference in New Issue
Block a user