# HG changeset patch # User Mads Kiilerich # Date 1575024452 -3600 # Node ID 563708f2275d8baea231cef2e44e661b16779431 # Parent b6b6955981a55dc3737a5d5160316b0168426745 tests: add some doctests for urlify and markup diff -r b6b6955981a5 -r 563708f2275d kallithea/lib/helpers.py --- a/kallithea/lib/helpers.py Fri Feb 07 01:38:30 2020 +0100 +++ b/kallithea/lib/helpers.py Fri Nov 29 11:47:32 2019 +0100 @@ -1062,6 +1062,8 @@ 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* markup/b>") + literal('Urlify http://example.com/ and 'https://example.com&apos; *and* <b>markup/b>') """ def _replace(match_obj): diff -r b6b6955981a5 -r 563708f2275d kallithea/lib/markup_renderer.py --- a/kallithea/lib/markup_renderer.py Fri Feb 07 01:38:30 2020 +0100 +++ b/kallithea/lib/markup_renderer.py Fri Nov 29 11:47:32 2019 +0100 @@ -150,6 +150,10 @@ @classmethod def plain(cls, source, universal_newline=True): + """ + >>> MarkupRenderer.plain('https://example.com/') + '
https://example.com/' + """ source = safe_str(source) if universal_newline: newline = '\n'