trimHtml icon indicating copy to clipboard operation
trimHtml copied to clipboard

Newlines are not preserved

Open dmfrancisco opened this issue 10 years ago • 1 comments

First of all, thank you for creating this package :+1:

The current implementation removes newlines from the output, which can produce an incorrect result. Is this the intended behavior? Here's a simple example where whitespace is important:

trimHtml(`
<pre>
  foo
  bar
</pre>
`);
// Output will be: "<pre>  foo  bar</pre>"
// Instead of: "<pre>\n  foo\n  bar\n</pre>"

dmfrancisco avatar Mar 31 '15 12:03 dmfrancisco

Thanks for pointing that out. In some way it's intended behavior in order to produce cleaner output, will fix it.

brankosekulic avatar Mar 31 '15 21:03 brankosekulic