|
|
|
!function(e){"undefined"!=typeof exports?e(exports):(self.hljs=e({}),"function"==typeof define&&define.amd&&define("hljs",[],function(){return self.hljs}))}(function(e){function t(e){return e.replace(/&/gm,"&").replace(/</gm,"<").replace(/>/gm,">")}function r(e){return e.nodeName.toLowerCase()}function n(e,t){var r=e&&e.exec(t);return r&&0==r.index}function a(e){return/^(no-?highlight|plain|text)$/i.test(e)}function i(e){var t,r,n,i=e.className+" ";if(i+=e.parentNode?e.parentNode.className:"",r=/\blang(?:uage)?-([\w-]+)\b/i.exec(i))return w(r[1])?r[1]:"no-highlight";for(i=i.split(/\s+/),t=0,n=i.length;n>t;t++)if(w(i[t])||a(i[t]))return i[t]}function o(e,t){var r,n={};for(r in e)n[r]=e[r];if(t)for(r in t)n[r]=t[r];return n}function c(e){var t=[];return function n(e,a){for(var i=e.firstChild;i;i=i.nextSibling)3==i.nodeType?a+=i.nodeValue.length:1==i.nodeType&&(t.push({event:"start",offset:a,node:i}),a=n(i,a),r(i).match(/br|hr|img|input/)||t.push({event:"stop",offset:a,node:i}));return a}(e,0),t}function s(e,n,a){function i(){return e.length&&n.length?e[0].offset!=n[0].offset?e[0].offset<n[0].offset?e:n:"start"==n[0].event?e:n:e.length?e:n}function o(e){function n(e){return" "+e.nodeName+'="'+t(e.value)+'"'}b+="<"+r(e)+Array.prototype.map.call(e.attributes,n).join("")+">"}function c(e){b+="</"+r(e)+">"}function s(e){("start"==e.event?o:c)(e.node)}for(var l=0,b="",u=[];e.length||n.length;){var d=i();if(b+=t(a.substr(l,d[0].offset-l)),l=d[0].offset,d==e){u.reverse().forEach(c);do s(d.splice(0,1)[0]),d=i();while(d==e&&d.length&&d[0].offset==l);u.reverse().forEach(o)}else"start"==d[0].event?u.push(d[0].node):u.pop(),s(d.splice(0,1)[0])}return b+t(a.substr(l))}function l(e){function t(e){return e&&e.source||e}function r(r,n){return new RegExp(t(r),"m"+(e.cI?"i":"")+(n?"g":""))}function n(a,i){if(!a.compiled){if(a.compiled=!0,a.k=a.k||a.bK,a.k){var c={},s=function(t,r){e.cI&&(r=r.toLowerCase()),r.split(" ").forEach(function(e){var r=e.split("|");c[r[0]]=[t,r[1]?Number(r[1]):1]})};"string"==typeof a.k?s("keyword",a.k):Object.keys(a.k).forEach(function(e){s(e,a.k[e])}),a.k=c}a.lR=r(a.l||/\b\w+\b/,!0),i&&(a.bK&&(a.b="\\b("+a.bK.split(" ").join("|")+")\\b"),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&&i.tE&&(a.tE+=(a.e?"|":"")+i.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(o(e,t))}):l.push("self"==e?a:e)}),a.c=l,a.c.forEach(function(e){n(e,a)}),a.starts&&n(a.starts,i);var b=a.c.map(function(e){return e.bK?"\\.?("+e.b+")\\.?":e.b}).concat([a.tE,a.i]).map(t).filter(Boolean);a.t=b.length?r(b.join("|"),!0):{exec:function(){return null}}}}n(e)}function b(e,r,a,i){function o(e,t){for(var r=0;r<t.c.length;r++)if(n(t.c[r].bR,e))return t.c[r]}function c(e,t){if(n(e.eR,t)){for(;e.endsParent&&e.parent;)e=e.parent;return e}return e.eW?c(e.parent,t):void 0}function s(e,t){return!a&&n(t.iR,e)}function d(e,t){var r=v.cI?t[0].toLowerCase():t[0];return e.k.hasOwnProperty(r)&&e.k[r]}function p(e,t,r,n){var a=n?"":y.classPrefix,i='<span class="'+a,o=r?"":"</span>";return i+=e+'">',i+t+o}function f(){if(!x.k)return t(S);var e="",r=0;x.lR.lastIndex=0;for(var n=x.lR.exec(S);n;){e+=t(S.substr(r,n.index-r));var a=d(x,n);a?(E+=a[1],e+=p(a[0],t(n[0]))):e+=t(n[0]),r=x.lR.lastIndex,n=x.lR.exec(S)}return e+t(S.substr(r))}function m(){var e="string"==typeof x.sL;if(e&&!k[x.sL])return t(S);var r=e?b(x.sL,S,!0,_[x.sL]):u(S,x.sL.length?x.sL:void 0);return x.r>0&&(E+=r.r),e&&(_[x.sL]=r.top),p(r.language,r.value,!1,!0)}function g(){return void 0!==x.sL?m():f()}function h(e,r){var n=e.cN?p(e.cN,"",!0):"";e.rB?(M+=n,S=""):e.eB?(M+=t(r)+n,S=""):(M+=n,S=r),x=Object.create(e,{parent:{value:x}})}function N(e,r){if(S+=e,void 0===r)return M+=g(),0;var n=o(r,x);if(n)return M+=g(),h(n,r),n.rB?0:r.length;var a=c(x,r);if(a){var i=x;i.rE||i.eE||(S+=r),M+=g();do x.cN&&(M+="</span>"),E+=x.r,x=x.parent;while(x!=a.parent);return i.eE&&(M+=t(r)),S="",a.starts&&h(a.starts,""),i.rE?0:r.length}if(s(r,x))throw new Error('Illegal lexeme "'+r+'" fo
|