|
32 | 32 |
|
33 | 33 | from markdown.extensions import Extension
|
34 | 34 | from markdown.inlinepatterns import Pattern
|
35 |
| -from markdown.util import etree |
| 35 | +from xml.etree import ElementTree |
36 | 36 |
|
37 | 37 |
|
38 | 38 | URL_BASE = 'https://github.com'
|
|
43 | 43 |
|
44 | 44 |
|
45 | 45 | def _build_link(label, title, href, classes):
|
46 |
| - el = etree.Element('a') |
| 46 | + el = ElementTree.Element('a') |
47 | 47 | el.text = label
|
48 | 48 | el.set('title', title)
|
49 | 49 | el.set('href', href)
|
@@ -121,11 +121,11 @@ def __init__(self, *args, **kwargs):
|
121 | 121 | }
|
122 | 122 | super(GithubLinks, self).__init__(*args, **kwargs)
|
123 | 123 |
|
124 |
| - def extendMarkdown(self, md, md_globals): |
| 124 | + def extendMarkdown(self, md): |
125 | 125 | md.ESCAPED_CHARS.append('@')
|
126 |
| - md.inlinePatterns['issue'] = IssuePattern(self.getConfigs(), md) |
127 |
| - md.inlinePatterns['mention'] = MentionPattern(self.getConfigs(), md) |
128 |
| - md.inlinePatterns['commit'] = CommitPattern(self.getConfigs(), md) |
| 126 | + md.inlinePatterns.register(IssuePattern(self.getConfigs(), md), 'issue', 20) |
| 127 | + md.inlinePatterns.register(MentionPattern(self.getConfigs(), md), 'mention', 20) |
| 128 | + md.inlinePatterns.register(CommitPattern(self.getConfigs(), md), 'commit', 20) |
129 | 129 |
|
130 | 130 |
|
131 | 131 | def makeExtension(*args, **kwargs): # pragma: no cover
|
|
0 commit comments