Permalink
Browse files

Fix resolveMode's handling of MIME types in name fields

Also configure the htmlmixed option to pass through xml-mode-specific
options to its inner xml mode.

Issue #2265
  • Loading branch information...
marijnh committed Feb 17, 2014
1 parent 9f834a9 commit 1c18acc65717d348daa397ca8bda3b5ca1bd1c3e
Showing with 5 additions and 1 deletion.
  1. +1 −0 lib/codemirror.js
  2. +4 −1 mode/htmlmixed/htmlmixed.js
View
@@ -3445,6 +3445,7 @@ window.CodeMirror = (function() {
spec = mimeModes[spec];
} else if (spec && typeof spec.name == "string" && mimeModes.hasOwnProperty(spec.name)) {
var found = mimeModes[spec.name];
+ if (typeof found == "string") found = {name: found};
spec = createObj(found, spec);
spec.name = found.name;
} else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+xml$/.test(spec)) {
@@ -1,5 +1,8 @@
CodeMirror.defineMode("htmlmixed", function(config, parserConfig) {
- var htmlMode = CodeMirror.getMode(config, {name: "xml", htmlMode: true});
+ var htmlMode = CodeMirror.getMode(config, {name: "xml",
+ htmlMode: true,
+ multilineTagIndentFactor: parserConfig.multilineTagIndentFactor,
+ multilineTagIndentPastTag: parserConfig.multilineTagIndentPastTag});
var cssMode = CodeMirror.getMode(config, "css");
var scriptTypes = [], scriptTypesConf = parserConfig && parserConfig.scriptTypes;

0 comments on commit 1c18acc

Please sign in to comment.