From 358651b19c279c8d0ecdb5c8e68fe6340659a6bf Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Thu, 23 Jul 2015 00:41:03 +0200 Subject: [PATCH] Fixes #1313 --- lib/core/common.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/core/common.py b/lib/core/common.py index 8f6ca2954..a0255dda4 100755 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -2482,7 +2482,9 @@ def extractTextTagContent(page): [u'Title', u'foobar'] """ - page = re.sub(r"(?si)[^\s>]*%s[^<]*" % REFLECTED_VALUE_MARKER, "", page or "") + page = page or "" + if REFLECTED_VALUE_MARKER in page: + page = re.sub(r"(?si)[^\s>]*%s[^\s<]*" % REFLECTED_VALUE_MARKER, "", page) return filter(None, (_.group('result').strip() for _ in re.finditer(TEXT_TAG_REGEX, page))) def trimAlphaNum(value):