This commit is contained in:
Kovid Goyal 2020-04-02 07:48:50 +05:30
parent 4f106199d6
commit 6691efbab0
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -314,6 +314,8 @@ def unserialize_html(serialized_data, proceed, postprocess_dom, root_name):
if child.n is 'head': if child.n is 'head':
process_children(child, document.head) process_children(child, document.head)
elif child.n is 'body': elif child.n is 'body':
if not document.body:
document.documentElement.appendChild(document.createElement('body'))
if not body_done: if not body_done:
body_done = True body_done = True
apply_attributes(child, document.body, ns_map) apply_attributes(child, document.body, ns_map)