Homemade WYSIWYG installations as part of homemade blog engines or CMSes remind me of that children's book, "If You Give a Mouse a Cookie."

If you give a user a blog_posts database table and three form fields, they're going to want to format things... like bold, headline, paragraphs, and links.

If you give them a way to format things, they're going to want it to be WYSIWYG.

If you give them a WYSIWYG, they're going to want it to not mangle their posts or explode when they copy-paste stuff from an email or Microsoft Word or another website.

If you give them a WYSIWYG that doesn't mangle or explode, you've probably spent the better part of two weeks on this project so far and this is just the tip of the iceberg.

So when a user asks you for a simple database table and three form fields, just remember, they're probably going to want a WYSIWYG. And all WYSIWYGs are terrible.

* I hear you readers saying "but Wordpress and Gmail and Facebook and Squarespace aren't that bad!" to which I say "those projects have all either rejected WYSIWYGs completely [Facebook] or have spent the better part of a decade custom-tuning their WYSIWYG -- and often it will still suck. Downloading an opensource Javascript plugin is not the same at all.

** I hear other readers saying they just want to build a simple CMS and how dare I crush their dreams: to which I say, go ahead and code whatever you want... just beware of the WYSIWYG trap. Either ignore it entirely and sanitize the input and ensure your users are trained to use HTML or Markdown, or be ready for a big long trip down WYSIWYG lane which most often ends in the user never actually using it anyway because they're not even techie enough to log in. Perhaps consider building the WYSIWYG later, when the user actually complains about not having it.

*** Don't believe me that all WYSIWYGs, including simple ,highly-developed, million-dollar ones like Wordpress's, are terrible? Check out the HTML behind this blog post when I copy-pasted it from Gmail. It totally screwed up the paragraphs:

screenshot-from-2016-10-25-170937