Abbreviation inline pattern.
| 75 | |
| 76 | |
| 77 | class AbbrPattern(markdown.inlinepatterns.Pattern): |
| 78 | """ Abbreviation inline pattern. """ |
| 79 | |
| 80 | def __init__(self, pattern, title): |
| 81 | markdown.inlinepatterns.Pattern.__init__(self, pattern) |
| 82 | self.title = title |
| 83 | |
| 84 | def handleMatch(self, m): |
| 85 | abbr = etree.Element('abbr') |
| 86 | abbr.text = m.group('abbr') |
| 87 | abbr.set('title', self.title) |
| 88 | return abbr |
| 89 | |
| 90 | def makeExtension(configs=None): |
| 91 | return AbbrExtension(configs=configs) |