On 4/18/17 9:42 AM, Sönke Ludwig wrote:

Sorry, I skipped the first paragraph. Just >< not working is a bug (fixed as #27 now).

Thanks, that will be good.

The missing white space in general is a consequence of the new compact output mode, and partially due to a small "optimization", where a tag that contains just text is rendered as <foo>text</foo> instead of putting the text on its own line.

So here is a typical issue I had. My layout template shows the user
being logged in or not, and if so, what the username is. So that snippit
looks like this:

     - if("username" in req.params)
       | Logged in as
       span#username #{req.params["username"]}
       a(href='/logout') Logout
     - else
       | Not Logged in
       a(href='/login') Login

In order to make this "correct", I had to add trailing spaces to e.g.
"Logged in as", so it doesn't say "Logged in asschveiguyLogout"

The problem I see happening to many people is that they write their
templates without thinking about spacing. HTML is nice in that it just
concatenates all whitespace into one space. So you don't have to think
about spacing, because most of the time it works.

In the places where you WANT spacing to be compact, you can add those ><
things, and will get the correct result. And those cases aren't as
numerous as the former ones.

I see a lot of people having problems with the new spacing mode. It
might be good to allow for the old mode via a parameter to the render
function. I know you specified a way to do compact spacing earlier in
the thread, is there a way to specify the old mode?

Generally, the idea is that it must be possible for the compact output mode to generate output with no extraneous white space. Any white space except for newlines within text blocks ("." suffix) must be explicit.

I get it and agree. I think the issue is going to be existing code bases
which did not care about spacing.

At least, since inline tags are now supported, examples like the one above can be written more conveniently as | (#[a(href="someline") click here]), with the bonus of having the white space clearly defined.

This is great news, I didn't know about it! Will make my diet code much
easier to read and write. Is there documentation about this? Is it part
of the standard vibe.d template engine or do I need to use diet-ng?

-Steve