mirror of
https://github.com/yuin/goldmark
synced 2025-03-04 23:04:52 +00:00
Fix #416
This commit is contained in:
parent
68e53654f2
commit
6442ae1259
2 changed files with 12 additions and 0 deletions
|
|
@ -771,3 +771,12 @@ a <!-- b -->
|
|||
<p><img src=./.assets/logo.svg</p>
|
||||
<p>/></p>
|
||||
//= = = = = = = = = = = = = = = = = = = = = = = =//
|
||||
|
||||
61: Image alt with a new line
|
||||
//- - - - - - - - -//
|
||||

|
||||
//- - - - - - - - -//
|
||||
<p><img src="logo.png" alt="alt
|
||||
text" /></p>
|
||||
//= = = = = = = = = = = = = = = = = = = = = = = =//
|
||||
|
|
|
|||
|
|
@ -938,6 +938,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))
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue