Closed jakub-g closed 3 years ago
I would love to hear an answer to this question, too.
${' '}
seems to work: jsfiddle
html`<div>
<span>sp</span>
${' '}
<span>ace</span>
</div>`
Yep, the expression with a space character is the way to go here, since it's the same behavior as JSX.
I've been playing with
htm
, and I haveprettier
in my repo which formats code automatically.I'm struggling to output a space between two elements; sometimes I end up with prettier formatting code like this:
I want a single space between the two spans, but regular spaces get collapsed; and
is escaped and output literally as
.Is there a clean solution to this?