diff --git a/frappe/website/doctype/blog_post/blog_post.py b/frappe/website/doctype/blog_post/blog_post.py index fc6038c6a9..be1b3201ed 100644 --- a/frappe/website/doctype/blog_post/blog_post.py +++ b/frappe/website/doctype/blog_post/blog_post.py @@ -162,6 +162,9 @@ def get_blog_list(doctype, txt=None, filters=None, limit_start=0, limit_page_len t1.title, t1.name, t1.blog_category, t1.route, t1.published_on, t1.published_on as creation, t1.content as content, + t1.content_type as content_type, + t1.content_html as content_html, + t1.content_md as content_md, ifnull(t1.blog_intro, t1.content) as intro, t2.full_name, t2.avatar, t1.blogger, (select count(name) from `tabComment` @@ -182,9 +185,12 @@ def get_blog_list(doctype, txt=None, filters=None, limit_start=0, limit_page_len posts = frappe.db.sql(query, as_dict=1) for post in posts: + + post.content = get_html_content_based_on_type(post, 'content', post.content_type) post.cover_image = find_first_image(post.content) post.published = global_date_format(post.creation) - post.content = strip_html_tags(post.content[:340]) + post.content = strip_html_tags(post.content) + if not post.comments: post.comment_text = _('No comments yet') elif post.comments==1: