Skip to content

Commit

Permalink
ZO-4627: Fix omission in 7cc4d95, node.text can be None (while str(no…
Browse files Browse the repository at this point in the history
…de) in objectify couldn't)
  • Loading branch information
wosc committed Feb 27, 2024
1 parent 12c3083 commit 6bba217
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions core/docs/changelog/structure.fix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Handle empty lines etc correctly, e.g. in markdown fields
2 changes: 1 addition & 1 deletion core/src/zeit/cms/content/property.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def __get__(self, instance, class_):
if node is None:
return self.field.missing_value if self.field else None
node = lxml.etree.fromstring(str(self.remove_namespaces(node)))
result = [xml.sax.saxutils.escape(node.text)]
result = [xml.sax.saxutils.escape(node.text or '')]
for child in node.iterchildren():
result.append(lxml.etree.tostring(child, encoding=str))
return ''.join(result)
Expand Down

0 comments on commit 6bba217

Please sign in to comment.