This commit is contained in:
Miroslav Stampar 2015-10-05 15:33:29 +02:00
parent acd6b7797f
commit 1c6e288eb1

View File

@ -2503,7 +2503,10 @@ def extractTextTagContent(page):
page = page or ""
if REFLECTED_VALUE_MARKER in page:
page = re.sub(r"(?si)[^\s>]*%s[^\s<]*" % REFLECTED_VALUE_MARKER, "", page)
try:
page = re.sub(r"(?i)[^\s>]*%s[^\s<]*" % REFLECTED_VALUE_MARKER, "", page)
except MemoryError:
page = page.replace(REFLECTED_VALUE_MARKER, "")
return filter(None, (_.group('result').strip() for _ in re.finditer(TEXT_TAG_REGEX, page)))