aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaylan Limberg <waylan@gmail.com>2008-10-13 22:47:32 -0400
committerWaylan Limberg <waylan@gmail.com>2008-10-13 22:47:32 -0400
commit430126aa943223f2c3d36fcde77a3a39d6088b4c (patch)
tree231cf9c897597ef4bfff417790977e912a930482
parent1a4a66feea2faf8fe12138b25a96d516ee8aed4e (diff)
downloadmarkdown-430126aa943223f2c3d36fcde77a3a39d6088b4c.tar.gz
markdown-430126aa943223f2c3d36fcde77a3a39d6088b4c.tar.bz2
markdown-430126aa943223f2c3d36fcde77a3a39d6088b4c.zip
Updated ImageLinks extension to recent refactor (I think, there's no tests).
-rw-r--r--markdown_extensions/imagelinks.py18
1 files changed, 1 insertions, 17 deletions
diff --git a/markdown_extensions/imagelinks.py b/markdown_extensions/imagelinks.py
index e545b24..56d1cc6 100644
--- a/markdown_extensions/imagelinks.py
+++ b/markdown_extensions/imagelinks.py
@@ -29,25 +29,9 @@ ALBUM_LINK = """&nbsp;<a href="%s">[%s]</a>"""
class ImageLinksExtension (markdown.Extension):
- def __init__ (self) :
- self.reset()
-
def extendMarkdown(self, md, md_globals) :
- self.md = md
-
- # Stateless extensions do not need to be registered
- md.registerExtension(self)
-
- # Insert a preprocessor before all preprocessors
-
- preprocessor = ImageLinkPreprocessor()
- preprocessor.md = md
- md.preprocessors.insert(0, preprocessor)
-
- def reset(self) :
- # May be called by Markdown is state reset is desired
- pass
+ md.preprocessors.add("imagelink", ImageLinkPreprocessor(self), "_begin")
class ImageLinkPreprocessor (markdown.Preprocessor):