publicclass / express-partials

Express 3.x Layout & Partial support.
182 stars 146 forks source link

Excessive Whitespace #14

Closed netpoetica closed 12 years ago

netpoetica commented 12 years ago

It appears the EJS engine is outputting a bunch of extra whitespace inside of a tag. It's very weird:

<span class="editable"><% if(power){ %><%= power %><% } else{ %>(Power)<%  } %></span>

Outputs fine, but if you do it like this:

<span class="editable">
    <% if(power){ %>
        <%= power %>
     <% } else{ %>
          (Power)
      <%  } %>
</span>

Inside of the html span, I get something that looks like

<span class='editable'>"                                    
                        (Power)    

"</span>
netpoetica commented 12 years ago

Notice also the random quotation marks thrown in? Maybe this is a problem with EJS in general and not express-partials, but I've only used it with express-partials

slaskis commented 12 years ago

Random quotes seems like a bug to me if it does that. Is this something EJS does @visionmedia?

But the whitespace is normal, EJS is (or at least was, last I used it) a rather simple implementation that simply buffers everything in between %> and <%. But by adding a dash before the closing ejs tag will consume the newlines, ex: <% if(power){ -%>

Either way it's not something express-partials does so I'll close this.