test `MetaData` with `Wikilinks` Extension.
(self)
| 217 | ) |
| 218 | |
| 219 | def testWikilinksMetaData(self): |
| 220 | """ test `MetaData` with `Wikilinks` Extension. """ |
| 221 | |
| 222 | text = """wiki_base_url: http://example.com/ |
| 223 | wiki_end_url: .html |
| 224 | wiki_html_class: |
| 225 | |
| 226 | Some text with a [[WikiLink]].""" |
| 227 | md = markdown.Markdown(extensions=['meta', 'wikilinks']) |
| 228 | self.assertEqual( |
| 229 | md.convert(text), |
| 230 | '<p>Some text with a ' |
| 231 | '<a href="http://example.com/WikiLink.html">WikiLink</a>.</p>' |
| 232 | ) |
| 233 | |
| 234 | # `MetaData` should not carry over to next document: |
| 235 | self.assertEqual( |
| 236 | md.convert("No [[MetaData]] here."), |
| 237 | '<p>No <a class="wikilink" href="/MetaData/">MetaData</a> ' |
| 238 | 'here.</p>' |
| 239 | ) |
| 240 | |
| 241 | def testURLCallback(self): |
| 242 | """ Test used of a custom URL builder. """ |