[
https://issues.apache.org/jira/browse/FREEMARKER-23?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15271913#comment-15271913
]
Daniel Dekany commented on FREEMARKER-23:
-----------------------------------------
So the actual behavior is that the position inside the line itself doesn't, but
if you are inside or outside a directive does. Whether it was the intent of the
code's author or not I don't know, but it can't be changed (in FM 2.x anyway,
and unless it's an option in 2.x) as that would change the output of existing
templates. So it's the documentation that will have to be fixed.
> <#t> documentation doesn't match actual behavior
> ------------------------------------------------
>
> Key: FREEMARKER-23
> URL: https://issues.apache.org/jira/browse/FREEMARKER-23
> Project: Apache Freemarker
> Issue Type: Bug
> Components: engine
> Affects Versions: 2.3.23
> Reporter: Ondra Žižka
>
> The docs says at http://freemarker.org/docs/ref_directive_t.html
> {quote}
> The placement of these directives inside the line has no importance. That is,
> the effect will be the same regardless if you put the directive at the
> beginning of the line, or at the end of the line, or in the middle of the
> line.
> {quote}
> However that's not true - this is treated differently:
> {code}
> <#if
> pom.coords.version??>${i1}<version>${pom.coords.version}</version>${"\n"}</#if><#t><#--
> Null if same as parent. -->
> <#if
> pom.coords.packaging??>${i1}<packaging>${pom.coords.packaging}</packaging>${"\n"}</#if><#t>
> {code}
> Result:
> {code}
> <version>1.0</version>
> <packaging>jar</packaging>
> {code}
> Alternative:
> {code}
> <#if
> pom.coords.version??>${i1}<version>${pom.coords.version}</version>${"\n"}<#t></#if><#--
> Null if same as parent. -->
> <#if
> pom.coords.packaging??>${i1}<packaging>${pom.coords.packaging}</packaging>${"\n"}<#t></#if>
> {code}
> Result:
> {code}
> <version>1.0</version>
> <packaging>jar</packaging>
> {code}
> So - is this a bug, or an error in the documentation?
> BTW, the .23 and .24 are marked as unreleased here in jira.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)