changeset 38185:3277940a935f stable

templatefuncs: only render text portion of minirst.format() result When "keep" argument is provided, the function returns (text, pruned), where pruned is a list of sections from the original plain text that were pruned from the rendered result. Let's not output it together with the rendered HTML.
author Anton Shestakov <av6@dwimlabs.net>
date Wed, 06 Jun 2018 21:19:42 +0800
parents ca473c05bd10
children c0081d3e1598
files mercurial/templatefuncs.py tests/test-help.t
diffstat 2 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/templatefuncs.py	Wed Jun 06 21:15:26 2018 +0800
+++ b/mercurial/templatefuncs.py	Wed Jun 06 21:19:42 2018 +0800
@@ -553,7 +553,7 @@
     text = evalstring(context, mapping, args[0])
     style = evalstring(context, mapping, args[1])
 
-    return minirst.format(text, style=style, keep=['verbose'])
+    return minirst.format(text, style=style, keep=['verbose'])[0]
 
 @templatefunc('separate(sep, args...)', argspec='sep *args')
 def separate(context, mapping, args):
--- a/tests/test-help.t	Wed Jun 06 21:15:26 2018 +0800
+++ b/tests/test-help.t	Wed Jun 06 21:19:42 2018 +0800
@@ -3138,7 +3138,7 @@
   <p>
   which will prevent the pager from running.
   </p>
-  windows
+  
   </div>
   </div>
   </div>