mirror of
https://github.com/rwinkhart/glamour-temp-MUTN.git
synced 2026-09-06 17:07:15 -04:00
Fix prefixing first paragraph with a newline, when there's no previous sibling node
This commit is contained in:
+4
-1
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user