def _n(self, md, res): html = markdown.markdown(md, extensions=[makeExtension(host=self.host)]) self.assertNotEqual(html, res)
def _skip(self, md): self.assertEqual( markdown.markdown(md), markdown.markdown(md, extensions=[makeExtension(host=self.host)]) )
md.inlinePatterns.add( "link_image_short_reference", LinkImageReferencePattern(SHORT_REF_RE, md), "<short_reference" ) def makeExtension(**kwargs): """Loads the extension.""" return LinkImageExtension(**kwargs) if __name__ == "__main__": import markdown from amazedown import link_icon_tab logging.basicConfig(level=logging.DEBUG) text = """ [![img_alt](img_small.jpg img_title)][0] [link](//external/) [link](//inner/) [0]:img_big.jpg """ # text = '[<img src="">](/some/link "try")' # text = '[text](http://link.com/t)' result = markdown.markdown(text, extensions=[makeExtension(), link_icon_tab.makeExtension(host="inner")]) print(result)