html: Remove cosmetic whitespace inside p tags

All tags are put on a line by themselves to help with visual
diffing. Apparently this extra cosmetic whitespace causes problems inside p
tags for ppl who want to use `white-space: pre`. Not much hurt for visual
diffing in removing cosmetic whitespace for just p tags and can't think of
anything that would break because of this right now. So let's do it and wait
for things to break.
This commit is contained in:
Niklas Fasching 2020-06-26 18:53:57 +02:00
parent 30dd2794cf
commit a383eef7a6
15 changed files with 216 additions and 577 deletions

View file

@ -411,11 +411,8 @@ func (w *HTMLWriter) WriteParagraph(p Paragraph) {
return
}
w.WriteString("<p>")
if _, ok := p.Children[0].(LineBreak); !ok {
w.WriteString("\n")
}
WriteNodes(w, p.Children...)
w.WriteString("\n</p>\n")
w.WriteString("</p>\n")
}
func (w *HTMLWriter) WriteExample(e Example) {