@@ -2,10 +2,10 @@ CodeMirror.defineMode("htmlembedded", function(config, parserConfig) {
22
33 //config settings
44 var scriptStartRegex = parserConfig . scriptStartRegex || / ^ < % / i,
5- scriptEndRegex = parserConfig . scriptEndRegex || / ^ % > / i,
6- scriptingMode ;
7-
8- var htmlMixedMode = CodeMirror . getMode ( config , "htmlmixed" ) ;
5+ scriptEndRegex = parserConfig . scriptEndRegex || / ^ % > / i;
6+
7+ //inner modes
8+ var scriptingMode , htmlMixedMode ;
99
1010 //tokenizer when in html mode
1111 function htmlDispatch ( stream , state ) {
@@ -30,7 +30,8 @@ CodeMirror.defineMode("htmlembedded", function(config, parserConfig) {
3030
3131 return {
3232 startState : function ( ) {
33- scriptingMode = scriptingMode || CodeMirror . getMode ( config , parserConfig . scriptingModeSpec )
33+ scriptingMode = scriptingMode || CodeMirror . getMode ( config , parserConfig . scriptingModeSpec ) ;
34+ htmlMixedMode = htmlMixedMode || CodeMirror . getMode ( config , "htmlmixed" ) ;
3435 return {
3536 token : parserConfig . startOpen ? scriptingDispatch : htmlDispatch ,
3637 htmlState : htmlMixedMode . startState ( ) ,
@@ -65,8 +66,3 @@ CodeMirror.defineMode("htmlembedded", function(config, parserConfig) {
6566CodeMirror . defineMIME ( "application/x-ejs" , { name : "htmlembedded" , scriptingModeSpec :"javascript" } ) ;
6667CodeMirror . defineMIME ( "application/x-aspx" , { name : "htmlembedded" , scriptingModeSpec :"text/x-csharp" } ) ;
6768CodeMirror . defineMIME ( "application/x-jsp" , { name : "htmlembedded" , scriptingModeSpec :"text/x-java" } ) ;
68- /*CodeMirror.defineMIME("application/x-httpd-php", {
69- name: "htmlembedded",
70- scriptingModeSpec:"text/x-php",
71- scriptStartRegex: /^<\?/,
72- scriptEndRegex: /^\?>/});*/
0 commit comments