Support list argument in "br" TALES extension
authorThierry Florac <tflorac@ulthar.net>
Thu, 05 Aug 2021 09:19:32 +0200
changeset 451 c54f05d00f63
parent 450 d19c9f8a4ac0
child 452 d85ea9792991
Support list argument in "br" TALES extension
src/pyams_utils/text.py
--- a/src/pyams_utils/text.py	Wed Nov 25 13:01:50 2020 +0100
+++ b/src/pyams_utils/text.py	Thu Aug 05 09:19:32 2021 +0200
@@ -251,7 +251,10 @@
         if not value:
             return ''
         br_tag = '<br {0} />'.format('class="{0}"'.format(css_class) if css_class else '')
-        elements = value.split(character)
+        if isinstance(value, str):
+            elements = value.split(character)
+        else:
+            elements = list(value)
         if start_tag:
             elements[0] = '<{0}>{1}</{0}>'.format(start_tag, elements[0])
         if end_tag: