minirst: only strip leading newlines, not indentation
authorMatt Mackall <mpm@selenic.com>
Thu, 11 Aug 2011 22:05:31 -0500
changeset 15036 bb96e12a3242
parent 15035 cc669e4fec95
child 15037 df47381b41d6
minirst: only strip leading newlines, not indentation
mercurial/minirst.py
--- a/mercurial/minirst.py	Thu Aug 11 14:34:03 2011 -0500
+++ b/mercurial/minirst.py	Thu Aug 11 22:05:31 2011 -0500
@@ -39,7 +39,7 @@
     has an 'indent' field and a 'lines' field.
     """
     blocks = []
-    for b in _blockre.split(text.strip()):
+    for b in _blockre.split(text.lstrip('\n').rstrip()):
         lines = b.splitlines()
         indent = min((len(l) - len(l.lstrip())) for l in lines)
         lines = [l[indent:] for l in lines]