r/FastAPI • • Sep 19 '21

Question How to save and retrive RichTextEditor value in Mongodb+FastApi?

Frontend site I want to use Rich text editor(bold,italic line etc), I want to store these editor data MongoDb using fastapi. How could I store whole textEditor value in MongoDb and retrive them as a real format?

1 Upvotes

4 comments sorted by

2

u/zarlo5899 Sep 20 '21

you can store the html it exports https://richtexteditor.com/docs/jsapi_getHTMLCode.aspx
if you can i would convert it to markdown and store that

1

u/Deadly_chef Sep 20 '21

Why use RTF and not HTML?

1

u/Riemero Sep 20 '21

RichTextEditor uses HTML, it doesn't have to do anything wile the rtf format (luckily!)