From: Michael Tremer Date: Fri, 27 Oct 2017 10:44:07 +0000 (+0100) Subject: Remove line break option from Text module X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8b91ad95d300020be2ab64a589feed06582b3683;p=pbs.git Remove line break option from Text module Signed-off-by: Michael Tremer --- diff --git a/src/templates/modules/log-entry-comment.html b/src/templates/modules/log-entry-comment.html index ff425c80..ca5a4a87 100644 --- a/src/templates/modules/log-entry-comment.html +++ b/src/templates/modules/log-entry-comment.html @@ -16,7 +16,7 @@ {% block message %} {% if entry.get_message(current_user) %} - {% module Text(entry.get_message(current_user), remove_linebreaks=False) %} + {% module Text(entry.get_message(current_user)) %} {% else %}

{{ _("No comment given.") }} diff --git a/src/web/ui_modules.py b/src/web/ui_modules.py index 1b4f0b16..8fd65adb 100644 --- a/src/web/ui_modules.py +++ b/src/web/ui_modules.py @@ -33,14 +33,11 @@ class TextModule(UIModule): paragraph = "".join(line_iteration) yield paragraph.replace("\n", " ") - def render(self, text, pre=False, remove_linebreaks=True): + def render(self, text, pre=False): # Handle empty messages if not text: return "" - if remove_linebreaks: - text = text.replace("\n", " ") - # Search for bug ids that need to be linked to bugzilla text = re.sub(self.BUGZILLA_PATTERN, self._bugzilla_repl, text, re.I|re.U)