def handle_starttag(self, tag, attrs):
        """Called at the start of every HTML tag."""

        # We only care about the opening tag for headings.
        if (["h%d" % x for x in range(1, 7)]) not in tag:
            return

        # We are dealing with a new header, create a new section
        # for it and assign the ID if it has one.
        self.is_header_tag = True
        self.section = ContentSection()
        self.data.append(self.section)

        for attr in attrs:
            if attr[0] == "id":
                self.section.id = attr[1]
dataset/ETHPy150Open mkdocs/mkdocs/mkdocs/search.py/ContentParser.handle_starttag/swapped operands of `not in`