diff mercurial/minirst.py @ 39310:a2a5d4ad5276

minirst: make format() simply return a formatted text It's a source of bugs to change the type of the return value conditionally.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 05 Aug 2018 12:11:19 +0900
parents 92e9aa38a578
children 57f9b3d91abc
line wrap: on
line diff
--- a/mercurial/minirst.py	Sun Aug 05 12:20:43 2018 +0900
+++ b/mercurial/minirst.py	Sun Aug 05 12:11:19 2018 +0900
@@ -673,13 +673,9 @@
     if section:
         blocks = filtersections(blocks, section)
     if style == 'html':
-        text = formathtml(blocks)
+        return formathtml(blocks)
     else:
-        text = formatplain(blocks, width=width)
-    if keep is None:
-        return text
-    else:
-        return text, pruned
+        return formatplain(blocks, width=width)
 
 def filtersections(blocks, section):
     """Select parsed blocks under the specified section"""