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

Method testWikilinksMetaData

tests/test_extensions.py:219–239  ·  view source on GitHub ↗

test `MetaData` with `Wikilinks` Extension.

(self)

Source from the content-addressed store, hash-verified

217 )
218
219 def testWikilinksMetaData(self):
220 """ test `MetaData` with `Wikilinks` Extension. """
221
222 text = """wiki_base_url: http://example.com/
223wiki_end_url: .html
224wiki_html_class:
225
226Some 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. """

Callers

nothing calls this directly

Calls 1

convertMethod · 0.95

Tested by

no test coverage detected