mirror of
https://github.com/rwinkhart/glamour-temp-MUTN.git
synced 2026-08-31 06:06:41 -04:00
Let user pick a syntax color theme in Gold's style config
This commit is contained in:
@@ -427,7 +427,14 @@ func (tr *TermRenderer) RenderNode(w io.Writer, node *bf.Node, entering bool) bf
|
||||
|
||||
for _, f := range e.Fragments {
|
||||
if node.Type == bf.CodeBlock {
|
||||
err := quick.Highlight(w, f.Token, string(node.CodeBlockData.Info), "terminal16m", "monokai")
|
||||
theme := "monokai"
|
||||
if rules, ok := tr.style[f.Style]; ok {
|
||||
if len(rules.Theme) > 0 {
|
||||
theme = rules.Theme
|
||||
}
|
||||
}
|
||||
|
||||
err := quick.Highlight(w, f.Token, string(node.CodeBlockData.Info), "terminal16m", theme)
|
||||
if err == nil {
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user