Address the issue of using an immutable cursor in the file
flaskr/blog.py. The previous implementation attempted to modify
the 'posts' object, which is immutable, leading to runtime
errors. This commit refactors the code to ensure that the
cursor is handled correctly, preventing any attempts to modify
immutable objects. This change resolves the problem by
introducing a mutable data structure to store the necessary
information, thereby maintaining the integrity of the cursor
and avoiding potential errors.
Implemented markdown support in the post body to enhance the
editor's functionality. The main blog view now renders markdown
content as HTML. This change allows users to format their posts
using markdown syntax, providing a richer text editing experience.
- Imported the markdown module in blog.py.
- Converted post bodies from markdown to HTML in the index view.
- Updated templates to indicate markdown support in the post body
field.
- Ensured safe rendering of HTML content in the blog index view.
Fixes #FLAS-29