So I have the following:
<
Whitespace emitted by JavaScript works like any other whitespace in your HTML file. That seems the expected behavior to me.