--- a/mercurial/minirst.py Thu Apr 22 09:57:04 2010 +0200
+++ b/mercurial/minirst.py Thu Apr 22 10:04:53 2010 +0200
@@ -252,6 +252,15 @@
return blocks
+_hgrolere = re.compile(r':hg:`([^`]+)`')
+
+def hgrole(blocks):
+ for b in blocks:
+ if b['type'] == 'paragraph':
+ b['lines'] = [_hgrolere.sub(r'"hg \1"', l) for l in b['lines']]
+ return blocks
+
+
def addmargins(blocks):
"""Adds empty blocks for vertical spacing.
@@ -333,6 +342,7 @@
blocks = findliteralblocks(blocks)
blocks, pruned = prunecontainers(blocks, keep or [])
blocks = inlineliterals(blocks)
+ blocks = hgrole(blocks)
blocks = splitparagraphs(blocks)
blocks = updatefieldlists(blocks)
blocks = findsections(blocks)