trim leading newline char on blocks for html
This commit is contained in:
parent
2d45490186
commit
0de50d60af
5 changed files with 34 additions and 1 deletions
|
@ -622,7 +622,8 @@ func (w *HTMLWriter) blockContent(name string, children []Node) string {
|
|||
WriteNodes(w, children...)
|
||||
out := w.String()
|
||||
w.Builder, w.htmlEscape = builder, htmlEscape
|
||||
return strings.TrimRightFunc(out, unicode.IsSpace)
|
||||
|
||||
return strings.TrimRightFunc(strings.TrimLeftFunc(out, IsNewLineChar), unicode.IsSpace)
|
||||
} else {
|
||||
return w.WriteNodesAsString(children...)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue