mirror of
https://github.com/alecthomas/chroma.git
synced 2025-03-25 21:39:02 +02:00
Don't append semicolon to styleEntry if there is no other style
This means we also need to append semicolon to `Background`.
This commit is contained in:
parent
5397b4880b
commit
530c45d213
@ -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] == `` {
|
||||
|
Loading…
x
Reference in New Issue
Block a user