minirst: use colwidth to match title lengths (
issue2455)
--- 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]