Skip to content

Commit

Permalink
Directories: Adjust string field rendering to prevent many newlines
Browse files Browse the repository at this point in the history
TYPE: Bugfix
LINK: ogc-1746
  • Loading branch information
Tschuppi81 authored Jul 26, 2024
1 parent 049160d commit 2463c19
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/onegov/org/layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,11 @@ def linkify(self, text: str | None) -> Markup | None:
# translate the text before applying linkify if it's a
# translation string
text = self.request.translate(text)
return linkify(text).replace('\n', Markup('<br>'))

linkified = linkify(text)
if isinstance(text, Markup):
return linkified
return linkified.replace('\n', Markup('<br>'))

def linkify_field(self, field: 'Field', rendered: Markup) -> Markup:
include = ('TextAreaField', 'StringField', 'EmailField', 'URLField')
Expand Down

0 comments on commit 2463c19

Please sign in to comment.