equal
deleted
inserted
replaced
671 """Parse and format the text according to width.""" |
671 """Parse and format the text according to width.""" |
672 blocks, pruned = parse(text, indent, keep or []) |
672 blocks, pruned = parse(text, indent, keep or []) |
673 if section: |
673 if section: |
674 blocks = filtersections(blocks, section) |
674 blocks = filtersections(blocks, section) |
675 if style == 'html': |
675 if style == 'html': |
676 text = formathtml(blocks) |
676 return formathtml(blocks) |
677 else: |
677 else: |
678 text = formatplain(blocks, width=width) |
678 return formatplain(blocks, width=width) |
679 if keep is None: |
|
680 return text |
|
681 else: |
|
682 return text, pruned |
|
683 |
679 |
684 def filtersections(blocks, section): |
680 def filtersections(blocks, section): |
685 """Select parsed blocks under the specified section""" |
681 """Select parsed blocks under the specified section""" |
686 parents = [] |
682 parents = [] |
687 sections = getsections(blocks) |
683 sections = getsections(blocks) |