handle_startendtag

[internal] handles xhtml like self closing tags when constructing DOM tree.

Arguments

Source


def handle_startendtag(self, tag, attrs):
    node = pyNode(tag.lower())
    if len(self._dom) != 0:
        node.set_parent(self._dom[-1])
        self._nodes.append(node)
    for attr in attrs:
        node.set_attr(attr[0], attr[1])