def _prettifyETree(self, elem):
        """ Recursively add linebreaks to ElementTree children. """

        i = "\n"
        if markdown.isBlockLevel(elem.tag) and elem.tag not in ['code', 'pre']:
            if (not elem.text or not elem.text.strip()) \
                    and len(elem) and markdown.isBlockLevel(elem[0].tag):
                elem.text = i
            for e in elem:
                if markdown.isBlockLevel(e.tag):
                    self._prettifyETree(e)
            if not elem.tail or not elem.tail.strip():
                elem.tail = i
        if not elem.tail or not elem.tail.strip():
            elem.tail = i
dataset/ETHPy150Open natestedman/Observatory/observatory/lib/markdown/treeprocessors.py/PrettifyTreeprocessor._prettifyETree/original