Ignore Comment Nodes
This commit is contained in:
@@ -149,6 +149,8 @@ class Book:
|
||||
newelm.appendChild(newdom.createTextNode(text))
|
||||
elif elm.localName == "img":
|
||||
pass
|
||||
elif elm.nodeType == xml.dom.Node.COMMENT_NODE:
|
||||
pass
|
||||
elif elm.localName == "a":
|
||||
a_node = cast(xml.dom.minidom.Element, elm.firstChild)
|
||||
while a_node:
|
||||
@@ -191,5 +193,9 @@ class Book:
|
||||
while node:
|
||||
parse_node(section, cast(xml.dom.minidom.Element, node))
|
||||
node = node.nextSibling
|
||||
try:
|
||||
self.sections.append(section.toxml())
|
||||
except Exception as e:
|
||||
print(src, href)
|
||||
raise e
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user