misc: do not consider a text with a single <hr> as empty (#78266) #364

Merged
fpeters merged 1 commits from wip/78266-hr-in-text into main 2023-06-12 14:39:35 +02:00
1 changed files with 1 additions and 1 deletions

View File

@ -2478,7 +2478,7 @@ class WysiwygTextWidget(TextWidget):
self.value = self.value[6:]
if self.value.endswith('<br />'):
self.value = self.value[:-6]
if not strip_tags(self.value).strip() and not '<img' in self.value:
if not strip_tags(self.value).strip() and not ('<img' in self.value or '<hr' in self.value):
self.value = ''
# unescape Django template tags