Skip to content

Commit

Permalink
markup/goldmark: Sync image render hook code with Goldmark
Browse files Browse the repository at this point in the history
Fixes #11681
  • Loading branch information
jmooring authored and bep committed Nov 16, 2023
1 parent 0bde693 commit 805cc17
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions markup/goldmark/render_hooks.go
Expand Up @@ -484,6 +484,9 @@ func nodeToHTMLText(n ast.Node, source []byte) []byte {
buf.Write(s.Text(source))
} else if !c.HasChildren() {
buf.Write(util.EscapeHTML(c.Text(source)))
if t, ok := c.(*ast.Text); ok && t.SoftLineBreak() {
buf.WriteByte('\n')
}
} else {
buf.Write(nodeToHTMLText(c, source))
}
Expand Down

0 comments on commit 805cc17

Please sign in to comment.