[ 
https://issues.apache.org/jira/browse/FREEMARKER-82?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16223354#comment-16223354
 ] 

Brent commented on FREEMARKER-82:
---------------------------------

I don't know if two new tags would be completely necessary, perhaps a flag in a 
<@macro > or <#include> would suffice to enable each line in the macro/template 
to have the base whitespace + relative whitespace prepended? I'll definitely be 
watching this evolve! Maybe even attempt something myself in a fork :)

> A new whitespace tag to indicate the baseline indentation for <@macro> and 
> includes.
> ------------------------------------------------------------------------------------
>
>                 Key: FREEMARKER-82
>                 URL: https://issues.apache.org/jira/browse/FREEMARKER-82
>             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|https://stackoverflow.com/a/46973468/2686165], 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
(v6.4.14#64029)

Reply via email to