Not sure what toolchain you're using. I'm using the typescript compiler with Mithril and whitespace is preserved for this code:
<pre class="debug">{JSON.stringify(store, null, 4)}</pre> <pre class="debug">{JSON.stringify(store, null, 4)}</pre>It seems that the rules are, for any run of literal text:
- preserve runs of whitespace that don't contain newlines - drop initial and final whitespace if it contains a newline - collapse any internal runs of whitespace containing newlines to a single space.
(based on a quick experiment with tsc.)
<pre>
foo</pre>