Esempio n. 1
0
 def extendMarkdown(self, md):
     """ Add FencedBlockPreprocessor to the Markdown instance. """
     md.registerExtension(self)
     processor = FencedBlockPreprocessor(md)
     processor.checked_for_codehilite = True
     processor.codehilite_conf = self.config
     md.preprocessors.register(processor, "fenced_code_block", 25)
Esempio n. 2
0
 def extendMarkdown(self, md):
     """ Add FencedBlockPreprocessor to the Markdown instance. """
     md.registerExtension(self)
     # Markdown 3.3 introduced a breaking change.
     if markdown.__version_info__ >= (3, 3):
         processor = FencedBlockPreprocessor(md, self.config)
         processor.codehilite_conf = self.getConfigs()
     else:
         processor = FencedBlockPreprocessor(md)
         processor.checked_for_codehilite = True
         processor.codehilite_conf = self.config
     md.preprocessors.register(processor, "fenced_code_block", 25)
Esempio n. 3
0
 def __init__(self, markdown_instance=None, **config):
     MooseMarkdownCommon.__init__(self, **config)
     FencedBlockPreprocessor.__init__(self, markdown_instance)
     self._remove = []
 def listing():
     listing_lines = match.group().split('\n')
     listing_lines[0] = first_line_for_listing_block(match)
     rendered = FencedBlockPreprocessor.run(self, listing_lines)
     return div_start() + rendered + ['</div>']