This is bad advice. Definitely sanitize on input, then escape on output. You should never be knowingly storing unsafe input.
In the vast majority of cases you control the client (web form) - anything "surprising" will then be an error - or worse; malicious.
In the case of a json service, if the client doesn't submit valid json for your schema / api - error out.
How do you detect HTML? Less-than/greater-than signs? Users are now banned from entering Less-than/greater-than signs?
But it gets worse. I had a code block in my post and it was also detecting URLs in my code.
`console.log` -> URL detected!