forgejo/public/vendor/plugins/highlight/highlight.pack.js

2 lines
670 KiB
JavaScript
Raw Normal View History

2019-04-17 08:05:40 +09:00
/*! highlight.js v9.15.6 | BSD3 License | git.io/hljslicense */
!function(e){var t="object"==typeof window&&window||"object"==typeof self&&self;"undefined"!=typeof exports?e(exports):t&&(t.hljs=e({}),"function"==typeof define&&define.amd&&define([],function(){return t.hljs}))}(function(i){var p=[],l=Object.keys,b={},m={},t=/^(no-?highlight|plain|text)$/i,u=/\blang(?:uage)?-([\w-]+)\b/i,r=/((^(<[^>]+>|\t|)+|(?:\n)))/gm,a={case_insensitive:"cI",lexemes:"l",contains:"c",keywords:"k",subLanguage:"sL",className:"cN",begin:"b",beginKeywords:"bK",end:"e",endsWithParent:"eW",illegal:"i",excludeBegin:"eB",excludeEnd:"eE",returnBegin:"rB",returnEnd:"rE",relevance:"r",variants:"v",IDENT_RE:"IR",UNDERSCORE_IDENT_RE:"UIR",NUMBER_RE:"NR",C_NUMBER_RE:"CNR",BINARY_NUMBER_RE:"BNR",RE_STARTERS_RE:"RSR",BACKSLASH_ESCAPE:"BE",APOS_STRING_MODE:"ASM",QUOTE_STRING_MODE:"QSM",PHRASAL_WORDS_MODE:"PWM",C_LINE_COMMENT_MODE:"CLCM",C_BLOCK_COMMENT_MODE:"CBCM",HASH_COMMENT_MODE:"HCM",NUMBER_MODE:"NM",C_NUMBER_MODE:"CNM",BINARY_NUMBER_MODE:"BNM",CSS_NUMBER_MODE:"CSSNM",REGEXP_MODE:"RM",TITLE_MODE:"TM",UNDERSCORE_TITLE_MODE:"UTM",COMMENT:"C",beginRe:"bR",endRe:"eR",illegalRe:"iR",lexemesRe:"lR",terminators:"t",terminator_end:"tE"},T="</span>",C={classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:void 0};function f(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function S(e){return e.nodeName.toLowerCase()}function R(e,t){var r=e&&e.exec(t);return r&&0===r.index}function E(e){return t.test(e)}function c(e){var t,r={},a=Array.prototype.slice.call(arguments,1);for(t in e)r[t]=e[t];return a.forEach(function(e){for(t in e)r[t]=e[t]}),r}function g(e){var i=[];return function e(t,r){for(var a=t.firstChild;a;a=a.nextSibling)3===a.nodeType?r+=a.nodeValue.length:1===a.nodeType&&(i.push({event:"start",offset:r,node:a}),r=e(a,r),S(a).match(/br|hr|img|input/)||i.push({event:"stop",offset:r,node:a}));return r}(e,0),i}function o(e){if(a&&!e.langApiRestored){for(var t in e.langApiRestored=!0,a)e[t]&&(e[a[t]]=e[t]);(e.c||[]).concat(e.v||[]).forEach(o)}}function N(n){function _(e){return e&&e.source||e}function s(e,t){return new RegExp(_(e),"m"+(n.cI?"i":"")+(t?"g":""))}!function t(r,e){if(!r.compiled){if(r.compiled=!0,r.k=r.k||r.bK,r.k){var a={},i=function(r,e){n.cI&&(e=e.toLowerCase()),e.split(" ").forEach(function(e){var t=e.split("|");a[t[0]]=[r,t[1]?Number(t[1]):1]})};"string"==typeof r.k?i("keyword",r.k):l(r.k).forEach(function(e){i(e,r.k[e])}),r.k=a}r.lR=s(r.l||/\w+/,!0),e&&(r.bK&&(r.b="\\b("+r.bK.split(" ").join("|")+")\\b"),r.b||(r.b=/\B|\b/),r.bR=s(r.b),r.endSameAsBegin&&(r.e=r.b),r.e||r.eW||(r.e=/\B|\b/),r.e&&(r.eR=s(r.e)),r.tE=_(r.e)||"",r.eW&&e.tE&&(r.tE+=(r.e?"|":"")+e.tE)),r.i&&(r.iR=s(r.i)),null==r.r&&(r.r=1),r.c||(r.c=[]),r.c=Array.prototype.concat.apply([],r.c.map(function(e){return(t="self"===e?r:e).v&&!t.cached_variants&&(t.cached_variants=t.v.map(function(e){return c(t,{v:null},e)})),t.cached_variants||t.eW&&[c(t)]||[t];var t})),r.c.forEach(function(e){t(e,r)}),r.starts&&t(r.starts,e);var o=r.c.map(function(e){return e.bK?"\\.?(?:"+e.b+")\\.?":e.b}).concat([r.tE,r.i]).map(_).filter(Boolean);r.t=o.length?s(function(e,t){for(var r=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./,a=0,i="",o=0;o<e.length;o++){var n=a,s=_(e[o]);for(0<o&&(i+=t);0<s.length;){var l=r.exec(s);if(null==l){i+=s;break}i+=s.substring(0,l.index),s=s.substring(l.index+l[0].length),"\\"==l[0][0]&&l[1]?i+="\\"+String(Number(l[1])+n):(i+=l[0],"("==l[0]&&a++)}}return i}(o,"|"),!0):{exec:function(){return null}}}}(n)}function I(e,t,s,r){function l(e,t,r,a){var i='<span class="'+(a?"":C.classPrefix);return(i+=e+'">')+t+(r?"":T)}function _(){m+=null!=p.sL?function(){var e="string"==typeof p.sL;if(e&&!b[p.sL])return f(u);var t=e?I(p.sL,u,!0,o[p.sL]):O(u,p.sL.length?p.sL:void 0);return 0<p.r&&(S+=t.r),e&&(o[p.sL]=t.top),l(t.language,t.value,!1,!0)}():function(){var e,t,r,a,i,o,n;if(!p.k)return f(u);for(a="",t=0,p.lR.lastIndex=0,r=p.lR.exec(u);r;)a+=f(u.substring(t,r.index)),i=p,o=r,n=d.cI?o[0].toLowerCase():o[0],(e=i.k.hasOwnProperty(n)&&i.k[n])?(S+=e[1],a+=l(e[0],f(r[0]))):a+=f(r[0]),t=p.lR.lastIndex,r=p.lR.exec(u);re