Hi,
What are people doing to avoid unintentionally introducing whitespace between tags in EEx? For example, I can do:
<span>A sentence starts,</span>
<%= "and then we introduce some dynamic content" %>
<span>. But then we're left with unintentional whitespace before the period.</span>
Can put everything all on one line, but that can get pretty messy with long sequences.
Can generate the markup in a view helper, but that’s kinda cumbersome
EEx has an option to trim around quotation tags, but I’m not sure how to set it globally in a phoenix project, not to mention the potential unforseen consequences of doing that.
Well the whitespace there is entirely expected as you specifically put newlines around it. If you don’t want whitespace then just don’t put whitespace:
<span>A sentence starts,</span><%= "and then we introduce some dynamic content" %><span>. But then we're left with unintentional whitespace before the period.</span>
Which of course you can still put on multiple lines if you want (inside the escape):
<span>A sentence starts,</span><%=
"and then we introduce some dynamic content"
%><span>. But then we're left with unintentional whitespace before the period.</span>