--- a/mercurial/help.py Sun Aug 05 11:43:05 2018 +0900
+++ b/mercurial/help.py Sun Aug 05 12:06:07 2018 +0900
@@ -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)