When using a contentEditable element, the browser (Firefox) inserts <br> tags when the Enter key is pressed. This results in HTML like the following:
<div><pre><code>First line<br>Second line<br>Third line</code></pre></div>
This is currently converted to
First lineSecond lineThird line
Expected is
First line
Second line
Third line
I've added the following test cases to the index.html test suite:
<div class="case" data-name="pre/code block with newline as <br> tag">
<div class="input"><div><pre><code>First line<br>Second line<br>Third line</code></pre></div></div>
<pre class="expected"> First line
Second line
Third line</pre>
</div>
<div class="case" data-name="fenced pre/code block with newline as <br> tag" data-options='{"codeBlockStyle": "fenced"}'>
<div class="input"><div><pre><code>First line<br>Second line<br>Third line</code></pre></div></div>
<pre class="expected">```
First line
Second line
Third line
```</pre>
</div>
The fix for my Perl port of turndown is at Corion/Text-HTML-Turndown@a28a2a9 , for comparison / inspiration
When using a
contentEditableelement, the browser (Firefox) inserts<br>tags when the Enter key is pressed. This results in HTML like the following:This is currently converted to
Expected is
I've added the following test cases to the
index.htmltest suite:The fix for my Perl port of turndown is at Corion/Text-HTML-Turndown@a28a2a9 , for comparison / inspiration