Skip to content

Commit b782f9b

Browse files
komakinomarijnh
authored andcommitted
Added MIME "application/x-httpd-php-open" for PHP mode that starts in PHP.
1 parent 85fe405 commit b782f9b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

mode/php/php.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@
7979
var html = htmlMode.startState();
8080
return {html: html,
8181
php: phpMode.startState(),
82-
curMode: htmlMode,
83-
curState: html,
84-
curClose: null}
82+
curMode: parserConfig.startOpen ? phpMode : htmlMode,
83+
curState: parserConfig.startOpen ? phpMode.startState() : html,
84+
curClose: parserConfig.startOpen ? /^\?>/ : null}
8585
},
8686

8787
copyState: function(state) {
@@ -106,5 +106,6 @@
106106
}
107107
});
108108
CodeMirror.defineMIME("application/x-httpd-php", "php");
109+
CodeMirror.defineMIME("application/x-httpd-php-open", {name: "php", startOpen: true});
109110
CodeMirror.defineMIME("text/x-php", phpConfig);
110111
})();

0 commit comments

Comments
 (0)