From dd2cdb9991eba3d95f84e8aa4dcb68957b51328a Mon Sep 17 00:00:00 2001 From: rjy7 Date: Thu, 16 Dec 2010 23:08:47 +0000 Subject: [PATCH] NIHVIVO-1336 Fixed formatting on join directive --- .../templates/freemarker/lib/lib-sequence.ftl | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/webapp/web/templates/freemarker/lib/lib-sequence.ftl b/webapp/web/templates/freemarker/lib/lib-sequence.ftl index 6a9552b9c..8a0902a67 100644 --- a/webapp/web/templates/freemarker/lib/lib-sequence.ftl +++ b/webapp/web/templates/freemarker/lib/lib-sequence.ftl @@ -4,11 +4,18 @@ <#-- Macro join: join array elements with the specified glue string. --> -<#macro join arr glue=", "><#compress> +<#macro join arr glue=", "> <#assign count = 0> - <#-- This is VERY ugly: adding any formatting here inserts extra spaces into the output, even with the compress - directive. The compress directive is also necessary, though. Seems counter to the documentation at - http://freemarker.org/docs/dgui_misc_whitespace.html --> - <#list arr as el><#if el?has_content><#if (count > 0)>${glue}${el}<#assign count = count+1> - + <#-- Freemarker is very finicky about whitespace here. The compress directives and formatting + here work; do not alter them. --> + <#list arr as el> + <#if el?has_content> + <#compress> + <#if (count > 0)>${glue} + ${el} + + <#assign count = count+1> + + +