mirror of
https://github.com/rwinkhart/glamour-temp-MUTN.git
synced 2026-09-02 06:57:30 -04:00
Use TrueColor color profile as default
Users can override the desired profile by calling WithColorProfile.
This commit is contained in:
+3
-3
@@ -102,16 +102,16 @@ func (e *CodeBlockElement) Render(w io.Writer, ctx RenderContext) error {
|
||||
}
|
||||
|
||||
iw := indent.NewWriterPipe(w, indentation+margin, func(wr io.Writer) {
|
||||
renderText(w, ctx.colorProfile, bs.Current().Style.StylePrimitive, " ")
|
||||
renderText(w, ctx.options.ColorProfile, bs.Current().Style.StylePrimitive, " ")
|
||||
})
|
||||
|
||||
if len(theme) > 0 {
|
||||
renderText(iw, ctx.colorProfile, bs.Current().Style.StylePrimitive, rules.BlockPrefix)
|
||||
renderText(iw, ctx.options.ColorProfile, bs.Current().Style.StylePrimitive, rules.BlockPrefix)
|
||||
err := quick.Highlight(iw, e.Code, e.Language, "terminal256", theme)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
renderText(iw, ctx.colorProfile, bs.Current().Style.StylePrimitive, rules.BlockSuffix)
|
||||
renderText(iw, ctx.options.ColorProfile, bs.Current().Style.StylePrimitive, rules.BlockSuffix)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user