Create BlockElement even if there's no style for it

This commit is contained in:
Christian Muehlhaeuser
2019-12-04 13:42:40 +01:00
parent 15d9fd129b
commit 512abfe4c0
+6 -5
View File
@@ -12,12 +12,13 @@ type DocumentElement struct {
func (e *DocumentElement) Render(w io.Writer, node *bf.Node, tr *TermRenderer) error {
rules := tr.style[Document]
be := BlockElement{
Block: &bytes.Buffer{},
Style: rules,
}
tr.blockStack.Push(be)
if rules != nil {
be := BlockElement{
Block: &bytes.Buffer{},
Style: rules,
}
tr.blockStack.Push(be)
renderText(tr.blockStack.Current().Block, rules, rules.Prefix)
}
return nil