diff options
author | Waylan Limberg <waylan@gmail.com> | 2012-01-20 06:39:18 -0500 |
---|---|---|
committer | Waylan Limberg <waylan@gmail.com> | 2012-01-20 06:39:18 -0500 |
commit | eaa3160095aa72424ccb57c1e59049f39091aa07 (patch) | |
tree | ace83e9f16f4bc7fa6726289da943abb3c7c64e1 | |
parent | 67cee51de286f73afdb622660d4e930fa41b84d9 (diff) | |
download | markdown-eaa3160095aa72424ccb57c1e59049f39091aa07.tar.gz markdown-eaa3160095aa72424ccb57c1e59049f39091aa07.tar.bz2 markdown-eaa3160095aa72424ccb57c1e59049f39091aa07.zip |
Fixed #73. Codehilite now works in footnotes.
The footnotes treeprocessor must be the first one run so that all others,
including codehilite's, can run on the contents of the footnote div which is
created and inserted by the footnotes treeprocessor.
Thanks to startling for the report.
-rw-r--r-- | markdown/extensions/codehilite.py | 2 | ||||
-rw-r--r-- | markdown/extensions/footnotes.py | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/markdown/extensions/codehilite.py b/markdown/extensions/codehilite.py index 6f0da44..5df820f 100644 --- a/markdown/extensions/codehilite.py +++ b/markdown/extensions/codehilite.py @@ -216,7 +216,7 @@ class CodeHiliteExtension(markdown.Extension): """ Add HilitePostprocessor to Markdown instance. """ hiliter = HiliteTreeprocessor(md) hiliter.config = self.getConfigs() - md.treeprocessors.add("hilite", hiliter, "_begin") + md.treeprocessors.add("hilite", hiliter, "<inline") md.registerExtension(self) diff --git a/markdown/extensions/footnotes.py b/markdown/extensions/footnotes.py index 2f3ceac..3d83807 100644 --- a/markdown/extensions/footnotes.py +++ b/markdown/extensions/footnotes.py @@ -69,10 +69,10 @@ class FootnoteExtension(markdown.Extension): md.inlinePatterns.add("footnote", FootnotePattern(FOOTNOTE_RE, self), "<reference") # Insert a tree-processor that would actually add the footnote div - # This must be before the inline treeprocessor so inline patterns - # run on the contents of the div. + # This must be before all other treeprocessors (i.e., inline and + # codehilite) so they can run on the the contents of the div. md.treeprocessors.add("footnote", FootnoteTreeprocessor(self), - "<inline") + "_begin") # Insert a postprocessor after amp_substitute oricessor md.postprocessors.add("footnote", FootnotePostprocessor(self), ">amp_substitute") |