diff options
| author | Rémi Verschelde | 2018-05-31 15:38:30 +0200 |
|---|---|---|
| committer | Rémi Verschelde | 2018-05-31 15:38:33 +0200 |
| commit | 819911d16e9d5c556cb37de05cedc28d326d9b29 (patch) | |
| tree | 0e2fc3bc83f68104e3aaa1e770cbc0fb023e5e4c /doc/tools/makerst.py | |
| parent | 4d277b96ad581358f63870ae051dc73b69c82cd7 (diff) | |
| download | godot-819911d16e9d5c556cb37de05cedc28d326d9b29.tar.gz godot-819911d16e9d5c556cb37de05cedc28d326d9b29.tar.zst godot-819911d16e9d5c556cb37de05cedc28d326d9b29.zip | |
Diffstat (limited to 'doc/tools/makerst.py')
| -rwxr-xr-x | doc/tools/makerst.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/doc/tools/makerst.py b/doc/tools/makerst.py index adbd810d1..289e967a9 100755 --- a/doc/tools/makerst.py +++ b/doc/tools/makerst.py @@ -155,9 +155,19 @@ def rstize_text(text, cclass): text = pre_text + "\n\n" + post_text pos += 2 + next_brac_pos = text.find('[') + + # Escape \ character, otherwise it ends up as an escape character in rst + pos = 0 + while True: + pos = text.find('\\', pos, next_brac_pos) + if pos == -1: + break + text = text[:pos] + "\\\\" + text[pos + 1:] + pos += 2 + # Escape * character to avoid interpreting it as emphasis pos = 0 - next_brac_pos = text.find('[') while True: pos = text.find('*', pos, next_brac_pos) if pos == -1: |
