aboutsummaryrefslogtreecommitdiffstats
path: root/markdown/postprocessors.py
diff options
context:
space:
mode:
authorWaylan Limberg <waylan@gmail.com>2010-07-07 10:11:45 -0400
committerWaylan Limberg <waylan@gmail.com>2010-07-07 10:11:45 -0400
commita33a04439905851b5b1a5db4104ec3a11b4ab1d3 (patch)
tree3b52768f0b0d928a688c79adcd531059ec7bc005 /markdown/postprocessors.py
parent018aa73e82941288a1178ded751cf29d9bc13581 (diff)
downloadmarkdown-a33a04439905851b5b1a5db4104ec3a11b4ab1d3.tar.gz
markdown-a33a04439905851b5b1a5db4104ec3a11b4ab1d3.tar.bz2
markdown-a33a04439905851b5b1a5db4104ec3a11b4ab1d3.zip
Factored out the building of the various processors and patterns into utility functions called by a build_parser method on the Markdown class. Editing of the processors and patterns now all happen in one file for each type. Additionaly, a subclass of Markdown could potentially override the build_parser method and build a parser for a completely differant markup language without first building the default and then overriding it.
Diffstat (limited to 'markdown/postprocessors.py')
-rw-r--r--markdown/postprocessors.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/markdown/postprocessors.py b/markdown/postprocessors.py
index 41c34fc..4d93082 100644
--- a/markdown/postprocessors.py
+++ b/markdown/postprocessors.py
@@ -9,6 +9,15 @@ processing.
"""
import util
+import odict
+
+def build_postprocessors(md_instance, **kwargs):
+ """ Build the default postprocessors for Markdown. """
+ postprocessors = odict.OrderedDict()
+ postprocessors["raw_html"] = RawHtmlPostprocessor(md_instance)
+ postprocessors["amp_substitute"] = AndSubstitutePostprocessor()
+ return postprocessors
+
class Postprocessor(util.Processor):
"""