How to work with wysiwyg generated code?
I want to use the same editor as SO has on a site of mine, the user should also be able to type code, which is stored in the database. But there's something I don't understand:
How do I make the difference between markup (p, strong, li)-tags and code that should be shown as code and not interpreted by the browser?
When I store the submitted data in the database, I'll call the htmlentities function, and this will affect every tag: markup generated wy the wmd editor, and also html code (or other language) posted by the user.
Any information on this please? I really have no 开发者_如何学Goidea how to go about it.
Why are you calling htmlentities function when you store it in the database?
This is what breaks your markdown. I mean markup. Well, both actually.
精彩评论