diff mercurial/minirst.py @ 9291:cd5b6a11b607

minirst: indent literal blocks with two spaces The vast majority* of them are formatted like this in the source, so this basically reverts the output to how it looked before we got the minirst parser. *: the help on templating use four spaces for some examples and will now shown with an indentation of just two spaces.
author Martin Geisler <mg@lazybytes.net>
date Sun, 02 Aug 2009 17:17:17 +0200
parents c9c7e8cdac9c
children 01e580143423
line wrap: on
line diff
--- a/mercurial/minirst.py	Sun Aug 02 16:34:25 2009 +0200
+++ b/mercurial/minirst.py	Sun Aug 02 17:17:17 2009 +0200
@@ -243,7 +243,10 @@
     indent = ' ' * block['indent']
     if block['type'] == 'margin':
         return ''
-    elif block['type'] in ('literal', 'section'):
+    elif block['type'] == 'literal':
+        indent += '  '
+        return indent + ('\n' + indent).join(block['lines'])
+    elif block['type'] == 'section':
         return indent + ('\n' + indent).join(block['lines'])
     elif block['type'] == 'definition':
         term = indent + block['lines'][0]