Project

General

Profile

Revision 229 trunk/scripts/codemirror/mode/stex

View differences:

index.html
89 89
      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {});
90 90
    </script>
91 91

  
92
    <p><strong>MIME types defined:</strong> <code>text/stex</code>.</p>
92
    <p><strong>MIME types defined:</strong> <code>text/x-stex</code>.</p>
93 93

  
94 94
  </body>
95 95
</html>
stex.js
82 82
    }
83 83

  
84 84
    function normal(source, state) {
85
	if (source.match(/^\\[a-z]+/)) {
85
	if (source.match(/^\\[a-zA-Z@]+/)) {
86 86
	    var cmdName = source.current();
87 87
	    cmdName = cmdName.substr(1, cmdName.length-1);
88 88
	    var plug = plugins[cmdName];
......
95 95
	    return plug.style;
96 96
	}
97 97

  
98
        // escape characters 
99
        if (source.match(/^\\[$&%#{}_]/)) {
100
          return "tag";
101
        }
102

  
103
        // white space control characters
104
        if (source.match(/^\\[,;!\/]/)) {
105
          return "tag";
106
        }
107

  
98 108
	var ch = source.next();
99 109
	if (ch == "%") {
100
	    setState(state, inCComment);
110
            // special case: % at end of its own line; stay in same state
111
            if (!source.eol()) {
112
              setState(state, inCComment);
113
            }
101 114
	    return "comment";
102 115
	} 
103 116
	else if (ch=='}' || ch==']') {

Also available in: Unified diff