Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Append semicolon to tabWidthStyle.
  • Loading branch information
CIAvash authored and alecthomas committed Jun 14, 2022
1 parent c78b8a6 commit 5397b48
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion formatters/html/html.go
Expand Up @@ -381,7 +381,7 @@ func (f *Formatter) styleAttr(styles map[chroma.TokenType]string, tt chroma.Toke

func (f *Formatter) tabWidthStyle() string {
if f.tabWidth != 0 && f.tabWidth != 8 {
return fmt.Sprintf("-moz-tab-size: %[1]d; -o-tab-size: %[1]d; tab-size: %[1]d", f.tabWidth)
return fmt.Sprintf("-moz-tab-size: %[1]d; -o-tab-size: %[1]d; tab-size: %[1]d;", f.tabWidth)
}
return ""
}
Expand Down
2 changes: 1 addition & 1 deletion formatters/html/html_test.go
Expand Up @@ -117,7 +117,7 @@ func TestTabWidthStyle(t *testing.T) {
err = f.Format(&buf, styles.Fallback, it)
assert.NoError(t, err)

assert.Regexp(t, `<pre.*style=".*background-color:[^;]+;-moz-tab-size:4;-o-tab-size:4;tab-size:4[^"]*".+`, buf.String())
assert.Regexp(t, `<pre.*style=".*background-color:[^;]+;-moz-tab-size:4;-o-tab-size:4;tab-size:4;[^"]*".+`, buf.String())
}

func TestWithCustomCSS(t *testing.T) {
Expand Down

0 comments on commit 5397b48

Please sign in to comment.