Render prefix/suffix in current style

This commit is contained in:
Christian Muehlhaeuser
2019-12-02 15:20:55 +01:00
parent e43288b69c
commit 011c602e64
+2 -2
View File
@@ -60,11 +60,11 @@ func renderText(w io.Writer, rules *ElementStyle, s string) {
func (e *BaseElement) Render(w io.Writer, node *bf.Node, tr *TermRenderer) error {
if e.Prefix != "" {
_, _ = w.Write([]byte(e.Prefix))
renderText(w, tr.blockStyle.Current(), e.Prefix)
}
defer func() {
if e.Suffix != "" {
_, _ = w.Write([]byte(e.Suffix))
renderText(w, tr.blockStyle.Current(), e.Suffix)
}
}()