I find it difficult to delete a new line between elements in an instruction eachin a pug js template (formerly jade)
My code looks like this. I would like to have spaces between elements liwhen rendering HTML, so I'm trying to use comments between them.
mixin nav(links)
ul.nav
li(class=(section == link.key ? 'active' : null)): a(href=link.href)= link.label
|
Now it gives me this result:
<ul class="nav">
<li class="active"><a href="/">Home</a></li>
<li><a href="/foo">Foo</a></li>
<li><a href="/bar">Bar</a></li>
<li><a href="/yada">Yada</a></li>
</ul>
Is there a good way to tell a pug? I do not want spaces between these elements or is it a language restriction? I am using KeystoneJS, which in the development environment will tell the pug interpreter to prefix the HTML. I would like the product to be consistent throughout the development process to production (and not write a workaround in CSS that is negated by minimization in the production environment)