##// END OF EJS Templates
minirst: use colwidth to match title lengths (issue2455)
Matt Mackall -
r12867:eda77c3e stable
parent child Browse files
Show More
@@ -248,7 +248,7 b' def findsections(blocks):'
248 # +------------------------------+
248 # +------------------------------+
249 if (block['type'] == 'paragraph' and
249 if (block['type'] == 'paragraph' and
250 len(block['lines']) == 2 and
250 len(block['lines']) == 2 and
251 len(block['lines'][0]) == len(block['lines'][1]) and
251 encoding.colwidth(block['lines'][0]) == len(block['lines'][1]) and
252 _sectionre.match(block['lines'][1])):
252 _sectionre.match(block['lines'][1])):
253 block['underline'] = block['lines'][1][0]
253 block['underline'] = block['lines'][1][0]
254 block['type'] = 'section'
254 block['type'] = 'section'
@@ -358,7 +358,7 b' def formatblock(block, width):'
358 indent += ' '
358 indent += ' '
359 return indent + ('\n' + indent).join(block['lines'])
359 return indent + ('\n' + indent).join(block['lines'])
360 if block['type'] == 'section':
360 if block['type'] == 'section':
361 underline = len(block['lines'][0]) * block['underline']
361 underline = encoding.colwidth(block['lines'][0]) * block['underline']
362 return "%s%s\n%s%s" % (indent, block['lines'][0],indent, underline)
362 return "%s%s\n%s%s" % (indent, block['lines'][0],indent, underline)
363 if block['type'] == 'definition':
363 if block['type'] == 'definition':
364 term = indent + block['lines'][0]
364 term = indent + block['lines'][0]
General Comments 0
You need to be logged in to leave comments. Login now