Closed helb closed 6 years ago
Html2text seems to discard the whitespace formatting in <pre> tags:
<pre>
input:
<pre>test1 test 2 test 3</pre>
expected:
test1 test 2 test 3
actual result:
<pre> on MDN: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/pre ("Whitespace inside this element is displayed as written.")
Code taken from this patch by @Kleissner: https://github.com/jaytaylor/html2text/issues/6#issuecomment-329620709Q, with atom.Code removed (as <code> does not actually preserve whitespace in browsers).
atom.Code
<code>
Added a simple test case with newlines and multiple spaces.
Fixes #6, also fixes #22.
Beautiful, thanks @helb !
Html2text seems to discard the whitespace formatting in
<pre>
tags:input:
expected:
actual result:
<pre>
on MDN: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/pre ("Whitespace inside this element is displayed as written.")Code taken from this patch by @Kleissner: https://github.com/jaytaylor/html2text/issues/6#issuecomment-329620709Q, with
atom.Code
removed (as<code>
does not actually preserve whitespace in browsers).Added a simple test case with newlines and multiple spaces.
Fixes #6, also fixes #22.