Fix bug in cloneNode in lxml builder for html5lib parsing

This commit is contained in:
Kovid Goyal 2013-11-25 14:01:49 +05:30
parent 3ab2f07a7d
commit 01f313af1f

View File

@ -83,7 +83,10 @@ class Element(ElementBase):
removeChild = ElementBase.remove
def cloneNode(self):
return self.makeelement(self.tag, nsmap=self.nsmap, attrib=self.attrib)
ans = self.makeelement(self.tag, nsmap=self.nsmap, attrib=self.attrib)
for x in ('name', 'namespace', 'nameTuple'):
setattr(ans, x, getattr(self, x))
return ans
def insertBefore(self, node, ref_node):
self.insert(self.index(ref_node), node)
@ -126,7 +129,6 @@ class Element(ElementBase):
for child in self:
new_parent.append(child)
class Comment(CommentBase):
@dynamic_property