diff --git a/flaskr/blog.py b/flaskr/blog.py index 9ae4adaf..d086da6b 100644 --- a/flaskr/blog.py +++ b/flaskr/blog.py @@ -24,8 +24,9 @@ def index(): " ORDER BY created DESC" ).fetchall() # Convert markdown to HTML for each post body - for post in posts: - post['body'] = markdown.markdown(post['body']) + posts = [ + {**post, 'body': markdown.markdown(post['body'])} for post in posts + ] return render_template("blog/index.html", posts=posts)