aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaylan Limberg <waylan@gmail.com>2010-12-12 18:31:44 -0500
committerWaylan Limberg <waylan@gmail.com>2010-12-12 18:31:44 -0500
commitcd057f5a838f034b6830d986a4e10975011f88da (patch)
tree0cb5fe20b85204e65b77ad66a26f43c73fe28c4d
parent25eeace738c873c6e3e30efde25e33b55bd97355 (diff)
parente06b6b2361ec8aecc8ce305b81d02918fa5d5843 (diff)
downloadmarkdown-cd057f5a838f034b6830d986a4e10975011f88da.tar.gz
markdown-cd057f5a838f034b6830d986a4e10975011f88da.tar.bz2
markdown-cd057f5a838f034b6830d986a4e10975011f88da.zip
Merge branch 'master' of https://github.com/davidchambers/Python-Markdown into davidchambers
-rw-r--r--markdown/__init__.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/markdown/__init__.py b/markdown/__init__.py
index 1375523..0774174 100644
--- a/markdown/__init__.py
+++ b/markdown/__init__.py
@@ -122,6 +122,7 @@ class Markdown:
self.inlinePatterns = build_inlinepatterns(self)
self.treeprocessors = build_treeprocessors(self)
self.postprocessors = build_postprocessors(self)
+ return self
def registerExtensions(self, extensions, configs):
"""
@@ -147,6 +148,8 @@ class Markdown:
'Extension "%s.%s" must be of type: "markdown.Extension".' \
% (ext.__class__.__module__, ext.__class__.__name__))
+ return self
+
def build_extension(self, ext_name, configs = []):
"""Build extension by name, then return the module.
@@ -191,6 +194,7 @@ class Markdown:
def registerExtension(self, extension):
""" This gets called by the extension """
self.registeredExtensions.append(extension)
+ return self
def reset(self):
"""
@@ -203,6 +207,8 @@ class Markdown:
if hasattr(extension, 'reset'):
extension.reset()
+ return self
+
def set_output_format(self, format):
""" Set the output format for the class instance. """
try:
@@ -211,6 +217,7 @@ class Markdown:
message(CRITICAL,
'Invalid Output Format: "%s". Use one of %s.' \
% (format, self.output_formats.keys()))
+ return self
def convert(self, source):
"""
@@ -326,6 +333,8 @@ class Markdown:
else:
output.write(html.encode(encoding))
+ return self
+
"""
EXPORTED FUNCTIONS