On Mon, 17 Apr 2017 08:40:49 -0400, Steven Schveighoffer wrote:

On 4/14/17 10:25 AM, Sönke Ludwig wrote:

Am 11.04.2017 um 01:32 schrieb Steven Schveighoffer:

I just did an "upgrade" to my dub repository, and all of my diet
template spacing is messed up. What happened? I have fixed most of it
(seems to be the space between the tag and the contained text is now not
part of the inner text, leading to many words running together)

In addition, I want to make this work, and I can't get it to work:

| (
a(href="somelink")>< click here
| )

No matter what I try, I can't get that closing parenthesis to hug the
anchor tag.

Before, this worked just fine (and with just the > directive on the
anchor). Is this a bug, or am I missing something?

This pretty sure is a but. I'll have a look. A possible workaround would
be to disable pretty printing by passing a custom traits struct to
render:

@dietTraits struct DT { enum htmlOutputStyle =

HTMLOutputStyle.compact; }

render!("template.dt", DT, ...);


Sorry to be pedantic, but just the second problem (unable to have no
space between anchor and parens) is a bug, or is the whole changing of
space handling a bug? I can't imagine anyone who has a lot of existing
diet code is going to like how the spacing has all been removed. In many
cases, I have to put trailing spaces at the end of text lines so the
words don't run together.

If it's a bug that will be fixed, I can revert to a previous vibe.d
rather than go through and make sure I have extra spaces everywhere.

-Steve

Sorry, I skipped the first paragraph. Just >< not working is a bug (fixed as #27 now). 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.

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.

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.