minirst: modified minirst to also recognize empty comments.
The modifies minirst to also handle empty comments. An empty comment
is a block with a single line containing two dots.
--- a/mercurial/minirst.py Wed Nov 17 09:17:55 2010 +0100
+++ b/mercurial/minirst.py Tue Nov 16 13:29:08 2010 +0100
@@ -278,7 +278,8 @@
i = 0
while i < len(blocks):
b = blocks[i]
- if b['type'] == 'paragraph' and b['lines'][0].startswith('.. '):
+ if b['type'] == 'paragraph' and (b['lines'][0].startswith('.. ') or
+ b['lines'] == ['..']):
del blocks[i]
if i < len(blocks) and blocks[i]['type'] == 'margin':
del blocks[i]
--- a/tests/test-minirst.py Wed Nov 17 09:17:55 2010 +0100
+++ b/tests/test-minirst.py Tue Nov 16 13:29:08 2010 +0100
@@ -221,6 +221,10 @@
.. An indented comment
Some indented text.
+
+..
+
+Empty comment above
"""
debugformat('comments', comments, 30)
--- a/tests/test-minirst.py.out Wed Nov 17 09:17:55 2010 +0100
+++ b/tests/test-minirst.py.out Tue Nov 16 13:29:08 2010 +0100
@@ -339,5 +339,7 @@
Some text.
Some indented text.
+
+Empty comment above
----------------------------------------------------------------------