Merge pull request #19286 from frappe/fix-has-content

This commit is contained in:
Shariq Ansari 2022-12-15 12:31:26 +05:30 committed by GitHub
commit 7129418fda
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -671,7 +671,11 @@ class BaseDocument:
value = cstr(self.get(df.fieldname))
has_text_content = strip_html(value).strip()
has_img_tag = "<img" in value
if df.fieldtype == "Text Editor" and (has_text_content or has_img_tag):
has_text_or_img_tag = has_text_content or has_img_tag
if df.fieldtype == "Text Editor" and has_text_or_img_tag:
return True
elif df.fieldtype == "Code" and df.options == "HTML" and has_text_or_img_tag:
return True
else:
return has_text_content