minirst: do not add a 2nd empty paragraph stable
authorSimon Heimberg <simohe@besonet.ch>
Mon, 04 Nov 2013 10:23:06 +0100
branchstable
changeset 19995 0f6e360b14f2
parent 19994 fc251b1a1dad
child 19996 52b437586435
minirst: do not add a 2nd empty paragraph This does not add a separating block after a separated note directive. .. note:: text is formatted to Note: text
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
@@ -381,6 +381,9 @@
         if (blocks[i]['type'] == blocks[i - 1]['type'] and
             blocks[i]['type'] in ('bullet', 'option', 'field')):
             i += 1
+        elif not blocks[i - 1]['lines']:
+            # no lines in previous block, do not seperate
+            i += 1
         else:
             blocks.insert(i, dict(lines=[''], indent=0, type='margin'))
             i += 2