Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(447)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/cm_web_modes/htmlmixed.js

Issue 2772343006: DevTools: Roll CodeMirror to 5.25.1 (Closed)
Patch Set: stray space Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // CodeMirror, copyright (c) by Marijn Haverbeke and others 1 // CodeMirror, copyright (c) by Marijn Haverbeke and others
2 // Distributed under an MIT license: http://codemirror.net/LICENSE 2 // Distributed under an MIT license: http://codemirror.net/LICENSE
3 3
4 (function(mod) { 4 (function(mod) {
5 if (typeof exports == "object" && typeof module == "object") // CommonJS 5 if (typeof exports == "object" && typeof module == "object") // CommonJS
6 mod(require("../../lib/codemirror"), require("../xml/xml"), require("../java script/javascript"), require("../css/css")); 6 mod(require("../../lib/codemirror"), require("../xml/xml"), require("../java script/javascript"), require("../css/css"));
7 else if (typeof define == "function" && define.amd) // AMD 7 else if (typeof define == "function" && define.amd) // AMD
8 define(["../../lib/codemirror", "../xml/xml", "../javascript/javascript", ". ./css/css"], mod); 8 define(["../../lib/codemirror", "../xml/xml", "../javascript/javascript", ". ./css/css"], mod);
9 else // Plain browser env 9 else // Plain browser env
10 mod(CodeMirror); 10 mod(CodeMirror);
11 })(function(CodeMirror) { 11 })(function(CodeMirror) {
12 "use strict"; 12 "use strict";
13 13
14 var defaultTags = { 14 var defaultTags = {
15 script: [ 15 script: [
16 ["lang", /(javascript|babel)/i, "javascript"], 16 ["lang", /(javascript|babel)/i, "javascript"],
17 ["type", /^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^$/i, "javasc ript"], 17 ["type", /^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i , "javascript"],
18 ["type", /./, "text/plain"], 18 ["type", /./, "text/plain"],
19 [null, null, "javascript"] 19 [null, null, "javascript"]
20 ], 20 ],
21 style: [ 21 style: [
22 ["lang", /^css$/i, "css"], 22 ["lang", /^css$/i, "css"],
23 ["type", /^(text\/)?(x-)?(stylesheet|css)$/i, "css"], 23 ["type", /^(text\/)?(x-)?(stylesheet|css)$/i, "css"],
24 ["type", /./, "text/plain"], 24 ["type", /./, "text/plain"],
25 [null, null, "css"] 25 [null, null, "css"]
26 ] 26 ]
27 }; 27 };
(...skipping 11 matching lines...) Expand all
39 39
40 var attrRegexpCache = {}; 40 var attrRegexpCache = {};
41 function getAttrRegexp(attr) { 41 function getAttrRegexp(attr) {
42 var regexp = attrRegexpCache[attr]; 42 var regexp = attrRegexpCache[attr];
43 if (regexp) return regexp; 43 if (regexp) return regexp;
44 return attrRegexpCache[attr] = new RegExp("\\s+" + attr + "\\s*=\\s*('|\")?( [^'\"]+)('|\")?\\s*"); 44 return attrRegexpCache[attr] = new RegExp("\\s+" + attr + "\\s*=\\s*('|\")?( [^'\"]+)('|\")?\\s*");
45 } 45 }
46 46
47 function getAttrValue(text, attr) { 47 function getAttrValue(text, attr) {
48 var match = text.match(getAttrRegexp(attr)) 48 var match = text.match(getAttrRegexp(attr))
49 return match ? match[2] : "" 49 return match ? /^\s*(.*?)\s*$/.exec(match[2])[1] : ""
50 } 50 }
51 51
52 function getTagRegexp(tagName, anchored) { 52 function getTagRegexp(tagName, anchored) {
53 return new RegExp((anchored ? "^" : "") + "<\/\s*" + tagName + "\s*>", "i"); 53 return new RegExp((anchored ? "^" : "") + "<\/\s*" + tagName + "\s*>", "i");
54 } 54 }
55 55
56 function addTags(from, to) { 56 function addTags(from, to) {
57 for (var tag in from) { 57 for (var tag in from) {
58 var dest = to[tag] || (to[tag] = []); 58 var dest = to[tag] || (to[tag] = []);
59 var source = from[tag]; 59 var source = from[tag];
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 }, 143 },
144 144
145 innerMode: function (state) { 145 innerMode: function (state) {
146 return {state: state.localState || state.htmlState, mode: state.localMod e || htmlMode}; 146 return {state: state.localState || state.htmlState, mode: state.localMod e || htmlMode};
147 } 147 }
148 }; 148 };
149 }, "xml", "javascript", "css"); 149 }, "xml", "javascript", "css");
150 150
151 CodeMirror.defineMIME("text/html", "htmlmixed"); 151 CodeMirror.defineMIME("text/html", "htmlmixed");
152 }); 152 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698