NIHVIVO-1336 Fixed formatting on join directive
This commit is contained in:
parent
be95a1bdd8
commit
dd2cdb9991
1 changed files with 13 additions and 6 deletions
|
@ -4,11 +4,18 @@
|
||||||
|
|
||||||
<#-- Macro join: join array elements with the specified glue string. -->
|
<#-- Macro join: join array elements with the specified glue string. -->
|
||||||
|
|
||||||
<#macro join arr glue=", "><#compress>
|
<#macro join arr glue=", ">
|
||||||
<#assign count = 0>
|
<#assign count = 0>
|
||||||
<#-- This is VERY ugly: adding any formatting here inserts extra spaces into the output, even with the compress
|
<#-- Freemarker is very finicky about whitespace here. The compress directives and formatting
|
||||||
directive. The compress directive is also necessary, though. Seems counter to the documentation at
|
here work; do not alter them. -->
|
||||||
http://freemarker.org/docs/dgui_misc_whitespace.html -->
|
<#list arr as el>
|
||||||
<#list arr as el><#if el?has_content><#if (count > 0)>${glue}</#if>${el}<#assign count = count+1></#if></#list>
|
<#if el?has_content>
|
||||||
</#compress></#macro>
|
<#compress>
|
||||||
|
<#if (count > 0)>${glue}</#if>
|
||||||
|
${el}
|
||||||
|
</#compress>
|
||||||
|
<#assign count = count+1>
|
||||||
|
</#if>
|
||||||
|
</#list>
|
||||||
|
</#macro>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue