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
+4 -4
View File
@@ -26,8 +26,8 @@ func (e *ParagraphElement) Render(w io.Writer, ctx RenderContext) error {
}
bs.Push(be)
renderText(w, bs.Parent().Style.StylePrimitive, rules.BlockPrefix)
renderText(bs.Current().Block, bs.Current().Style.StylePrimitive, rules.Prefix)
renderText(w, ctx.colorProfile, bs.Parent().Style.StylePrimitive, rules.BlockPrefix)
renderText(bs.Current().Block, ctx.colorProfile, bs.Current().Style.StylePrimitive, rules.Prefix)
return nil
}
@@ -49,8 +49,8 @@ func (e *ParagraphElement) Finish(w io.Writer, ctx RenderContext) error {
_, _ = mw.Write([]byte("\n"))
}
renderText(w, bs.Current().Style.StylePrimitive, rules.Suffix)
renderText(w, bs.Parent().Style.StylePrimitive, rules.BlockSuffix)
renderText(w, ctx.colorProfile, bs.Current().Style.StylePrimitive, rules.Suffix)
renderText(w, ctx.colorProfile, bs.Parent().Style.StylePrimitive, rules.BlockSuffix)
bs.Current().Block.Reset()
bs.Pop()