diff --git a/kallithea/lib/helpers.py b/kallithea/lib/helpers.py
--- a/kallithea/lib/helpers.py
+++ b/kallithea/lib/helpers.py
@@ -540,29 +540,6 @@ def person_by_id(id_, show_attr="usernam
return id_
-def desc_stylize(value):
- """
- converts tags from value into html equivalent
-
- :param value:
- """
- if not value:
- return ''
-
- value = re.sub(r'\[see\ \=>\ *([a-zA-Z0-9\/\=\?\&\ \:\/\.\-]*)\]',
- '
see => \\1
', value)
- value = re.sub(r'\[license\ \=>\ *([a-zA-Z0-9\/\=\?\&\ \:\/\.\-]*)\]',
- '', value)
- value = re.sub(r'\[(requires|recommends|conflicts|base)\ \=>\ *([a-zA-Z0-9\-\/]*)\]',
- '', value)
- value = re.sub(r'\[(lang|language)\ \=>\ *([a-zA-Z\-\/\#\+]*)\]',
- '\\2
', value)
- value = re.sub(r'\[([a-z]+)\]',
- '\\1
', value)
-
- return value
-
-
def boolicon(value):
"""Returns boolean value of a value, represented as small html image of true/false
icons
@@ -1270,7 +1247,13 @@ def fancy_file_stats(stats):
_URLIFY_RE = re.compile(r'''
# URL markup
-(?P%s)
+(?P%s) |
+# "Stylize" markup
+\[see\ \=>\ *(?P[a-zA-Z0-9\/\=\?\&\ \:\/\.\-]*)\] |
+\[license\ \=>\ *(?P[a-zA-Z0-9\/\=\?\&\ \:\/\.\-]*)\] |
+\[(?Prequires|recommends|conflicts|base)\ \=>\ *(?P[a-zA-Z0-9\-\/]*)\] |
+\[(?:lang|language)\ \=>\ *(?P[a-zA-Z\-\/\#\+]*)\] |
+\[(?P[a-z]+)\]
''' % (url_re.pattern),
re.VERBOSE | re.MULTILINE | re.IGNORECASE)
@@ -1290,6 +1273,23 @@ def urlify_text(s, repo_name=None, link_
url = match_obj.group('url')
if url is not None:
return '%(url)s' % {'url': url}
+ if stylize:
+ seen = match_obj.group('seen')
+ if seen:
+ return 'see => %s
' % seen
+ license = match_obj.group('license')
+ if license:
+ return '' % (license, license)
+ tagtype = match_obj.group('tagtype')
+ if tagtype:
+ tagvalue = match_obj.group('tagvalue')
+ return '' % (tagtype, tagtype, tagvalue, tagvalue)
+ lang = match_obj.group('lang')
+ if lang:
+ return '%s
' % lang
+ tag = match_obj.group('tag')
+ if tag:
+ return '%s
' % (tag, tag)
return match_obj.group(0)
def _urlify(s):
@@ -1305,8 +1305,6 @@ def urlify_text(s, repo_name=None, link_
s = html_escape(s)
if repo_name is not None:
s = urlify_changesets(s, repo_name)
- if stylize:
- s = desc_stylize(s)
s = _urlify(s)
if repo_name is not None:
s = urlify_issues(s, repo_name, link_)