##// END OF EJS Templates
minirst: handle line breaks in hg role
Martin Geisler -
r11192:babf9a5f default
parent child Browse files
Show More
@@ -257,12 +257,15 b' def inlineliterals(blocks):'
257 257 return blocks
258 258
259 259
260 _hgrolere = re.compile(r':hg:`([^`]+)`')
261
262 260 def hgrole(blocks):
263 261 for b in blocks:
264 262 if b['type'] in ('paragraph', 'section'):
265 b['lines'] = [_hgrolere.sub(r'"hg \1"', l) for l in b['lines']]
263 # Turn :hg:`command` into "hg command". This also works
264 # when there is a line break in the command and relies on
265 # the fact that we have no stray back-quotes in the input
266 # (run the blocks through inlineliterals first).
267 b['lines'] = [l.replace(':hg:`', '"hg ').replace('`', '"')
268 for l in b['lines']]
266 269 return blocks
267 270
268 271
General Comments 0
You need to be logged in to leave comments. Login now