Test used of a custom URL builder.
(self)
| 239 | ) |
| 240 | |
| 241 | def testURLCallback(self): |
| 242 | """ Test used of a custom URL builder. """ |
| 243 | |
| 244 | from markdown.extensions.wikilinks import WikiLinkExtension |
| 245 | |
| 246 | def my_url_builder(label, base, end): |
| 247 | return '/bar/' |
| 248 | |
| 249 | md = markdown.Markdown(extensions=[WikiLinkExtension(build_url=my_url_builder)]) |
| 250 | self.assertEqual( |
| 251 | md.convert('[[foo]]'), |
| 252 | '<p><a class="wikilink" href="/bar/">foo</a></p>' |
| 253 | ) |
| 254 | |
| 255 | |
| 256 | class TestAdmonition(unittest.TestCase): |
nothing calls this directly
no test coverage detected