Avoid spaces between tags in Jade template output when printing

I need to print the input and label tag without any space between the end of one tag and the beginning of the next ... but I also want to beautifully print the rest of the document.

By default - with pretty typing included in Jade - I get the following:

 <input ...></input> <label ...></label> 

I want:

 <input ...><label ...></label> 

or

 <input ...></input><label ...></label> 

Jade's idea - line break control in HTML output does not work, because input is a self-closing tag.

Update 1: I created an obvious solution using mixin and an HTML literal, but I would like to avoid this if possible.

+7
javascript pretty-print pug express
source share
1 answer

In Razor, I turned to this, wrapping a space with a multi-line comment:

  <div> <span>No trailing</span><!-- --><span>space</span> </div> 
+1
source share

All Articles