diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2016-02-07 17:19:06 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2016-02-07 17:19:12 +0100 |
commit | 1af65aff44c23947e58cfec9468f9c20b8763431 (patch) | |
tree | c1df7bf58b4d6e9160676f0abb6c603115418133 /doc/tools/makerst.py | |
parent | b766e9c79b898c3f0c03d13b9e2648d5c72ceee0 (diff) |
Fix badly formatted tags in XML
Also add parsing of [code] tags in RST converter
Diffstat (limited to 'doc/tools/makerst.py')
-rw-r--r-- | doc/tools/makerst.py | 6 |
1 files changed, 4 insertions, 2 deletions
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 + '<class_'+tag_text.lower()+'>`' |