mirror of
https://github.com/alecthomas/chroma.git
synced 2025-03-17 20:58:08 +02:00
Removes 'tabindex="0"' from `<pre>' elements
This commit is contained in:
parent
3d1bc51fa8
commit
633f8e0f55
@ -171,10 +171,10 @@ var (
|
||||
defaultPreWrapper = preWrapper{
|
||||
start: func(code bool, styleAttr string) string {
|
||||
if code {
|
||||
return fmt.Sprintf(`<pre tabindex="0"%s><code>`, styleAttr)
|
||||
return fmt.Sprintf(`<pre%s><code>`, styleAttr)
|
||||
}
|
||||
|
||||
return fmt.Sprintf(`<pre tabindex="0"%s>`, styleAttr)
|
||||
return fmt.Sprintf(`<pre%s>`, styleAttr)
|
||||
},
|
||||
end: func(code bool) string {
|
||||
if code {
|
||||
|
@ -293,7 +293,7 @@ func TestWithPreWrapper(t *testing.T) {
|
||||
|
||||
t.Run("Regular", func(t *testing.T) {
|
||||
s := format(New(WithClasses(true)))
|
||||
assert.Equal(t, s, `<pre tabindex="0" class="chroma"><code><span class="line"><span class="cl"><span class="nb">echo</span> FOO</span></span></code></pre>`)
|
||||
assert.Equal(t, s, `<pre class="chroma"><code><span class="line"><span class="cl"><span class="nb">echo</span> FOO</span></span></code></pre>`)
|
||||
})
|
||||
|
||||
t.Run("PreventSurroundingPre", func(t *testing.T) {
|
||||
@ -347,7 +347,7 @@ func TestReconfigureOptions(t *testing.T) {
|
||||
err = f.Format(&buf, styles.Fallback, it)
|
||||
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, `<pre tabindex="0" class="chroma"><code><span class="line"><span class="cl"><span class="nb">echo</span> FOO</span></span></code></pre>`, buf.String())
|
||||
assert.Equal(t, `<pre class="chroma"><code><span class="line"><span class="cl"><span class="nb">echo</span> FOO</span></span></code></pre>`, buf.String())
|
||||
}
|
||||
|
||||
func TestWriteCssWithAllClasses(t *testing.T) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user