diff options
Diffstat (limited to 'markdown_extensions')
-rw-r--r-- | markdown_extensions/codehilite.py | 6 | ||||
-rw-r--r-- | markdown_extensions/footnotes.py | 10 | ||||
-rw-r--r-- | markdown_extensions/rss.py | 10 | ||||
-rw-r--r-- | markdown_extensions/tables.py | 4 | ||||
-rw-r--r-- | markdown_extensions/toc.py | 6 |
5 files changed, 18 insertions, 18 deletions
diff --git a/markdown_extensions/codehilite.py b/markdown_extensions/codehilite.py index 9371e79..bc75da2 100644 --- a/markdown_extensions/codehilite.py +++ b/markdown_extensions/codehilite.py @@ -175,7 +175,7 @@ class CodeHilite: # ------------------ The Markdown Extension ------------------------------- -class HilitePostprocessor(markdown.Postprocessor): +class HiliteTreeprocessor(markdown.Treeprocessor): """ Hilight source code in code blocks. """ def run(self, root): @@ -214,9 +214,9 @@ class CodeHiliteExtension(markdown.Extension): def extendMarkdown(self, md, md_globals): """ Add HilitePostprocessor to Markdown instance. """ - hiliter = HilitePostprocessor(md) + hiliter = HiliteTreeprocessor(md) hiliter.config = self.config - md.postprocessors.add("hilite", hiliter, "_begin") + md.treeprocessors.add("hilite", hiliter, "_begin") def makeExtension(configs={}): diff --git a/markdown_extensions/footnotes.py b/markdown_extensions/footnotes.py index 39379f3..2b5795d 100644 --- a/markdown_extensions/footnotes.py +++ b/markdown_extensions/footnotes.py @@ -60,11 +60,11 @@ class FootnoteExtension (markdown.Extension): md.inlinePatterns.add("footnote", FootnotePattern(FOOTNOTE_RE, self), "<reference") - # Insert a post-processor that would actually add the footnote div - md.postprocessors.add("footnote", FootnotePostprocessor(self), + # Insert a tree-processor that would actually add the footnote div + md.treeprocessors.add("footnote", FootnoteTreeprocessor(self), "_end") - md.textPostprocessors.add("footnote", FootnoteTextPostprocessor(self), + md.postprocessors.add("footnote", FootnotePostprocessor(self), ">amp_substitute") def reset(self) : @@ -216,7 +216,7 @@ class FootnotePattern (markdown.Pattern) : a.text = str(num) return sup -class FootnotePostprocessor (markdown.Postprocessor): +class FootnoteTreeprocessor (markdown.Treeprocessor): def __init__ (self, footnotes) : self.footnotes = footnotes @@ -239,7 +239,7 @@ class FootnotePostprocessor (markdown.Postprocessor): else : root.append(footnotesDiv) -class FootnoteTextPostprocessor (markdown.Postprocessor): +class FootnotePostprocessor (markdown.Postprocessor): def run(self, text) : return text.replace(FN_BACKLINK_TEXT, "↩") diff --git a/markdown_extensions/rss.py b/markdown_extensions/rss.py index b88b9b5..fa05fef 100644 --- a/markdown_extensions/rss.py +++ b/markdown_extensions/rss.py @@ -51,14 +51,14 @@ class RssExtension (markdown.Extension): md.xml_mode = True - # Insert a post-processor that would actually add the title tag - postprocessor = RssPostProcessor(self) - postprocessor.ext = self - md.postprocessors.append(postprocessor) + # Insert a tree-processor that would actually add the title tag + treeprocessor = RssTreeProcessor(self) + treeprocessor.ext = self + md.treeprocessors.append(treeprocessor) md.stripTopLevelTags = 0 md.docType = '<?xml version="1.0" encoding="utf-8"?>\n' -class RssPostProcessor (markdown.Postprocessor): +class RssTreeProcessor (markdown.Treeprocessor): def __init__(self, md): diff --git a/markdown_extensions/tables.py b/markdown_extensions/tables.py index c485f55..5339ae1 100644 --- a/markdown_extensions/tables.py +++ b/markdown_extensions/tables.py @@ -38,7 +38,7 @@ class TablePattern(markdown.Pattern) : return tr -class TablePostprocessor: +class TableTreeprocessor(markdown.Treeprocessor): def _findElement(self, element, name): result = [] @@ -62,7 +62,7 @@ class TablePostprocessor: class TableExtension(markdown.Extension): def extendMarkdown(self, md, md_globals): md.inlinePatterns.add('table', TablePattern(md), "<backtick") - md.postprocessors['table'] = TablePostprocessor() + md.treeprocessors['table'] = TableTreeprocessor() def makeExtension(configs): diff --git a/markdown_extensions/toc.py b/markdown_extensions/toc.py index ccc927c..00cf537 100644 --- a/markdown_extensions/toc.py +++ b/markdown_extensions/toc.py @@ -12,7 +12,7 @@ import markdown from markdown import etree import re -class TocPostprocessor (markdown.Postprocessor): +class TocTreeprocessor (markdown.Treeprocessor): # Iterator wrapper to get parent and child all at once def iterparent(self, root): for parent in root.getiterator(): @@ -119,9 +119,9 @@ class TocExtension (markdown.Extension): return re.sub('[-\s]+','-',value) def extendMarkdown(self, md, md_globals) : - tocext = TocPostprocessor(md) + tocext = TocTreeprocessor(md) tocext.config = self.config - md.postprocessors.add("toc", tocext, "_begin") + md.treeprocessors.add("toc", tocext, "_begin") def makeExtension(configs={}) : return TocExtension(configs=configs) |