# HG changeset patch # User Thierry Florac # Date 1537518785 -7200 # Node ID 3ba5d4160566dc248b7cc0e6d2f862c846f87bdf # Parent 5dad602b4ca9f604f7c0c27dd75502e294ae07b9 Updated 'br' TALES extension diff -r 5dad602b4ca9 -r 3ba5d4160566 src/pyams_utils/text.py --- a/src/pyams_utils/text.py Fri Sep 21 10:21:52 2018 +0200 +++ b/src/pyams_utils/text.py Fri Sep 21 10:33:05 2018 +0200 @@ -178,12 +178,9 @@ if not value: return '' br = '
'.format('class="{0}"'.format(css_class) if css_class else '') - if start_tag or end_tag: - elements = value.split(character) - if start_tag: - elements[0] = '<{0}>{1}'.format(start_tag, elements[0]) - if end_tag: - elements[-1] = '<{0}>{1}'.format(end_tag, elements[-1]) - return br.join(elements) - else: - return value.replace(character, br) + elements = value.split(character) + if start_tag: + elements[0] = '<{0}>{1}'.format(start_tag, elements[0]) + if end_tag: + elements[-1] = '<{0}>{1}'.format(end_tag, elements[-1]) + return br.join(elements)