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.
More recent articles
- Datasette Enrichments: a new plugin framework for augmenting your data - 1st December 2023
- llamafile is the new best way to run a LLM on your own computer - 29th November 2023
- Prompt injection explained, November 2023 edition - 27th November 2023
- I'm on the Newsroom Robots podcast, with thoughts on the OpenAI board - 25th November 2023
- Weeknotes: DevDay, GitHub Universe, OpenAI chaos - 22nd November 2023
- Deciphering clues in a news article to understand how it was reported - 22nd November 2023
- Exploring GPTs: ChatGPT in a trench coat? - 15th November 2023
- Financial sustainability for open source projects at GitHub Universe - 10th November 2023
- ospeak: a CLI tool for speaking text in the terminal via OpenAI - 7th November 2023
- DALL-E 3, GPT4All, PMTiles, sqlite-migrate, datasette-edit-schema - 30th October 2023