minirst: do not fail on an empty admonition block stable
authorSimon Heimberg <simohe@besonet.ch>
Mon, 04 Nov 2013 10:23:06 +0100
branchstable
changeset 19993 03ec85b9cfc4
parent 19992 8ac7b85bd8f9
child 19994 fc251b1a1dad
minirst: do not fail on an empty admonition block
mercurial/minirst.py
--- a/mercurial/minirst.py	Mon Nov 04 10:23:06 2013 +0100
+++ b/mercurial/minirst.py	Mon Nov 04 10:23:06 2013 +0100
@@ -453,6 +453,8 @@
     indent = ' ' * block['indent']
     if block['type'] == 'admonition':
         admonition = _admonitiontitles[block['admonitiontitle']]
+        if not block['lines']:
+            return indent + admonition + '\n'
         hang = len(block['lines'][-1]) - len(block['lines'][-1].lstrip())
 
         defindent = indent + hang * ' '