Fix prefixing first paragraph with a newline, when there's no previous sibling node

This commit is contained in:
Christian Muehlhaeuser
2019-12-15 05:52:03 +01:00
parent a16d2a53b1
commit 27f86be69a
7 changed files with 7 additions and 7 deletions
+4 -1
View File
@@ -9,13 +9,16 @@ import (
)
type ParagraphElement struct {
First bool
}
func (e *ParagraphElement) Render(w io.Writer, ctx RenderContext) error {
bs := ctx.blockStack
rules := ctx.options.Styles.Paragraph
_, _ = w.Write([]byte("\n"))
if !e.First {
_, _ = w.Write([]byte("\n"))
}
be := BlockElement{
Block: &bytes.Buffer{},
Style: cascadeStyle(bs.Current().Style, rules, true),