From patchwork Sat Jun 7 19:52:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: minirst: make substitutions be unicode, as they are used on unicode data From: Augie Fackler X-Patchwork-Id: 4950 Message-Id: To: mercurial-devel@selenic.com Date: Sat, 07 Jun 2014 15:52:33 -0400 # HG changeset patch # User Augie Fackler # Date 1402170658 14400 # Sat Jun 07 15:50:58 2014 -0400 # Node ID efe7c79ca21edbdc2aeb83e60335c6d89294f3db # Parent 7afe70a5d2ad5b22c21ba9be849451407c1f337f minirst: make substitutions be unicode, as they are used on unicode data Caught this while working to try and get 'hg help' working in Python 3. diff --git a/mercurial/minirst.py b/mercurial/minirst.py --- a/mercurial/minirst.py +++ b/mercurial/minirst.py @@ -353,14 +353,14 @@ return blocks def inlineliterals(blocks): - substs = [('``', '"')] + substs = [(u'``', u'"')] for b in blocks: if b['type'] in ('paragraph', 'section'): b['lines'] = [replace(l, substs) for l in b['lines']] return blocks def hgrole(blocks): - substs = [(':hg:`', '"hg '), ('`', '"')] + substs = [(u':hg:`', u'"hg '), (u'`', u'"')] for b in blocks: if b['type'] in ('paragraph', 'section'): # Turn :hg:`command` into "hg command". This also works