Skip to content
Snippets Groups Projects
Commit eda77c3e authored by Matt Mackall's avatar Matt Mackall
Browse files

minirst: use colwidth to match title lengths (issue2455)

parent eddc2030
No related branches found
No related tags found
No related merge requests found
......@@ -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]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment