From 16c42dcdd3122dc94766442a922781c90ae73382 Mon Sep 17 00:00:00 2001 From: Charlie Tonneslan Date: Sun, 31 May 2026 14:12:19 -0400 Subject: [PATCH] formatters/html: drop -moz-tab-size and -o-tab-size prefixes Both prefixes are obsolete. Per MDN, Opera supports unprefixed tab-size since 2013 and Firefox switched in v91 (2021). Every current browser that chroma's HTML output is likely to be read by understands the bare tab-size property. Closes #1059 Signed-off-by: Charlie Tonneslan --- formatters/html/html.go | 2 +- formatters/html/html_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/formatters/html/html.go b/formatters/html/html.go index b4995864e..cba74a5cd 100644 --- a/formatters/html/html.go +++ b/formatters/html/html.go @@ -437,7 +437,7 @@ func (f *Formatter) styleAttrWithMode(styles map[chroma.TokenType]string, tt chr 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("tab-size: %d;", f.tabWidth) } return "" } diff --git a/formatters/html/html_test.go b/formatters/html/html_test.go index 26533749f..a5495ed6a 100644 --- a/formatters/html/html_test.go +++ b/formatters/html/html_test.go @@ -160,7 +160,7 @@ func TestTabWidthStyle(t *testing.T) { err = f.Format(&buf, styles.Fallback, it) assert.NoError(t, err) - assert.True(t, regexp.MustCompile(`