Children in a Document or Paragraph element inherit their parent's color styles

This commit is contained in:
Christian Muehlhaeuser
2019-12-02 15:23:45 +01:00
parent bbd7dfecce
commit d0b616b12b
4 changed files with 10 additions and 5 deletions
+2
View File
@@ -12,6 +12,7 @@ type DocumentElement struct {
func (e *DocumentElement) Render(w io.Writer, node *bf.Node, tr *TermRenderer) error {
rules := tr.style[Document]
if rules != nil {
tr.blockStyle.Push(rules)
if rules.Prefix != "" {
renderText(w, rules, rules.Prefix)
}
@@ -38,6 +39,7 @@ func (e *DocumentElement) Finish(w io.Writer, node *bf.Node, tr *TermRenderer) e
return err
}
tr.document.Reset()
tr.blockStyle.Pop()
if suffix != "" {
renderText(iw, rules, suffix)