From 530c45d2135bb3907646372b78a61ce020f0cf18 Mon Sep 17 00:00:00 2001 From: Siavash Askari Nasr Date: Tue, 14 Jun 2022 09:02:22 +0430 Subject: [PATCH] Don't append semicolon to styleEntry if there is no other style This means we also need to append semicolon to `Background`. --- formatters/html/html.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/formatters/html/html.go b/formatters/html/html.go index 3c3134c78..982f7651d 100644 --- a/formatters/html/html.go +++ b/formatters/html/html.go @@ -467,12 +467,12 @@ func (f *Formatter) styleToCSS(style *chroma.Style) map[chroma.TokenType]string } styleEntryCSS := StyleEntryToCSS(entry) - if styleEntryCSS != `` { + if styleEntryCSS != `` && classes[t] != `` { styleEntryCSS += `;` } classes[t] = styleEntryCSS + classes[t] } - classes[chroma.Background] += f.tabWidthStyle() + classes[chroma.Background] += `;` + f.tabWidthStyle() classes[chroma.PreWrapper] += classes[chroma.Background] // Make PreWrapper a grid to show highlight style with full width. if len(f.highlightRanges) > 0 && f.customCSS[chroma.PreWrapper] == `` {