def wikilink_simple_url_formatter(text): """ A wikilink function that uses the simple URL formatter. :param str text: the text to format. """ return wikilink(text, simple_url_formatter)
def test_multiple_wikilinks(self): """ Assert a text with multiple wikilinks will be converted correctly. """ formatted = wikilink( u'[[target|Target]] is better than [[alternative]]', simple_url_formatter) assert formatted == ("<a href='/target'>Target</a> is better than" " <a href='/alternative'>alternative</a>")
def test_multiple_wikilinks(self): """ Assert a text with multiple wikilinks will be converted correctly. """ formatted = wikilink( u'[[target|Target]] is better than [[alternative]]', simple_url_formatter ) assert formatted == ( "<a href='/target'>Target</a> is better than" " <a href='/alternative'>alternative</a>" )
def test_titled_wikilink(self): """ Assert a wikilink with a title will be converted correctly. """ formatted = wikilink(u'[[target|Target]]', simple_url_formatter) assert formatted == "<a href='/target'>Target</a>"
def test_simple_wikilink(self): """ Assert a simple wikilink is converted correctly. """ formatted = wikilink(u'[[target]]', simple_url_formatter) assert formatted == "<a href='/target'>target</a>"