Commit 60bf09e6 by benjaoming

Merge pull request #327 from jluttine/fix-326-search-title

Fix issue #326
parents f100e698 f83effc6
...@@ -106,11 +106,11 @@ def get_content_snippet(content, keyword, max_words=30): ...@@ -106,11 +106,11 @@ def get_content_snippet(content, keyword, max_words=30):
html = mark_safe(html) html = mark_safe(html)
else: else:
html = " ".join( html = " ".join(
filter( list(filter(
lambda x: x != "", lambda x: x != "",
striptags(content).replace( striptags(content).replace(
"\n", "\n",
" ").split(" "))[ " ").split(" ")))[
:max_words]) :max_words])
return html 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