I created a simple CMS. And now, when users add their own articles, I want them to add as html without writing any html. Just like stackoverflow does.
I use PHP and MySQL.
For example, user creates an article (user does not have html skills), now JS builds markup and this will be added into MySQL via PHP as html.
StackOverflow uses a Markdown system for inputting text. Specifically, PageDown, which runs in the client.
It’s fairly simple to use and set up, and if you want to store as HTML, you can just convert the article to HTML sometime before storing it into your MySQL database. Finding a MarkDown implementation that can be used from PHP (with sanitizer support) would probably be better than trusting the HTML generated by the article when they submit. At the very least, you should check the article to make sure it’s both valid HTML and only using white-listed tags!