This commit is contained in:
Kovid Goyal 2019-01-02 12:41:29 +05:30
parent d573c8e739
commit 3f57acc815
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -137,7 +137,7 @@ class DetectStructure(object):
def get_toc_parts_for_xpath(self, expr):
# if an attribute is selected by the xpath expr then truncate it
# from the path and instead return it as where to find the title text
title_attribute_regex = re.compile('/@([-\w]+)$')
title_attribute_regex = re.compile(r'/@([-\w]+)$')
match = title_attribute_regex.search(expr)
if match is not None:
return expr[0:match.start()], match.group(1)