Question about storing data for a substack-like clone?

I'm working on a pet project wherein users can write posts with a full markdown editor. I'm curious if anyone knows how best to store these in the backend? Do you save the content as a .md file? or save it as plain text in the DB?? Am I making sense? Basically what's the ideal way to store user-generated markdown content
3 Replies
nexxel
nexxel3y ago
when i did it i stored the raw md text and then on fetching i used marked to convert it to html and then rendered that html all the conversion part happens on the server idk if this is the best way tho
Donny D
Donny DOP3y ago
interesting
needmorewood
needmorewood3y ago
you coulod store it as html, just make sure you sanitize it before storing it html text in the db
Want results from more Discord servers?
Add your server