From 336b73735fb5e67f2ba469b5ffbf8b1291efa85b Mon Sep 17 00:00:00 2001 From: Adam Felizzi Date: Fri, 27 Apr 2018 14:57:25 +1000 Subject: [PATCH] manual: Updated escape character regex Updated the text_escape function to regex escape characters in the generators escape set. This is for the case when a generators special character set collides with regex's special character set. --- manual/tools/parse_doxygen_xml.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manual/tools/parse_doxygen_xml.py b/manual/tools/parse_doxygen_xml.py index bafe9d93e..c3e334018 100755 --- a/manual/tools/parse_doxygen_xml.py +++ b/manual/tools/parse_doxygen_xml.py @@ -57,7 +57,7 @@ class Generator(object): """ Return a string with latex special characters escaped """ - escape_regex = re.compile('|'.join(self.ESCAPE_PATTERNS.keys())) + escape_regex = re.compile(re.escape('|'.join(self.ESCAPE_PATTERNS.keys()))) return escape_regex.sub(lambda p: self.ESCAPE_PATTERNS[p.group()], string) def get_text(self, soup, escape=True):