# HG changeset patch # User Mads Kiilerich # Date 2016-09-06 00:51:18 # Node ID 1717a7a4ae0c102649a06a64e7ea052e16f3439f # Parent f486d1d270256295ce43f6e605fb2ff317c32001 helpers: make linkify_others slightly smarter - don't markup empty space diff --git a/kallithea/lib/helpers.py b/kallithea/lib/helpers.py --- a/kallithea/lib/helpers.py +++ b/kallithea/lib/helpers.py @@ -1337,7 +1337,7 @@ def linkify_others(t, l): urls = re.compile(r'(\)',) links = [] for e in urls.split(t): - if not urls.match(e): + if e.strip() and not urls.match(e): links.append('%s' % (l, e)) else: links.append(e) diff --git a/kallithea/tests/other/test_libs.py b/kallithea/tests/other/test_libs.py --- a/kallithea/tests/other/test_libs.py +++ b/kallithea/tests/other/test_libs.py @@ -362,7 +362,6 @@ class TestLibs(TestController): @parametrize('sample,expected', [ ("deadbeefcafe @mention, and http://foo.bar/ yo", - """""" """deadbeefcafe""" """ @mention, and """ """http://foo.bar/"""