# HG changeset patch # User Erik Zielke # Date 1289910548 -3600 # Node ID 54be08fa4d1d6084966200fb7bb0d1d46a2e7042 # Parent ac627ab0b3a5ea4ed6778cd6fbe23c6105894a32 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. diff -r ac627ab0b3a5 -r 54be08fa4d1d mercurial/minirst.py --- 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] diff -r ac627ab0b3a5 -r 54be08fa4d1d tests/test-minirst.py --- 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) diff -r ac627ab0b3a5 -r 54be08fa4d1d tests/test-minirst.py.out --- 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 ----------------------------------------------------------------------