开发者

codemirror fails when adding </textarea> tag inside it

I'm using codemirror http://marijn.haverbeke.nl/codemirror/ to let users create their own web templates inside a web application.

Codemirror works great, except for the time that user开发者_运维百科s have put a tag inside their source code. When I load that up inside code mirror, it breaks everything in the source code that follows after because it thinks my codemirror text area is closed.

I'm using the following way to launch codemirror:

CodeMirror.fromTextArea('code')

It works great on my existing textarea "code" except when users add inside their templates (in the codemirror textarea).


solved by wrapping htmlspecialchars() around the code, before putting it in code mirror!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜