diff rhodecode/lib/helpers.py @ 1912:32e1e0745d3c beta

fixes issue with whitespace for referenced tasks in commit messages
author Marcin Kuzminski <marcin@python-works.com>
date Thu, 19 Jan 2012 03:47:48 +0200
parents 0614862a20ec
children 08344d037ba1
line wrap: on
line diff
--- a/rhodecode/lib/helpers.py	Tue Jan 17 23:13:19 2012 +0200
+++ b/rhodecode/lib/helpers.py	Thu Jan 19 03:47:48 2012 +0200
@@ -760,9 +760,13 @@
             ISSUE_PREFIX = conf.get('issue_prefix')
 
             def url_func(match_obj):
+                pref = ''
+                if match_obj.group().startswith(' '):
+                    pref = ' '
+
                 issue_id = match_obj.groups()[0]
                 tmpl = (
-                ' <a class="%(cls)s" href="%(url)s">'
+                '%(pref)s<a class="%(cls)s" href="%(url)s">'
                 '%(issue-prefix)s%(id-repr)s'
                 '</a>'
                 )
@@ -775,6 +779,7 @@
 
                 return tmpl % (
                     {
+                     'pref': pref,
                      'cls': 'issue-tracker-link',
                      'url': url,
                      'id-repr': issue_id,