From: Jan E. M. <li...@mo...> - 2014-10-17 15:39:37
|
I'm trying to make a few additions to the markdown syntax to be able to do a few things I like to do but I'm completely confused of how to get it to work. An example: I want to be able to use an image tag like @ and get something like <figure><img src="http://stuff.com/imgcode/blabla.jpg" alt="Hello"><figcaption>Hello</figcaption></figure> >From what I understand this should be handled as an inlinepattern and if I look in the source it's basically the ImagePattern that I need to copy and make a few changes to. So I did that and made a few cosmetic changes to test that I got things working ... but I have no idea how to actually get Markdown to recognise my code. I looked at a few extensions, read the docs but I still don't get how I can use it. What I've done is simply to copy the image pattern and the ImagePattern class and changed the pattern to MYIMAGE_LINK_RE = r'@\!' + BRK + r'\s*\((<.*?>|([^")]+"[^"]*"|[^\)]*))\)' and ImagePattern to output "srct" instead of "src". But how do I get it to work? |