Simplify code

This commit is contained in:
Christian Muehlhaeuser
2019-12-04 05:38:54 +01:00
parent 92e1c2dde8
commit afd83210ea
4 changed files with 14 additions and 28 deletions
+2 -4
View File
@@ -22,7 +22,7 @@ func (e *ParagraphElement) Render(w io.Writer, node *bf.Node, tr *TermRenderer)
_, _ = w.Write([]byte("\n"))
}
if rules != nil && rules.Prefix != "" {
if rules != nil {
renderText(w, tr.blockStyle.Current(), rules.Prefix)
}
return nil
@@ -40,9 +40,7 @@ func (e *ParagraphElement) Finish(w io.Writer, node *bf.Node, tr *TermRenderer)
indent = 0
}
}
if suffix != "" {
renderText(tr.paragraph, rules, suffix)
}
renderText(tr.paragraph, rules, suffix)
pw := &PaddingWriter{
Padding: uint(tr.WordWrap + int(indent) - int(tr.blockStyle.Indent())),