minirst: convert ``foo`` into "foo" upon display
This lets us markup many more occurances of inline literals since they
no longer look strange in the terminal output.
--- a/mercurial/minirst.py Tue Oct 20 22:42:49 2009 +0200
+++ b/mercurial/minirst.py Tue Oct 20 22:16:27 2009 +0200
@@ -260,6 +260,13 @@
return blocks
+def inlineliterals(blocks):
+ for b in blocks:
+ if b['type'] == 'paragraph':
+ b['lines'] = [l.replace('``', '"') for l in b['lines']]
+ return blocks
+
+
def addmargins(blocks):
"""Adds empty blocks for vertical spacing.
@@ -316,6 +323,7 @@
for b in blocks:
b['indent'] += indent
blocks = findliteralblocks(blocks)
+ blocks = inlineliterals(blocks)
blocks = findsections(blocks)
blocks = findbulletlists(blocks)
blocks = findoptionlists(blocks)