diff options
author | Brennan Ashton <bashton@brennanashton.com> | 2018-10-30 14:09:07 -0700 |
---|---|---|
committer | Marcus Müller <marcus@hostalia.de> | 2018-11-01 15:26:59 +0100 |
commit | 99a262b7309b6b291820168df7da1b3689382254 (patch) | |
tree | c41229f0c5b5f7e4226759033f28b6c72b32d3b6 /docs | |
parent | 08ed1e66f4cc6824fad043621f3b92e534d335e4 (diff) |
docs: Properly excape backslashes in swig docstrings
Fixes #2097
Diffstat (limited to 'docs')
-rw-r--r-- | docs/doxygen/swig_doc.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/docs/doxygen/swig_doc.py b/docs/doxygen/swig_doc.py index 307920d776..6b74c0155f 100644 --- a/docs/doxygen/swig_doc.py +++ b/docs/doxygen/swig_doc.py @@ -80,11 +80,13 @@ class Block2(object): def utoascii(text): """ - Convert unicode text into ascii and escape quotes. + Convert unicode text into ascii and escape quotes and backslashes. """ if text is None: return '' out = text.encode('ascii', 'replace') + # swig will require us to replace blackslash with 4 backslashes + out = out.replace(b'\\', b'\\\\\\\\') out = out.replace(b'"', b'\\"').decode('ascii') return str(out) |