Changeset - 563708f2275d
[Not reviewed]
default
0 2 0
Mads Kiilerich - 6 years ago 2019-11-29 11:47:32
mads@kiilerich.com
Grafted from: 3ce63212133f
tests: add some doctests for urlify and markup
2 files changed with 6 insertions and 0 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/helpers.py
Show inline comments
 
@@ -1062,6 +1062,8 @@ def urlify_text(s, repo_name=None, link_
 
    URLs links to what they say.
 
    Issues are linked to given issue-server.
 
    If link_ is provided, all text not already linking somewhere will link there.
 
    >>> urlify_text("Urlify http://example.com/ and 'https://example.com' *and* <b>markup/b>")
 
    literal('Urlify <a href="http://example.com/">http://example.com/</a> and &#39;<a href="https://example.com&apos">https://example.com&apos</a>; <b>*and*</b> &lt;b&gt;markup/b&gt;')
 
    """
 

	
 
    def _replace(match_obj):
kallithea/lib/markup_renderer.py
Show inline comments
 
@@ -150,6 +150,10 @@ class MarkupRenderer(object):
 

	
 
    @classmethod
 
    def plain(cls, source, universal_newline=True):
 
        """
 
        >>> MarkupRenderer.plain('https://example.com/')
 
        '<br /><a href="https://example.com/">https://example.com/</a>'
 
        """
 
        source = safe_str(source)
 
        if universal_newline:
 
            newline = '\n'
0 comments (0 inline, 0 general)