How to store lightweight formatting (Textile, Markdown) in database?

前端 未结 4 478
故里飘歌
故里飘歌 2021-02-01 21:28

I\'m going to be implementing a lightweight formatting language (probably Textile, maybe Markdown) in a project I\'m working on, and I\'m wonder how best to store it in the data

4条回答
  •  野性不改
    2021-02-01 21:53

    What I've seen is indeed to store the compiled HTML in a seperate row in the database. Just have one row 'content' and another 'content_html', and save the compiled HTML in the 'content_html' row.

    (Surely you have some kind of save method that you can override to do this?)

提交回复
热议问题