views:

67

answers:

1

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 users 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).

Any help is much appreciated!

+1  A: 

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

Jorre