waylan/Python-Markdown — pull request #88 by mkomitee (2012-03-26 02:36:21+00:00)
Title: Support width and height image attributes

There are a few things about this extension that I'm not 100% certain I did right. It appears that in an extension, something that inherits from ``markdown.inlinepatterns.ImageReferencePattern``, ``self.markdown`` points at the extension, not the markdown instance, so things like ``self.markdown.references`` isn't available. I had to create a ``dict`` for references within the extension itself. That's only odd because in something that inherits from ``markdown.preprocessors.Preprocessor``, ``self.markdown`` does point at the markdown instance, so I had to directly address my extensions references ``dict`` as a class property.

Additionally while I was able to leverage ``self.sanitize_url`` in my reference pattern based class, the fact that self.markdown points to the extension meant when sanitize_url wanted to check ``self.markdown.safeMode``, it couldn't unless I added a safeMode property to my extension class.

If I went about this all wrong, please let me know. It's got some basic docs, and doctests which pass.