Ondra Žižka created FREEMARKER-23:
-------------------------------------
Summary: <#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}
BTW, the .23 and .24 are marked as unreleased here in jira.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)