mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #991380 (RegEx broken, Fatal Error Converting txt -> mobi)
This commit is contained in:
parent
7aeb6157f6
commit
cb4beb395a
@ -179,7 +179,11 @@ class HeuristicProcessor(object):
|
|||||||
for match in re.finditer(pat, search_text):
|
for match in re.finditer(pat, search_text):
|
||||||
ital_string = str(match.group('words'))
|
ital_string = str(match.group('words'))
|
||||||
#self.log.debug("italicising "+str(match.group(0))+" with <i>"+ital_string+"</i>")
|
#self.log.debug("italicising "+str(match.group(0))+" with <i>"+ital_string+"</i>")
|
||||||
html = re.sub(re.escape(str(match.group(0))), '<i>%s</i>' % ital_string, html)
|
try:
|
||||||
|
html = re.sub(re.escape(str(match.group(0))), '<i>%s</i>' % ital_string, html)
|
||||||
|
except OverflowError:
|
||||||
|
# match.group(0) was too large to be compiled into a regex
|
||||||
|
continue
|
||||||
|
|
||||||
return html
|
return html
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user