mirror of
https://github.com/alecthomas/chroma.git
synced 2025-02-13 13:28:27 +02:00
Always use CSS class from StandardTypes.
As opposed to remapping to classes that exist in the current style.
This commit is contained in:
parent
80d3b96869
commit
33f604c892
@ -195,6 +195,9 @@ func (f *Formatter) class(t chroma.TokenType) string {
|
||||
}
|
||||
|
||||
func (f *Formatter) styleAttr(styles map[chroma.TokenType]string, tt chroma.TokenType) string {
|
||||
if f.classes {
|
||||
return string(fmt.Sprintf(` class="%s"`, f.class(tt)))
|
||||
}
|
||||
if _, ok := styles[tt]; !ok {
|
||||
tt = tt.SubCategory()
|
||||
if _, ok := styles[tt]; !ok {
|
||||
@ -204,9 +207,6 @@ func (f *Formatter) styleAttr(styles map[chroma.TokenType]string, tt chroma.Toke
|
||||
}
|
||||
}
|
||||
}
|
||||
if f.classes {
|
||||
return string(fmt.Sprintf(` class="%s"`, f.class(tt)))
|
||||
}
|
||||
return string(fmt.Sprintf(` style="%s"`, styles[tt]))
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user