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

@ -13,32 +13,22 @@ Title <sup class="footnote-reference"><a id="footnote-reference-1" href="#footno
<div class="footnote-definition">
<sup id="footnote-1"><a href="#footnote-reference-1">1</a></sup>
<div class="footnote-body">
<p>
this test file just exists to reproduce a bug with footnotes in headlines - that only happens in very specific circumstances.
The TLDR is:
</p>
<p>this test file just exists to reproduce a bug with footnotes in headlines - that only happens in very specific circumstances.
The TLDR is:</p>
<ul>
<li>
<p>
HTMLWriter.footnotes should be a pointer field. I didn&#39;t notice my error as go translated my pointer-method calls on
non-pointer values rather than complaining - i.e. <code class="verbatim">footnotes.add()</code> transparently gets translated to <code class="verbatim">(&amp;footnotes).add()</code> (<a href="https://golang.org/ref/spec#Calls">docs</a>).
</p>
<p>HTMLWriter.footnotes should be a pointer field. I didn&#39;t notice my error as go translated my pointer-method calls on
non-pointer values rather than complaining - i.e. <code class="verbatim">footnotes.add()</code> transparently gets translated to <code class="verbatim">(&amp;footnotes).add()</code> (<a href="https://golang.org/ref/spec#Calls">docs</a>).</p>
</li>
<li>
<p>
Headlines have to be htmlified twice - once for the outline and once for the headline itself. To do so we have to copy the writer
</p>
<p>Headlines have to be htmlified twice - once for the outline and once for the headline itself. To do so we have to copy the writer</p>
</li>
<li>
<p>
Copying the writer copies footnotes - which contains a map and a slice. Changes to the map will always be reflected in the original map.
Changes to the slice will only be reflected if the slice doesn&#39;t grow.
</p>
<p>Copying the writer copies footnotes - which contains a map and a slice. Changes to the map will always be reflected in the original map.
Changes to the slice will only be reflected if the slice doesn&#39;t grow.</p>
</li>
<li>
<p>
We can thus end up with a footnote being in the mapping but not the slice - and get an index out of range error.
</p>
<p>We can thus end up with a footnote being in the mapping but not the slice - and get an index out of range error.</p>
</li>
</ul>
</div>