mirror of
https://github.com/rwinkhart/glamour-temp-MUTN.git
synced 2026-09-06 00:47:15 -04:00
fix(ansi): register chroma styles
termenv changed the order of profiles, now 1 no longer equals ANSI.
This commit is contained in:
committed by
Christian Muehlhaeuser
parent
dc4e563549
commit
50e7d3bab8
+2
-1
@@ -8,6 +8,7 @@ import (
|
|||||||
"github.com/alecthomas/chroma/quick"
|
"github.com/alecthomas/chroma/quick"
|
||||||
"github.com/alecthomas/chroma/styles"
|
"github.com/alecthomas/chroma/styles"
|
||||||
"github.com/muesli/reflow/indent"
|
"github.com/muesli/reflow/indent"
|
||||||
|
"github.com/muesli/termenv"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -75,7 +76,7 @@ func (e *CodeBlockElement) Render(w io.Writer, ctx RenderContext) error {
|
|||||||
}
|
}
|
||||||
theme := rules.Theme
|
theme := rules.Theme
|
||||||
|
|
||||||
if rules.Chroma != nil && ctx.options.ColorProfile > 1 {
|
if rules.Chroma != nil && ctx.options.ColorProfile != termenv.Ascii {
|
||||||
theme = chromaStyleTheme
|
theme = chromaStyleTheme
|
||||||
mutex.Lock()
|
mutex.Lock()
|
||||||
// Don't register the style if it's already registered.
|
// Don't register the style if it's already registered.
|
||||||
|
|||||||
Reference in New Issue
Block a user