Simon Willison’s Weblog

Subscribe

Should I store markdown instead of HTML into database fields?

8th September 2013

My answer to Should I store markdown instead of HTML into database fields? on Quora

You should store the exact format that was entered by the user.

- This lets you offer an “edit” feature without round-tripping between two formats.
- This makes debugging much easier
- Related: if you need to investigate a security bug, having the original input is essential.

If you’re worried about performance, you can cache the transformed HTML somewhere—or even denormalize it to an extra table column. Just make sure you always have the original input available.

This is Should I store markdown instead of HTML into database fields? by Simon Willison, posted on 8th September 2013.

Next: What is the best way to choose between two equally feasible start-up ideas?

Previous: How can you run image processing in cloud code (Parse) ? If parse is not the best

Monthly briefing

Sponsor me for $10/month and get a curated email digest of the month's most important LLM developments.

Pay me to send you less!

Sponsor & subscribe