From 1af65aff44c23947e58cfec9468f9c20b8763431 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Sun, 7 Feb 2016 17:19:06 +0100 Subject: Fix badly formatted tags in XML Also add parsing of [code] tags in RST converter --- doc/tools/makerst.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'doc/tools/makerst.py') diff --git a/doc/tools/makerst.py b/doc/tools/makerst.py index 5cd99a797f..a31b7134f1 100644 --- a/doc/tools/makerst.py +++ b/doc/tools/makerst.py @@ -130,7 +130,7 @@ def rstize_text(text,cclass): pos = text.find('_', pos) if pos == -1: break - if text[pos + 1] == ' ' or text[pos + 1] == '\\': + if not text[pos + 1].isalnum(): # don't escape within a snake_case word text = text[:pos] + "\_" + text[pos + 1:] pos += 2 else: @@ -159,7 +159,7 @@ def rstize_text(text,cclass): if cmd.find('html') == 0: cmd = tag_text[:space_pos] param = tag_text[space_pos + 1:] - tag_text = param + tag_text = param elif cmd.find('method') == 0: cmd = tag_text[:space_pos] param = tag_text[space_pos + 1:] @@ -191,6 +191,8 @@ def rstize_text(text,cclass): tag_text = '**' elif cmd == 'u' or cmd == '/u': tag_text = '' + elif cmd == 'code' or cmd == '/code': + tag_text = '``' else: tag_text = ':ref:`' + tag_text + '`' -- cgit v1.2.3