forked from Imagelibrary/seL4
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.
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user