Seditio Source
Root |
./othercms/xenForo 2.2.8/js/vendor/codemirror/mode/htmlmixed/htmlmixed.min.js
(function(d){"object"==typeof exports&&"object"==typeof module?d(require("../../lib/codemirror"),require("../xml/xml"),require("../javascript/javascript"),require("../css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml","../javascript/javascript","../css/css"],d):d(CodeMirror)})(function(d){function p(f){var b=k[f];return b?b:k[f]=new RegExp("\\s+"+f+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*")}function q(f,b){return(f=f.match(p(b)))?/^\s*(.*?)\s*$/.exec(f[2])[1]:
""}function l(f,b){for(var d in f)for(var g=b[d]||(b[d]=[]),h=f[d],e=h.length-1;0<=e;e--)g.unshift(h[e])}function r(d,b){for(var f=0;f<d.length;f++){var g=d[f];if(!g[0]||g[1].test(q(b,g[0])))return g[2]}}var t={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],
[null,null,"css"]]},k={};d.defineMode("htmlmixed",function(f,b){function k(a,c){var b=g.token(a,c.htmlState),e=/\btag\b/.test(b),m;if(e&&!/[<>\s\/]/.test(a.current())&&(m=c.htmlState.tagName&&c.htmlState.tagName.toLowerCase())&&h.hasOwnProperty(m))c.inTag=m+" ";else if(c.inTag&&e&&/>$/.test(a.current())){e=/^([\S]+) (.*)/.exec(c.inTag);c.inTag=null;a=">"==a.current()&&r(h[e[1]],e[2]);a=d.getMode(f,a);var l=new RegExp("^</s*"+e[1]+"s*>","i"),n=new RegExp("</s*"+e[1]+"s*>","i");c.token=function(a,c){if(a.match(l,
!1))return c.token=k,c.localState=c.localMode=null;c=c.localMode.token(a,c.localState);var b=a.current(),d=b.search(n);-1<d?a.backUp(b.length-d):b.match(/<\/?$/)&&(a.backUp(b.length),a.match(n,!1)||a.match(b));return c};c.localMode=a;c.localState=d.startState(a,g.indent(c.htmlState,"",""))}else c.inTag&&(c.inTag+=a.current(),a.eol()&&(c.inTag+=" "));return b}var g=d.getMode(f,{name:"xml",htmlMode:!0,multilineTagIndentFactor:b.multilineTagIndentFactor,multilineTagIndentPastTag:b.multilineTagIndentPastTag,
allowMissingTagName:b.allowMissingTagName}),h={},e=b&&b.tags;b=b&&b.scriptTypes;l(t,h);e&&l(e,h);if(b)for(e=b.length-1;0<=e;e--)h.script.unshift(["type",b[e].matches,b[e].mode]);return{startState:function(){var a=d.startState(g);return{token:k,inTag:null,localMode:null,localState:null,htmlState:a}},copyState:function(a){var c;a.localState&&(c=d.copyState(a.localMode,a.localState));return{token:a.token,inTag:a.inTag,localMode:a.localMode,localState:c,htmlState:d.copyState(g,a.htmlState)}},token:function(a,
c){return c.token(a,c)},indent:function(a,c,b){return!a.localMode||/^\s*<\//.test(c)?g.indent(a.htmlState,c,b):a.localMode.indent?a.localMode.indent(a.localState,c,b):d.Pass},innerMode:function(a){return{state:a.localState||a.htmlState,mode:a.localMode||g}}}},"xml","javascript","css");d.defineMIME("text/html","htmlmixed")});