On 05/05/2015 05:39 PM, Andrew Shadura wrote:
# HG changeset patch
# User Andrew Shadura <[email protected]>
# Date 1430840290 -7200
#      Tue May 05 17:38:10 2015 +0200
# Node ID 4a68442ad0a1898c08ea4a249b032bb73cd8c90e
# Parent  7dca6303d91ddb98bcc62f085d5342609a4d40b2
rst: in @mention parser, escape spaces so they don't go to HTML

This eliminates extra spaces around @mentions.
See 
http://docutils.sf.net/docs/ref/rst/restructuredtext.html#character-level-inline-markup

I don't think I have seen this - can you point at a "before" example? Perhaps also describe it in the commit message.

What was the problem - why were the spaces needed yet not needed anyway?

/Mads

diff --git a/kallithea/lib/markup_renderer.py b/kallithea/lib/markup_renderer.py
--- a/kallithea/lib/markup_renderer.py
+++ b/kallithea/lib/markup_renderer.py
@@ -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)
_______________________________________________
kallithea-general mailing list
[email protected]
http://lists.sfconservancy.org/mailman/listinfo/kallithea-general

_______________________________________________
kallithea-general mailing list
[email protected]
http://lists.sfconservancy.org/mailman/listinfo/kallithea-general

Reply via email to