Move text sanitizing to RenderContext

This commit is contained in:
Christian Muehlhaeuser
2019-12-10 17:32:49 +01:00
parent 9e615ab474
commit 50046dd6b3
3 changed files with 35 additions and 18 deletions
+1 -11
View File
@@ -8,14 +8,9 @@ import (
"net/url"
"strings"
"github.com/microcosm-cc/bluemonday"
bf "gopkg.in/russross/blackfriday.v2"
)
var (
stripper = bluemonday.StrictPolicy()
)
type Options struct {
BaseURL string
WordWrap int
@@ -66,12 +61,7 @@ func NewTermRendererFromBytes(b []byte, options Options) (*TermRenderer, error)
}
tr := &TermRenderer{
context: RenderContext{
style: make(map[StyleType]ElementStyle),
blockStack: &BlockStack{},
table: &TableElement{},
options: options,
},
context: NewRenderContext(options),
}
for k, v := range e {