Render styled prefix & suffix for primitives

This commit is contained in:
Christian Muehlhaeuser
2019-12-13 03:16:50 +01:00
parent 5b7ca1696b
commit b51db92b65
+7
View File
@@ -145,11 +145,18 @@ func (e *BaseElement) Render(w io.Writer, ctx RenderContext) error {
}()
rules := bs.With(e.Style)
// render unstyled prefix/suffix
renderText(w, bs.Current().Style.StylePrimitive, rules.Prefix)
defer func() {
renderText(w, bs.Current().Style.StylePrimitive, rules.Suffix)
}()
// render styled prefix/suffix
renderText(w, rules, rules.StyledPrefix)
defer func() {
renderText(w, rules, rules.StyledSuffix)
}()
s := e.Token
if len(rules.Format) > 0 {
var err error