third_party/markdown/treeprocessors.py
def run(self, root):
        """ Add linebreaks to ElementTree root object. """

        self._prettifyETree(root)
        # Do <br />'s seperately as they are often in the middle of
        # inline content and missed by _prettifyETree.
        brs = root.iter('br')
        for br in brs:
            if not br.tail or not br.tail.strip():
                br.tail = '\n'
            else:
                br.tail = '\n%s' % br.tail
        # Clean up extra empty lines at end of code blocks.
        pres = root.iter('pre')
        for pre in pres:
            if len(pre) and pre[0].tag == 'code':
                pre[0].text = pre[0].text.rstrip() + '\n'
 Add linebreaks to ElementTree root object. 
Add linebreaks to ElementTree root object.
Add linebreaks to ElementTree root object .
def run(self, root):
        self._prettifyETree(root)
        brs = root.iter('br')
        for br in brs:
            if not br.tail or not br.tail.strip():
                br.tail = '\n'
            else:
                br.tail = '\n%s' % br.tail
        pres = root.iter('pre')
        for pre in pres:
            if len(pre) and pre[0].tag == 'code':
                pre[0].text = pre[0].text.rstrip() + '\n'
def run ( self , root ) : self . _prettifyETree ( root ) brs = root . iter ( 'br' ) for br in brs : if not br . tail or not br . tail . strip ( ) : br . tail = '\n' else : br . tail = '\n%s' % br . tail pres = root . iter ( 'pre' ) for pre in pres : if len ( pre ) and pre [ 0 ] . tag == 'code' : pre [ 0 ] . text = pre [ 0 ] . text . rstrip ( ) + '\n'
Add linebreaks to ElementTree root object.
Add linebreaks to ElementTree root object .
""" Add linebreaks to ElementTree root object. """ # Do <br />'s seperately as they are often in the middle of # inline content and missed by _prettifyETree. # Clean up extra empty lines at end of code blocks.
self
root