diff options
-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): |