Mercurial > kallithea
changeset 5093:588a160dbb9a stable
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
author | Andrew Shadura <andrew@shadura.me> |
---|---|
date | Tue, 05 May 2015 17:38:10 +0200 |
parents | d660ccdd628d |
children | 200f43d9c86d |
files | kallithea/lib/markup_renderer.py |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/kallithea/lib/markup_renderer.py Wed May 06 16:21:51 2015 +0200 +++ b/kallithea/lib/markup_renderer.py Tue May 05 17:38:10 2015 +0200 @@ -193,6 +193,6 @@ 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)