1
0
mirror of https://github.com/alecthomas/chroma.git synced 2025-07-13 01:10:14 +02:00

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

This commit is contained in:
rhymes
2021-05-23 23:13:00 +02:00
committed by Alec Thomas
parent 8513d9997e
commit c8581d47ee
2 changed files with 3 additions and 3 deletions

View File

@ -202,7 +202,7 @@ func TestWithPreWrapper(t *testing.T) {
t.Run("Regular", func(t *testing.T) {
s := format(New(WithClasses(true)))
assert.Equal(t, s, `<pre class="chroma"><span class="nb">echo</span> FOO</pre>`)
assert.Equal(t, s, `<pre tabindex="0" class="chroma"><span class="nb">echo</span> FOO</pre>`)
})
t.Run("PreventSurroundingPre", func(t *testing.T) {
@ -246,7 +246,7 @@ func TestReconfigureOptions(t *testing.T) {
err = f.Format(&buf, styles.Fallback, it)
assert.NoError(t, err)
assert.Equal(t, `<pre class="chroma"><span class="nb">echo</span> FOO</pre>`, buf.String())
assert.Equal(t, `<pre tabindex="0" class="chroma"><span class="nb">echo</span> FOO</pre>`, buf.String())
}
func TestWriteCssWithAllClasses(t *testing.T) {