mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 07:17:55 +03:00
minirst: add formatblocks helper
This commit is contained in:
parent
8a607bdb6b
commit
9b6295af46
@ -452,6 +452,10 @@ def parse(text, indent=0, keep=None):
|
||||
blocks = findadmonitions(blocks)
|
||||
return blocks, pruned
|
||||
|
||||
def formatblocks(blocks, width):
|
||||
text = '\n'.join(formatblock(b, width) for b in blocks)
|
||||
return text
|
||||
|
||||
def format(text, width, indent=0, keep=None):
|
||||
"""Parse and format the text according to width."""
|
||||
blocks, pruned = parse(text, indent, keep or [])
|
||||
|
Loading…
Reference in New Issue
Block a user