Commit f83effc6 by Jaakko Luttinen

Fix issue #326

If the search query hit only the title but not article content,
an exception was raised. Convert filter results explicitly from
an iterable to a list in order to fix it.
parent c91061a0
......@@ -106,11 +106,11 @@ def get_content_snippet(content, keyword, max_words=30):
html = mark_safe(html)
else:
html = " ".join(
filter(
list(filter(
lambda x: x != "",
striptags(content).replace(
"\n",
" ").split(" "))[
" ").split(" ")))[
:max_words])
return html
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment