For simple list items, don't wrap in <p> tags

This also removes extra newlines for simple list items, see changes to
tests for details.

Closes #57
This commit is contained in:
Ori 2021-06-22 16:57:09 -04:00 committed by Niklas Fasching
parent 429602aba7
commit 4d3a099922
9 changed files with 146 additions and 319 deletions

View file

@ -18,20 +18,12 @@ Title <sup class="footnote-reference"><a id="footnote-reference-1" href="#footno
<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>
</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>
</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>
</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>
</li>
<li>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>).</li>
<li>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</li>
<li>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.</li>
<li>We can thus end up with a footnote being in the mapping but not the slice - and get an index out of range error.</li>
</ul>
</div>
</div>