##// END OF EJS Templates
minirst: use bytes.strip instead of str.strip
Augie Fackler -
r32524:6e9a2c9c default
parent child Browse files
Show More
@@ -452,7 +452,7 b' def findadmonitions(blocks, admonitions='
452 452 }
453 453
454 454 def formatoption(block, width):
455 desc = ' '.join(map(str.strip, block['lines']))
455 desc = ' '.join(map(bytes.strip, block['lines']))
456 456 colwidth = encoding.colwidth(block['optstr'])
457 457 usablewidth = width - 1
458 458 hanging = block['optstrwidth']
@@ -474,7 +474,7 b' def formatblock(block, width):'
474 474 hang = len(block['lines'][-1]) - len(block['lines'][-1].lstrip())
475 475
476 476 defindent = indent + hang * ' '
477 text = ' '.join(map(str.strip, block['lines']))
477 text = ' '.join(map(bytes.strip, block['lines']))
478 478 return '%s\n%s\n' % (indent + admonition,
479 479 util.wrap(text, width=width,
480 480 initindent=defindent,
@@ -512,7 +512,7 b' def formatblock(block, width):'
512 512 term = indent + block['lines'][0]
513 513 hang = len(block['lines'][-1]) - len(block['lines'][-1].lstrip())
514 514 defindent = indent + hang * ' '
515 text = ' '.join(map(str.strip, block['lines'][1:]))
515 text = ' '.join(map(bytes.strip, block['lines'][1:]))
516 516 return '%s\n%s\n' % (term, util.wrap(text, width=width,
517 517 initindent=defindent,
518 518 hangindent=defindent))
@@ -567,7 +567,7 b' def formathtml(blocks):'
567 567
568 568 if btype == 'admonition':
569 569 admonition = escape(_admonitiontitles[b['admonitiontitle']])
570 text = escape(' '.join(map(str.strip, lines)))
570 text = escape(' '.join(map(bytes.strip, lines)))
571 571 out.append('<p>\n<b>%s</b> %s\n</p>\n' % (admonition, text))
572 572 elif btype == 'paragraph':
573 573 out.append('<p>\n%s\n</p>\n' % escape('\n'.join(lines)))
@@ -597,7 +597,7 b' def formathtml(blocks):'
597 597 elif btype == 'definition':
598 598 openlist('dl', level)
599 599 term = escape(lines[0])
600 text = escape(' '.join(map(str.strip, lines[1:])))
600 text = escape(' '.join(map(bytes.strip, lines[1:])))
601 601 out.append(' <dt>%s\n <dd>%s\n' % (term, text))
602 602 elif btype == 'bullet':
603 603 bullet, head = lines[0].split(' ', 1)
@@ -609,12 +609,12 b' def formathtml(blocks):'
609 609 elif btype == 'field':
610 610 openlist('dl', level)
611 611 key = escape(b['key'])
612 text = escape(' '.join(map(str.strip, lines)))
612 text = escape(' '.join(map(bytes.strip, lines)))
613 613 out.append(' <dt>%s\n <dd>%s\n' % (key, text))
614 614 elif btype == 'option':
615 615 openlist('dl', level)
616 616 opt = escape(b['optstr'])
617 desc = escape(' '.join(map(str.strip, lines)))
617 desc = escape(' '.join(map(bytes.strip, lines)))
618 618 out.append(' <dt>%s\n <dd>%s\n' % (opt, desc))
619 619
620 620 # close lists if indent level of next block is lower
General Comments 0
You need to be logged in to leave comments. Login now