Changeset - 588a160dbb9a
[Not reviewed]
stable
0 1 0
Andrew Shadura - 11 years ago 2015-05-05 17:38:10
andrew@shadura.me
rst: in @mention parser, escape spaces so they don't go to HTML

This eliminates extra spaces around @mentions. Every time mention was followed
by a comma, for example:

@username, have you seen it?

it turned into:

@username , have you seen it?

So an extra space was inserted. It was inserted because otherwise rst parser
might not recognise the markup (i.e. @user1,@user2 is replaced by
**user1**,**user2** — that would be interpreted as <b>user1**,**user2</b>).

See http://docutils.sf.net/docs/ref/rst/restructuredtext.html#character-level-inline-markup
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/markup_renderer.py
Show inline comments
 
@@ -193,6 +193,6 @@ class MarkupRenderer(object):
 

	
 
        def wrapp(match_obj):
 
            uname = match_obj.groups()[0]
 
            return ' **@%(uname)s** ' % {'uname': uname}
 
            return '\ **@%(uname)s**\ ' % {'uname': uname}
 
        mention_hl = mention_pat.sub(wrapp, source).strip()
 
        return cls.rst(mention_hl)
0 comments (0 inline, 0 general)