It is possible to write Markdown content with invalid syntax. Invalid means that the BlueCloth library cannot parse the contents and throws an exception. The markdown in Rails does not catch any BlueCloth exceptions, and because of this, the full page is not displayed (the "Server 500 Error" page is displayed instead).
In my case, users are allowed to write Markdown content and save it in the database. If someone used an invalid syntax, all subsequent attempts to render this content will fail (Status Code 500 - Internal Server Error).
How did you get around this problem? Is it possible to check the Markdown syntax at the model level before saving to the database?
ruby ruby-on-rails markdown
Christoph schiessl
source share