diff options
author | Waylan Limberg <waylan@gmail.com> | 2008-10-13 22:47:32 -0400 |
---|---|---|
committer | Waylan Limberg <waylan@gmail.com> | 2008-10-13 22:47:32 -0400 |
commit | 430126aa943223f2c3d36fcde77a3a39d6088b4c (patch) | |
tree | 231cf9c897597ef4bfff417790977e912a930482 | |
parent | 1a4a66feea2faf8fe12138b25a96d516ee8aed4e (diff) | |
download | markdown-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.py | 18 |
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 = """ <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): |