aboutsummaryrefslogtreecommitdiffhomepage
path: root/markup
diff options
context:
space:
mode:
authorJoe Mooring <[email protected]>2023-11-07 19:47:15 -0800
committerBjørn Erik Pedersen <[email protected]>2023-11-16 18:21:32 +0100
commit805cc1773be96ccb29740c9a40b7cd10949caa63 (patch)
treeb29424a46783eb9d45e8a30fb65f3dae16813245 /markup
parent0bde6931ac8fb288565b6f951f6e10adf529d527 (diff)
downloadhugo-805cc1773be96ccb29740c9a40b7cd10949caa63.tar.gz
hugo-805cc1773be96ccb29740c9a40b7cd10949caa63.zip
markup/goldmark: Sync image render hook code with Goldmark
Fixes #11681
Diffstat (limited to 'markup')
-rw-r--r--markup/goldmark/render_hooks.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/markup/goldmark/render_hooks.go b/markup/goldmark/render_hooks.go
index 60a3a1efe..ecdd7f91e 100644
--- a/markup/goldmark/render_hooks.go
+++ b/markup/goldmark/render_hooks.go
@@ -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))
}