~netlandish/django-wiki

93e38566fdfd902fa3d26636aff9a06e693aacab — Peter Sanchez 1 year, 7 months ago 7ad3e6a
Removing getchildren calls
M src/wiki/core/markdown/mdx/responsivetable.py => src/wiki/core/markdown/mdx/responsivetable.py +2 -2
@@ 28,10 28,10 @@ class ResponsiveTableTree(Treeprocessor):

    def move_children(self, element1, element2):
        """Moves children from element1 to element2"""
        for child in element1.getchildren():
        for child in list(element1):
            element2.append(child)
        # reversed is needed to safely remove items while iterating
        for child in reversed(element1.getchildren()):
        for child in reversed(list(element1)):
            element1.remove(child)

    def convert_to_wrapper(self, element):

M src/wiki/plugins/editsection/markdown_extensions.py => src/wiki/plugins/editsection/markdown_extensions.py +2 -2
@@ 39,7 39,7 @@ class EditSectionProcessor(Treeprocessor):
        sec_level = -1
        sec_start = -1

        for child in node.getchildren():
        for child in list(node):
            match = self.HEADER_RE.match(child.tag.lower())
            if not match:
                continue


@@ 86,7 86,7 @@ class EditSectionProcessor(Treeprocessor):
        cur_pos = [0] * self.level
        last_level = 0

        for child in node.getchildren():
        for child in list(node):
            match = self.HEADER_RE.match(child.tag.lower())
            if not match:
                continue