diff --git a/webapp/web/templates/freemarker/lib/lib-list.ftl b/webapp/web/templates/freemarker/lib/lib-list.ftl
index dc61b170d..6570164a1 100644
--- a/webapp/web/templates/freemarker/lib/lib-list.ftl
+++ b/webapp/web/templates/freemarker/lib/lib-list.ftl
@@ -13,11 +13,19 @@
elements. An element may span multiple lines.
Usage:
- <@firstLastList />
+ <@firstLastList>
apples
bananas
oranges
- @firstLastList />
+ @firstLastList>
+
+ <@firstLastList>
+ <#list animals as animal>
+ <#if animal != "cow">
+ ${animal}
+ #if>
+ #list>
+ @firstLastList>
RY Consider rewriting in Java. Probably designers won't want to modify this. That would allow us to support
nested elements.
@@ -27,9 +35,8 @@
<#assign text>
<#nested>
#assign>
-
- <@processListItems text?matches(".*?", "s") />
+ <@processListItems text?matches(".*?", "s") />
#macro>
<#---------------------------------------------------------------------------->
@@ -49,19 +56,27 @@
indicate how to split the text.
Usage:
- <@firstLastListNested />
+ <@firstLastListNested>
apples,
bananas,
oranges
- @firstLastListNested />
+ @firstLastListNested>
- <@firstLastListNested delim="??" />
+ <@firstLastListNested>
+ <#list animals as animal>
+ <#if animal != "cow">
+ ${animal},
+ #if>
+ #list>
+ @firstLastListNested>
+
+ <@firstLastListNested delim="??">
apples, oranges??
bananas, lemons??
grapefruit, limes
- @firstLastListNested />
+ @firstLastListNested>
- <@firstLastListNested delim="??" />
+ <@firstLastListNested delim="??">
Books
- Persuasion
@@ -74,7 +89,7 @@
- Time
- @firstLastListNested />
+ @firstLastListNested>
RY Consider rewriting in Java. Probably designers won't want to modify this.
-->
@@ -104,6 +119,7 @@
-->
<#macro processListItems items>
<#list items as item>
+
<#-- A FreeMarker loop variable cannot have its value modified, so we use a new variable. -->
<#assign newItem = item?trim>
@@ -112,6 +128,7 @@
<#-- Keep any class value already assigned -->
<#assign currentClass = newItem?matches("^]*(class=[\'\"](.*?)[\'\"])")>
<#list currentClass as m>
+ ${m?groups[2]}
<#assign classVal = m?groups[2]>
<#assign newItem = newItem?replace(m?groups[1], "")>
#list>