Mercurial > hg-stable
changeset 12867:eda77c3e246a stable
minirst: use colwidth to match title lengths (issue2455)
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Wed, 27 Oct 2010 15:35:23 -0500 |
parents | eddc20306ab6 |
children | e1855dee28c1 |
files | mercurial/minirst.py |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/minirst.py Wed Oct 27 15:35:21 2010 -0500 +++ b/mercurial/minirst.py Wed Oct 27 15:35:23 2010 -0500 @@ -248,7 +248,7 @@ # +------------------------------+ if (block['type'] == 'paragraph' and len(block['lines']) == 2 and - len(block['lines'][0]) == len(block['lines'][1]) and + encoding.colwidth(block['lines'][0]) == len(block['lines'][1]) and _sectionre.match(block['lines'][1])): block['underline'] = block['lines'][1][0] block['type'] = 'section' @@ -358,7 +358,7 @@ indent += ' ' return indent + ('\n' + indent).join(block['lines']) if block['type'] == 'section': - underline = len(block['lines'][0]) * block['underline'] + underline = encoding.colwidth(block['lines'][0]) * block['underline'] return "%s%s\n%s%s" % (indent, block['lines'][0],indent, underline) if block['type'] == 'definition': term = indent + block['lines'][0]