Search code examples
javascriptcodemirror

Verbose mode (no silent-fail) for code mirror


I'm trying to get to work a CodeMirror javascript code editor (the one used at jsFiddle). It doesn't seem to highlight and since I'm sure I did everything right (but obviously I didn't) I need some errors to show me to he way.

I've problems only with highlighting. I need to highlight the code as PHP (pure PHP would be enough). I have copied all dependencies from docs and according to console, all were loaded.

There must be some error and I need to have it thrown. Console is empty.

How do I make CodeMirror throw errors instead of using silent-fail solutions?


Solution

  • There is no such functionality. If you specify a mode that doesn't exist, CodeMirror falls back to plain text mode. But since the examples that do have working highlighting are small and pretty simple, it shouldn't be too hard to figure out what you are doing different.