header

[internal] returns header elements.

Source


def header(self):
    ret = pyNodeList()
    h = list()
    h.append(self._nodes.tag('h1'))
    h.append(self._nodes.tag('h2'))
    h.append(self._nodes.tag('h3'))
    h.append(self._nodes.tag('h4'))
    h.append(self._nodes.tag('h5'))
    h.append(self._nodes.tag('h6'))
    for elem in h:
        if isinstance(elem, pyNodeList) and len(elem) != 0:
            ret.extend(elem)
        elif isinstance(elem, pyNode):
            ret.append(elem)
    return ret