helpers: fix metatags extraction in case description is empty

This commit is contained in:
Marcin Kuzminski 2017-11-08 16:44:21 +01:00
parent b32fce1a79
commit 38e4304852
2 changed files with 11 additions and 3 deletions

View file

@ -986,10 +986,10 @@ def extract_metatags(value):
"""
Extract supported meta-tags from given text value
"""
if not value:
return ''
tags = []
if not value:
return tags, ''
for key, val in tags_paterns.items():
pat, replace_html = val
tags.extend([(key, x.group()) for x in pat.finditer(value)])

View file

@ -187,6 +187,14 @@ def test_age_in_future(age_args, expected, kw, pylonsapp):
@pytest.mark.parametrize("sample, expected_tags", [
# entry
((
""
),
[
]),
# entry
((
"hello world [stale]"
),