jce-manager/assets/js/min/highlight.pack-ck.js

1 line
29 KiB
JavaScript
Raw Permalink Normal View History

2014-09-11 12:49:20 +00:00
var hljs=new function(){function e(e){return e.replace(/&/gm,"&amp;").replace(/</gm,"&lt;").replace(/>/gm,"&gt;")}function t(e){return e.nodeName.toLowerCase()}function r(e,t){var r=e&&e.exec(t);return r&&0==r.index}function n(e){return Array.prototype.map.call(e.childNodes,function(e){return 3==e.nodeType?N.useBR?e.nodeValue.replace(/\n/g,""):e.nodeValue:"br"==t(e)?"\n":n(e)}).join("")}function a(e){var t=(e.className+" "+(e.parentNode?e.parentNode.className:"")).split(/\s+/);return t=t.map(function(e){return e.replace(/^language-/,"")}),t.filter(function(e){return m(e)||"no-highlight"==e})[0]}function i(e,t){var r={};for(var n in e)r[n]=e[n];if(t)for(var n in t)r[n]=t[n];return r}function c(e){var r=[];return function n(e,a){for(var i=e.firstChild;i;i=i.nextSibling)3==i.nodeType?a+=i.nodeValue.length:"br"==t(i)?a+=1:1==i.nodeType&&(r.push({event:"start",offset:a,node:i}),a=n(i,a),r.push({event:"stop",offset:a,node:i}));return a}(e,0),r}function s(r,n,a){function i(){return r.length&&n.length?r[0].offset!=n[0].offset?r[0].offset<n[0].offset?r:n:"start"==n[0].event?r:n:r.length?r:n}function c(r){function n(t){return" "+t.nodeName+'="'+e(t.value)+'"'}u+="<"+t(r)+Array.prototype.map.call(r.attributes,n).join("")+">"}function s(e){u+="</"+t(e)+">"}function o(e){("start"==e.event?c:s)(e.node)}for(var l=0,u="",b=[];r.length||n.length;){var d=i();if(u+=e(a.substr(l,d[0].offset-l)),l=d[0].offset,d==r){b.reverse().forEach(s);do o(d.splice(0,1)[0]),d=i();while(d==r&&d.length&&d[0].offset==l);b.reverse().forEach(c)}else"start"==d[0].event?b.push(d[0].node):b.pop(),o(d.splice(0,1)[0])}return u+e(a.substr(l))}function o(e){function t(e){return e&&e.source||e}function r(r,n){return RegExp(t(r),"m"+(e.cI?"i":"")+(n?"g":""))}function n(a,c){function s(t,r){e.cI&&(r=r.toLowerCase()),r.split(" ").forEach(function(e){var r=e.split("|");o[r[0]]=[t,r[1]?Number(r[1]):1]})}if(!a.compiled){if(a.compiled=!0,a.k=a.k||a.bK,a.k){var o={};"string"==typeof a.k?s("keyword",a.k):Object.keys(a.k).forEach(function(e){s(e,a.k[e])}),a.k=o}a.lR=r(a.l||/\b[A-Za-z0-9_]+\b/,!0),c&&(a.bK&&(a.b=a.bK.split(" ").join("|")),a.b||(a.b=/\B|\b/),a.bR=r(a.b),a.e||a.eW||(a.e=/\B|\b/),a.e&&(a.eR=r(a.e)),a.tE=t(a.e)||"",a.eW&&c.tE&&(a.tE+=(a.e?"|":"")+c.tE)),a.i&&(a.iR=r(a.i)),void 0===a.r&&(a.r=1),a.c||(a.c=[]);var l=[];a.c.forEach(function(e){e.v?e.v.forEach(function(t){l.push(i(e,t))}):l.push("self"==e?a:e)}),a.c=l,a.c.forEach(function(e){n(e,a)}),a.starts&&n(a.starts,c);var u=a.c.map(function(e){return e.bK?"\\.?\\b("+e.b+")\\b\\.?":e.b}).concat([a.tE]).concat([a.i]).map(t).filter(Boolean);a.t=u.length?r(u.join("|"),!0):{exec:function(e){return null}},a.continuation={}}}n(e)}function l(t,n,a,i){function c(e,t){for(var n=0;n<t.c.length;n++)if(r(t.c[n].bR,e))return t.c[n]}function s(e,t){return r(e.eR,t)?e:e.eW?s(e.parent,t):void 0}function b(e,t){return!a&&r(t.iR,e)}function d(e,t){var r=y.cI?t[0].toLowerCase():t[0];return e.k.hasOwnProperty(r)&&e.k[r]}function p(e,t,r,n){var a=n?"":N.classPrefix,i='<span class="'+a,c=r?"":"</span>";return i+=e+'">',i+t+c}function f(){var t=e(x);if(!k.k)return t;var r="",n=0;k.lR.lastIndex=0;for(var a=k.lR.exec(t);a;){r+=t.substr(n,a.index-n);var i=d(k,a);i?(C+=i[1],r+=p(i[0],a[0])):r+=a[0],n=k.lR.lastIndex,a=k.lR.exec(t)}return r+t.substr(n)}function g(){if(k.sL&&!v[k.sL])return e(x);var t=k.sL?l(k.sL,x,!0,k.continuation.top):u(x);return k.r>0&&(C+=t.r),"continuous"==k.subLanguageMode&&(k.continuation.top=t.top),p(t.language,t.value,!1,!0)}function h(){return void 0!==k.sL?g():f()}function w(t,r){var n=t.cN?p(t.cN,"",!0):"";t.rB?(M+=n,x=""):t.eB?(M+=e(r)+n,x=""):(M+=n,x=r),k=Object.create(t,{parent:{value:k}})}function _(t,r){if(x+=t,void 0===r)return M+=h(),0;var n=c(r,k);if(n)return M+=h(),w(n,r),n.rB?0:r.length;var a=s(k,r);if(a){var i=k;i.rE||i.eE||(x+=r),M+=h();do k.cN&&(M+="</span>"),C+=k.r,k=k.parent;while(k!=a.parent);return i.eE&&(M+=e(r)),x="",a.starts&&w(a.starts,""),i.rE?0:r.length}if(b(r,k))throw new Error('Illegal lexeme "'+r+'" for mode "'+(k.cN||"<unnamed>")+'"');return x+=r,r.length||1}var y=m(t);if(!y)throw new Err