# HG changeset patch # User Mads Kiilerich # Date 2019-11-29 11:47:32 # Node ID 563708f2275d8baea231cef2e44e661b16779431 # Parent b6b6955981a55dc3737a5d5160316b0168426745 tests: add some doctests for urlify and markup diff --git a/kallithea/lib/helpers.py b/kallithea/lib/helpers.py --- a/kallithea/lib/helpers.py +++ b/kallithea/lib/helpers.py @@ -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* markup/b>") + literal('Urlify http://example.com/ and 'https://example.com&apos; *and* <b>markup/b>') """ def _replace(match_obj): diff --git a/kallithea/lib/markup_renderer.py b/kallithea/lib/markup_renderer.py --- a/kallithea/lib/markup_renderer.py +++ b/kallithea/lib/markup_renderer.py @@ -150,6 +150,10 @@ class MarkupRenderer(object): @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'