[FIX] mail: consider empty "section" nodes to be empty html
Currently an empty section is not considered empty text. As the web editor sometimes uses them, it is relevant to consider them when asking whether some html will appear empty. Currently, even completely removing the website description of an exhibitor in website_event_exhibitor from the backend does not make the 'missing description' tooltip appear in the front-end task-3607615 closes odoo/odoo#154097 X-original-commit: 7dc376d4d2d2b4000de0da7573c30e4508f32318 Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com> Signed-off-by: Renaud Thiry (reth) <reth@odoo.com>
This commit is contained in:
+1
-1
@@ -315,7 +315,7 @@ def is_html_empty(html_content):
|
||||
"""
|
||||
if not html_content:
|
||||
return True
|
||||
tag_re = re.compile(r'\<\s*\/?(?:p|div|span|br|b|i|font)(?:(?=\s+\w*)[^/>]*|\s*)/?\s*\>')
|
||||
tag_re = re.compile(r'\<\s*\/?(?:p|div|section|span|br|b|i|font)(?:(?=\s+\w*)[^/>]*|\s*)/?\s*\>')
|
||||
return not bool(re.sub(tag_re, '', html_content).strip())
|
||||
|
||||
def html_keep_url(text):
|
||||
|
||||
Reference in New Issue
Block a user