Logo Search packages:      
Sourcecode: calibre version File versions  Download package

def calibre::ebooks::markdown::markdown::Markdown::_processCodeBlock (   self,
  parent_elem,
  lines,
  inList 
) [private]

Given a list of document lines starting with a code block
   finds the end of the block, puts it into the dom verbatim
   wrapped in ("<pre><code>") and recursively processes the
   the remainder of the text file.

   @param parent_elem: DOM element to which the content will be added
   @param lines: a list of lines
   @param inList: a level
   @returns: None

Definition at line 1578 of file markdown.py.

01578                                                            :
        """Given a list of document lines starting with a code block
           finds the end of the block, puts it into the dom verbatim
           wrapped in ("<pre><code>") and recursively processes the
           the remainder of the text file.

           @param parent_elem: DOM element to which the content will be added
           @param lines: a list of lines
           @param inList: a level
           @returns: None"""

        detabbed, theRest = self.blockGuru.detectTabbed(lines)

        pre = self.doc.createElement('pre')
        code = self.doc.createElement('code')
        parent_elem.appendChild(pre)
        pre.appendChild(code)
        text = "\n".join(detabbed).rstrip()+"\n"
        #text = text.replace("&", "&amp;")
        code.appendChild(self.doc.createTextNode(text))
        self._processSection(parent_elem, theRest, inList)



    def _handleInline (self, line, patternIndex=0):


Generated by  Doxygen 1.6.0   Back to index