From ddbf2a32bb8d2de79b1b12478e1a66b8ff3893eb Mon Sep 17 00:00:00 2001 From: Waylan Limberg Date: Mon, 13 Oct 2008 13:25:50 -0400 Subject: Updated CodeHilite extension to work with recent refactor. Feels a little hacky though. --- markdown_extensions/codehilite.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'markdown_extensions') diff --git a/markdown_extensions/codehilite.py b/markdown_extensions/codehilite.py index 7f4a1a8..b3c8d52 100644 --- a/markdown_extensions/codehilite.py +++ b/markdown_extensions/codehilite.py @@ -193,7 +193,7 @@ class CodeHiliteExtention(markdown.Extension): def extendMarkdown(self, md, md_globals): - def _hiliteCodeBlock(parent_elem, lines, inList): + def __hiliteCodeBlock(parent_elem, lines, inList): """ Overrides `_processCodeBlock` method in standard Markdown class and sends code blocks to a code highlighting proccessor. The result @@ -208,7 +208,7 @@ class CodeHiliteExtention(markdown.Extension): """ - detabbed, theRest = md.detectTabbed(lines) + detabbed, theRest = md.parser.detectTabbed(lines) text = "\n".join(detabbed).rstrip()+"\n" code = CodeHilite(text, linenos=self.config['force_linenos'][0], css_class=self.config['css_class'][0]) @@ -216,9 +216,9 @@ class CodeHiliteExtention(markdown.Extension): # This wrapping p element will be removed when inserting raw html p = markdown.etree.SubElement(parent_elem, 'p') p.text = placeholder - md._processSection(parent_elem, theRest, inList) + md.parser.parseChunk(parent_elem, theRest, inList) - md._processCodeBlock = _hiliteCodeBlock + md.parser._MarkdownParser__processCodeBlock = __hiliteCodeBlock def makeExtension(configs={}): return CodeHiliteExtention(configs=configs) -- cgit v1.2.3