Here is a link to a basic example: http://lawnmower.asuscomm.com/codemirror/mode/mIRC/
I think I found the issue. It looks like a case sensitive issue @Hawkee
If I change
CodeMirror.defineMode("mIRC", function() {
to
CodeMirror.defineMode("mirc", function() {
It breaks and doesn't work at all.
So what I've found is that this:
CodeMirror.defineMIME("text/mIRC", "mIRC");
must match this:
CodeMirror.defineMode("mIRC", function() {
The case in the defineMode must be exactly the same as the defineMIME
I also found that the defineMIME should be at the top of the script.
I will update this code now to all lowercase and move the defineMIME to the top
Is that the version of the script from the top here, because I still see an unmatched quote issue that I'm not getting on my tests.
You can see it here: http://www.hawkee.com/snippet/9837/
Note I also found that "text/mIRC" has to match the mode: on the html. I changed it above to "text/mirc" to make it uniform.
Edit I'm pretty sure the site is running an older version, because I see several other glitches that I already fixed.
It looks good, but I found another issue. I added support for mult-line comments, as mIRC does support / /
and lots of people use this type of comment. The problem was, there wasn't a check for / inside a function or if statement.
ie. if (/ iswm %bla)
You can see what it does here: http://www.hawkee.com/snippet/9858/
It basically just comments out the rest of the script and it looks pretty stupid.
Anyway @Hawkee , I updated the script and this issue should be fixed.
Updated Found a typo preventing "writeini" from being highlighted. I had "writeint"
You can see it here: http://www.hawkee.com/snippet/8545/
Perfect, this was a shortcoming of CodeMirror. Thank you for putting this together!