Skip to content
Snippets Groups Projects
Commit 9b800601701c authored by Yuya Nishihara's avatar Yuya Nishihara
Browse files

help: inline minirst.format()

I'm going to make minirst.format() always returns a formatted text, not
text | (text, pruned).
parent 92e9aa38a578
No related branches found
No related tags found
No related merge requests found
......@@ -672,8 +672,10 @@
text = help_(ui, commands, name,
subtopic=subtopic, unknowncmd=unknowncmd, full=full, **opts)
formatted, pruned = minirst.format(text, textwidth, keep=keep,
section=section)
blocks, pruned = minirst.parse(text, keep=keep)
if section:
blocks = minirst.filtersections(blocks, section)
formatted = minirst.formatplain(blocks, textwidth)
# We could have been given a weird ".foo" section without a name
# to look for, or we could have simply failed to found "foo.bar"
......@@ -685,6 +687,7 @@
keep.append('omitted')
else:
keep.append('notomitted')
formatted, pruned = minirst.format(text, textwidth, keep=keep,
section=section)
return formatted
blocks, pruned = minirst.parse(text, keep=keep)
if section:
blocks = minirst.filtersections(blocks, section)
return minirst.formatplain(blocks, textwidth)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment