changeset 19993:03ec85b9cfc4 stable

minirst: do not fail on an empty admonition block
author Simon Heimberg <simohe@besonet.ch>
date Mon, 04 Nov 2013 10:23:06 +0100
parents 8ac7b85bd8f9
children fc251b1a1dad
files mercurial/minirst.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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 * ' '