--- 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 = '<br {0} />'.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}</{0}>'.format(start_tag, elements[0])
- if end_tag:
- elements[-1] = '<{0}>{1}</{0}>'.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}</{0}>'.format(start_tag, elements[0])
+ if end_tag:
+ elements[-1] = '<{0}>{1}</{0}>'.format(end_tag, elements[-1])
+ return br.join(elements)