Skip to content

Commit

Permalink
Don't append semicolon to styleEntry if there is no other style
Browse files Browse the repository at this point in the history
This means we also need to append semicolon to `Background`.
  • Loading branch information
CIAvash authored and alecthomas committed Jun 14, 2022
1 parent 5397b48 commit 530c45d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions formatters/html/html.go
Expand Up @@ -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] == `` {
Expand Down

0 comments on commit 530c45d

Please sign in to comment.