Пример #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)
Пример #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)
Пример #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>")
Пример #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>"
     )
Пример #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>"
Пример #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>"
Пример #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>"
Пример #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>"