helpers: fix metatags extraction in case description is empty
This commit is contained in:
parent
b32fce1a79
commit
38e4304852
2 changed files with 11 additions and 3 deletions
|
|
@ -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)])
|
||||
|
|
|
|||
|
|
@ -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]"
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue