freemarker-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Dekany (JIRA)" <>
Subject [jira] [Commented] (FREEMARKER-82) A new whitespace tag to indicate the baseline indentation for <@macro> and includes.
Date Sun, 29 Oct 2017 22:29:00 GMT


Daniel Dekany commented on FREEMARKER-82:

I think the dynamic indentation thing is possible to implement in FreeMarker 2 (but it's won't
be easy). Though devil is in the details, that is, I might realize something blocker if I
try to implement it. The plans for FreeMarker 3 (which I have referred to earlier as something
that doesn't work with plain {{Writer}}-s) address other issues as well, like line breaks
that you actually wanted lost (dangerous, as no whitespace at all VS a line break is very
often significant even in HTML), which FreeMarker 2 may won't be able to do (I'm still looking
into it though).

Another thing... please update the problem description. What you are asking for is dynamic
indentation. FreeMarker 2.3 (vs 2.2) has nothing to do with this, as FreeMarker has never
supported dynamic indentation.

> A new whitespace tag to indicate the baseline indentation for <@macro> and includes.
> ------------------------------------------------------------------------------------
>                 Key: FREEMARKER-82
>                 URL:
>             Project: Apache Freemarker
>          Issue Type: Wish
>          Components: engine
>            Reporter: Brent
> Sometimes, perhaps most of the times, it is useful to split up small pieces of my template
into macros or otherwise other templates to include.
> However, since V2.3, lines containing only FTL tags get trimmed. This is annoying because
I may want to include a macro or another template, with the current indentation of where I
call it.
> This brings me to my next point, as shown in [my answer on StackOverflow|],
it is possible to keep this indentation with <#nt>, but this only works for the first
line of the macro (see SO answer at the bottom).
> So I propose an easy way to say "use the current indentation of the line, as a base of
all the indentation for my macro or included template.
> Any indentation inside the included template, or the macro would be relative. If one
wished to break the relative indentation for a line inside their included template or macro,
another tag should be foreseen to indicate that.
> New tags:
> * To indicate an indentation base for templates/macros
> * To indicate that a line inside the included template/macro must not use the indentation
base (so you can put lines that don't follow the indentation, perhaps <#t> already provides
this functionality)

This message was sent by Atlassian JIRA

View raw message