Get the first line

merge-requests/30/head
Bob Mottram 2021-05-15 20:43:42 +01:00
parent 818a920365
commit dbd9acbc9d
1 changed files with 2 additions and 0 deletions

View File

@ -388,6 +388,8 @@ def _getSnippetFromBlogContent(postJsonObject: {}) -> str:
if '</p>' in content:
content = content.split('</p>', 1)[0]
content = removeHtml(content)
if '\n' in content:
content = content.split('\n')[0]
if len(content) >= 256:
content = content[:252] + '...'
return content