Mercurial > public > sg101
annotate tools/mdx_del.py @ 357:8e3f252e4fbb
Fixing #155; adding some links to the mp3 comps in the base template.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Fri, 04 Mar 2011 02:41:49 +0000 |
parents | f54bf3b3bece |
children | 2e90b63520b8 |
rev | line source |
---|---|
bgneal@356 | 1 """ |
bgneal@356 | 2 A python-markdown extension to add support for <del>. |
bgneal@356 | 3 The Markdown syntax is --this is deleted text--. |
bgneal@356 | 4 |
bgneal@356 | 5 """ |
bgneal@356 | 6 import markdown |
bgneal@356 | 7 |
bgneal@356 | 8 |
bgneal@356 | 9 DEL_RE = r'(--)(.*?)--' |
bgneal@356 | 10 |
bgneal@356 | 11 class DelExtension(markdown.Extension): |
bgneal@356 | 12 |
bgneal@356 | 13 def extendMarkdown(self, md, md_globals): |
bgneal@356 | 14 del_tag = markdown.inlinepatterns.SimpleTagPattern(DEL_RE, 'del') |
bgneal@356 | 15 md.inlinePatterns.add('del', del_tag, '>not_strong') |
bgneal@356 | 16 |
bgneal@356 | 17 |
bgneal@356 | 18 def makeExtension(configs=None): |
bgneal@356 | 19 return DelExtension(configs) |