Changeset - d60f54b3eeb3
[Not reviewed]
default
0 1 0
Mads Kiilerich - 10 years ago 2015-06-19 18:00:42
madski@unity3d.com
helpers: extract internal _urlify_text function from urlify_text
1 file changed with 10 insertions and 10 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/helpers.py
Show inline comments
 
@@ -1264,21 +1264,21 @@ def fancy_file_stats(stats):
 
    return literal('<div style="width:%spx">%s%s</div>' % (width, d_a, d_d))
 

	
 

	
 
def urlify_text(text_, safe=True):
 
def _urlify_text(s):
 
    """
 
    Extract urls from text and make html links out of them
 

	
 
    :param text_:
 
    """
 

	
 
    def url_func(match_obj):
 
        url_full = match_obj.groups()[0]
 
        url_full = match_obj.group(1)
 
        return '<a href="%(url)s">%(url)s</a>' % ({'url': url_full})
 
    _newtext = url_re.sub(url_func, text_)
 
    if safe:
 
        return literal(_newtext)
 
    return _newtext
 
    return url_re.sub(url_func, s)
 

	
 
def urlify_text(s):
 
    """
 
    Extract urls from text and make literal html links out of them
 
    """
 
    s = _urlify_text(s)
 
    return literal(s)
 

	
 
def urlify_changesets(text_, repository):
 
    """
 
@@ -1325,7 +1325,7 @@ def urlify_commit(text_, repository, lin
 
    newtext = urlify_changesets(newtext, repository)
 

	
 
    # extract http/https links and make them real urls
 
    newtext = urlify_text(newtext, safe=False)
 
    newtext = _urlify_text(newtext)
 

	
 
    newtext = urlify_issues(newtext, repository, link_)
 

	
0 comments (0 inline, 0 general)