Update CodeMirror to version 5.49.0 (#8381)
* Update CodeMirror to version 5.49.0 * Update CodeMirror versions in librejs and VERSIONS
This commit is contained in:
parent
6fa14ac3c8
commit
1e9b330525
352 changed files with 14625 additions and 2451 deletions
|
@ -1,5 +1,5 @@
|
|||
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
||||
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
||||
// Distributed under an MIT license: https://codemirror.net/LICENSE
|
||||
|
||||
(function(mod) {
|
||||
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
||||
|
@ -14,7 +14,7 @@
|
|||
var defaultTags = {
|
||||
script: [
|
||||
["lang", /(javascript|babel)/i, "javascript"],
|
||||
["type", /^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^$/i, "javascript"],
|
||||
["type", /^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i, "javascript"],
|
||||
["type", /./, "text/plain"],
|
||||
[null, null, "javascript"]
|
||||
],
|
||||
|
@ -46,7 +46,7 @@
|
|||
|
||||
function getAttrValue(text, attr) {
|
||||
var match = text.match(getAttrRegexp(attr))
|
||||
return match ? match[2] : ""
|
||||
return match ? /^\s*(.*?)\s*$/.exec(match[2])[1] : ""
|
||||
}
|
||||
|
||||
function getTagRegexp(tagName, anchored) {
|
||||
|
@ -105,7 +105,7 @@
|
|||
return maybeBackup(stream, endTag, state.localMode.token(stream, state.localState));
|
||||
};
|
||||
state.localMode = mode;
|
||||
state.localState = CodeMirror.startState(mode, htmlMode.indent(state.htmlState, ""));
|
||||
state.localState = CodeMirror.startState(mode, htmlMode.indent(state.htmlState, "", ""));
|
||||
} else if (state.inTag) {
|
||||
state.inTag += stream.current()
|
||||
if (stream.eol()) state.inTag += " "
|
||||
|
@ -133,11 +133,11 @@
|
|||
return state.token(stream, state);
|
||||
},
|
||||
|
||||
indent: function (state, textAfter) {
|
||||
indent: function (state, textAfter, line) {
|
||||
if (!state.localMode || /^\s*<\//.test(textAfter))
|
||||
return htmlMode.indent(state.htmlState, textAfter);
|
||||
return htmlMode.indent(state.htmlState, textAfter, line);
|
||||
else if (state.localMode.indent)
|
||||
return state.localMode.indent(state.localState, textAfter);
|
||||
return state.localMode.indent(state.localState, textAfter, line);
|
||||
else
|
||||
return CodeMirror.Pass;
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue