Exemplo n.º 1
0
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)
Exemplo n.º 2
0
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)
Exemplo n.º 3
0
 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>")
Exemplo n.º 4
0
 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>"
     )
Exemplo n.º 5
0
 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>"
Exemplo n.º 6
0
 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>"
Exemplo n.º 7
0
 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>"
Exemplo n.º 8
0
 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>"