equal
deleted
inserted
replaced
450 blocks = addmargins(blocks) |
450 blocks = addmargins(blocks) |
451 blocks = prunecomments(blocks) |
451 blocks = prunecomments(blocks) |
452 blocks = findadmonitions(blocks) |
452 blocks = findadmonitions(blocks) |
453 return blocks, pruned |
453 return blocks, pruned |
454 |
454 |
|
455 def formatblocks(blocks, width): |
|
456 text = '\n'.join(formatblock(b, width) for b in blocks) |
|
457 return text |
|
458 |
455 def format(text, width, indent=0, keep=None): |
459 def format(text, width, indent=0, keep=None): |
456 """Parse and format the text according to width.""" |
460 """Parse and format the text according to width.""" |
457 blocks, pruned = parse(text, indent, keep or []) |
461 blocks, pruned = parse(text, indent, keep or []) |
458 text = '\n'.join(formatblock(b, width) for b in blocks) |
462 text = '\n'.join(formatblock(b, width) for b in blocks) |
459 if keep is None: |
463 if keep is None: |