MCPcopy Index your code
hub / github.com/Python-Markdown/markdown / testURLCallback

Method testURLCallback

tests/test_extensions.py:241–253  ·  view source on GitHub ↗

Test used of a custom URL builder.

(self)

Source from the content-addressed store, hash-verified

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
256class TestAdmonition(unittest.TestCase):

Callers

nothing calls this directly

Calls 2

convertMethod · 0.95
WikiLinkExtensionClass · 0.90

Tested by

no test coverage detected