Keep termenv profile in RenderContext

This commit is contained in:
Christian Muehlhaeuser
2020-01-31 14:47:00 +01:00
parent 7467d9e1a5
commit 66b7555d75
9 changed files with 43 additions and 39 deletions
+8 -5
View File
@@ -5,6 +5,7 @@ import (
"strings"
"github.com/microcosm-cc/bluemonday"
"github.com/muesli/termenv"
)
// RenderContext holds the current rendering options and state.
@@ -14,16 +15,18 @@ type RenderContext struct {
blockStack *BlockStack
table *TableElement
stripper *bluemonday.Policy
stripper *bluemonday.Policy
colorProfile termenv.Profile
}
// NewRenderContext returns a new RenderContext.
func NewRenderContext(options Options) RenderContext {
return RenderContext{
options: options,
blockStack: &BlockStack{},
table: &TableElement{},
stripper: bluemonday.StrictPolicy(),
options: options,
blockStack: &BlockStack{},
table: &TableElement{},
stripper: bluemonday.StrictPolicy(),
colorProfile: termenv.ColorProfile(),
}
}