Comparing version 0.0.5 to 0.0.6
@@ -100,2 +100,6 @@ 'use strict'; | ||
function highlight(text, language) { | ||
var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, | ||
_ref$component = _ref.component, | ||
component = _ref$component === undefined ? 'pre' : _ref$component; | ||
if (!languages[language]) { | ||
@@ -115,3 +119,3 @@ if (!language) { | ||
hooks.run('after-tokenize', env); | ||
return '<pre class=\'reprism ' + language + ' language-' + language + '\'>' + Token.stringify(encode(env.tokens), env.language) + '</pre>\n '; | ||
return '' + (component ? '<' + component + ' class=\'reprism ' + language + ' language-' + language + '\'>' : '') + Token.stringify(encode(env.tokens), env.language) + (component ? '</' + component + '>' : '') + '\n '; | ||
} | ||
@@ -118,0 +122,0 @@ |
@@ -100,2 +100,6 @@ 'use strict'; | ||
function highlight(text, language) { | ||
var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, | ||
_ref$component = _ref.component, | ||
component = _ref$component === undefined ? 'pre' : _ref$component; | ||
if (!languages[language]) { | ||
@@ -115,3 +119,3 @@ if (!language) { | ||
hooks.run('after-tokenize', env); | ||
return '<pre class=\'reprism ' + language + ' language-' + language + '\'>' + Token.stringify(encode(env.tokens), env.language) + '</pre>\n '; | ||
return '' + (component ? '<' + component + ' class=\'reprism ' + language + ' language-' + language + '\'>' : '') + Token.stringify(encode(env.tokens), env.language) + (component ? '</' + component + '>' : '') + '\n '; | ||
} | ||
@@ -118,0 +122,0 @@ |
{ | ||
"name": "reprism", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "Modular Syntax highlighting for the web", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -140,4 +140,5 @@ # RePrism | ||
* Arguments | ||
* `code: String` - The string of code you want to highlight | ||
* `language: String` - The language you want to use to parse the code. | ||
* `code: String (Required)` - The string of code you want to highlight | ||
* `language: String (Required)` - The language you want to use to parse the code. | ||
* `component: String|Boolean` - Defaults to `pre`. The html tag RePrism should use to wrap the source code. If set to `false`, the source code will not be wrapped in any element. | ||
* Returns | ||
@@ -144,0 +145,0 @@ * `String` - The resulting HTML markup for your code as a `String`, wrapped in a `<pre>` tag. |
/*! | ||
* reprism v0.0.5 - https://github.com/tannerlinsley/reprism | ||
* reprism v0.0.6 - https://github.com/tannerlinsley/reprism | ||
* MIT Licensed | ||
@@ -183,2 +183,6 @@ */ | ||
function highlight(text, language) { | ||
var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, | ||
_ref$component = _ref.component, | ||
component = _ref$component === undefined ? 'pre' : _ref$component; | ||
if (!languages[language]) { | ||
@@ -198,3 +202,3 @@ if (!language) { | ||
hooks.run('after-tokenize', env); | ||
return '<pre class=\'reprism ' + language + ' language-' + language + '\'>' + Token.stringify(encode(env.tokens), env.language) + '</pre>\n '; | ||
return '' + (component ? '<' + component + ' class=\'reprism ' + language + ' language-' + language + '\'>' : '') + Token.stringify(encode(env.tokens), env.language) + (component ? '</' + component + '>' : '') + '\n '; | ||
} | ||
@@ -201,0 +205,0 @@ |
/*! | ||
* reprism v0.0.5 - https://github.com/tannerlinsley/reprism | ||
* reprism v0.0.6 - https://github.com/tannerlinsley/reprism | ||
* MIT Licensed | ||
*/ | ||
!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.ReactSyntax=n():e.ReactSyntax=n()}("undefined"!=typeof self?self:this,function(){return function(e){var n={};function t(a){if(n[a])return n[a].exports;var r=n[a]={i:a,l:!1,exports:{}};return e[a].call(r.exports,r,r.exports,t),r.l=!0,r.exports}return t.m=e,t.c=n,t.d=function(e,n,a){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:a})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s=1)}([function(e,n,t){"use strict";var a,r;t.d(n,"j",function(){return s}),t.d(n,"n",function(){return u}),t.d(n,"h",function(){return o}),n.g=function(e,n){if(!s[n]){if(!n)throw new Error("A language is required!");throw new Error("The language: "+n+" hasn't been loaded yet!")}var t={code:e,grammar:s[n],language:n};return o.run("before-tokenize",t),t.tokens=k(t.code,t.grammar),o.run("after-tokenize",t),"<pre class='reprism "+n+" language-"+n+"'>"+c.stringify(f(t.tokens),t.language)+"</pre>\n "},n.d=f,n.f=g,n.m=p,n.k=function(){for(var e=arguments.length,n=Array(e),t=0;t<e;t++)n[t]=arguments[t];n.forEach(function(e){"Array"===g(e)?e.forEach(function(e){e.init(l)}):e.init(l)})},n.c=d,n.e=y,n.i=h,n.a=b,n.l=m,n.p=k,n.b=v,n.o=x;var i=0,s={extend:y,insertBefore:h,DFS:b},u={},o={all:{},add:v,run:x},c=(r=a=function e(n,t,a,r,i){!function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e),this.type=n,this.content=t,this.alias=a,this.length=0|(r||"").length,this.greedy=!!i},a.stringify=function(e,n,t){if("String"===g(e))return e;if("Array"===g(e))return e.map(function(t){return c.stringify(t,n,e)}).join("");var a={type:e.type,content:c.stringify(e.content,n,t),tag:"span",classes:["token",e.type],attributes:{},language:n,parent:t};if(e.alias){var r=Array.isArray(e.alias)?e.alias:[e.alias];Array.prototype.push.apply(a.classes,r)}o.run("wrap",a);var i=Object.keys(a.attributes).map(function(e){return e+'="'+(a.attributes[e]||"").replace(/"/g,""")+'"'}).join(" ");return"<"+a.tag+' class="'+a.classes.join(" ")+'"'+(i?" "+i:"")+">"+a.content+"</"+a.tag+">"},r),l={languages:s,plugins:u,insertBefore:h,matchGrammar:m,tokenize:k,hooks:o,util:{encode:f,type:g,objId:p,clone:d},Token:c};function f(e){return e instanceof c?new c(e.type,f(e.content),e.alias):"Array"===g(e)?e.map(f):e.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")}function g(e){return Object.prototype.toString.call(e).match(/\[object (\w+)\]/)[1]}function p(e){return e.__id||(i+=1,Object.defineProperty(e,"__id",{value:i})),e.__id}function d(e,n){if(n=n||{},"Array"===g(e)){if(n[p(e)])return n[p(e)];var t=[];return n[p(e)]=t,e.forEach(function(e,a){t[a]=d(e,n)}),t}if("Object"===g(e)){if(n[p(e)])return n[p(e)];var a={};return n[p(e)]=a,Object.keys(e).forEach(function(t){a[t]=d(e[t],n)}),a}return e}function y(e,n){var t=d(s[e]);return Object.keys(n).forEach(function(e){t[e]=n[e]}),t}function h(){for(var e=arguments.length,n=Array(e),t=0;t<e;t++)n[t]=arguments[t];var a=n[0],r=n[1],i=n[2],u=n[3],o=void 0===u?s:u,c=o[a],l=i;if(2===n.length)return l=n[1],Object.keys(l).forEach(function(e){c[e]=l[e]}),c;var f={};return Object.keys(c).forEach(function(e){e===r&&Object.keys(i).forEach(function(e){f[e]=i[e]}),f[e]=c[e]}),b(s,function(e,n){n===o[a]&&e!==a&&(this[e]=f)}),o[a]=f,o[a]}function b(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments[1],t=arguments[2],a=arguments[3];a=a||{},Object.keys(e).forEach(function(r){n.call(e,r,e[r],t||r),"Object"!==g(e[r])||a[p(e[r])]?"Array"!==g(e[r])||a[p(e[r])]||(a[p(e[r])]=!0,b(e[r],n,null,a)):(a[p(e[r])]=!0,b(e[r],n,r,a))})}function m(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=arguments[3],r=arguments[4],i=arguments[5],s=arguments[6];Object.keys(t).forEach(function(u){if(t[u]&&u!==s){var o=t[u];(o=Array.isArray(o)?o:[o]).forEach(function(s){var o=s.inside,l=!!s.lookbehind,f=!!s.greedy,g=0,p=s.alias;if(f&&!s.pattern.global){var d=s.pattern.toString().match(/[imuy]*$/)[0];s.pattern=RegExp(s.pattern.source,d+"g")}s=s.pattern||s;for(var y=a,h=r;y<n.length;h+=n[y].length,y+=1){var b=n[y];if(n.length>e.length)return;if(!(b instanceof c)){var v=0,x=void 0;if(f&&y!==n.length-1){if(s.lastIndex=h,!(x=s.exec(e)))break;for(var F=x.index+(l?x[1].length:0),j=x.index+x[0].length,w=y,A=h,S=n.length;w<S&&(A<j||!n[w].type&&!n[w-1].greedy);++w)F>=(A+=n[w].length)&&(y+=1,h=A);if(n[y]instanceof c)continue;v=w-y,b=e.slice(h,A),x.index-=h}else s.lastIndex=0,x=s.exec(b),v=1;if(x){l&&(g=x[1]?x[1].length:0);var O=x.index+g,E=O+(x=x[0].slice(g)).length,_=b.slice(0,O),$=b.slice(E),B=[y,v];_&&(y+=1,h+=_.length,B.push(_));var z=new c(u,o?k(x,o):x,p,x,f);if(B.push(z),$&&B.push($),Array.prototype.splice.apply(n,B),1!==v&&m(e,n,t,y,h,!0,u),i)break}else if(i)break}}})}})}function k(e,n){var t=[e],a=n.rest;return a&&(Object.keys(a).forEach(function(e){n[e]=a[e]}),delete n.rest),m(e,t,n,0,0,!1),t}function v(e,n){var t=o.all;t[e]=t[e]||[],t[e].push(n)}function x(e,n){var t=o.all[e];t&&t.length&&t.forEach(function(e){return e(n)})}},function(e,n,t){e.exports=t(2)},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var a=t(3),r=t(4),i=t(5),s=t(6),u=t(0);t.d(n,"languages",function(){return u.j}),t.d(n,"plugins",function(){return u.n}),t.d(n,"hooks",function(){return u.h}),t.d(n,"highlight",function(){return u.g}),t.d(n,"encode",function(){return u.d}),t.d(n,"getType",function(){return u.f}),t.d(n,"objId",function(){return u.m}),t.d(n,"loadLanguages",function(){return u.k}),t.d(n,"clone",function(){return u.c}),t.d(n,"extend",function(){return u.e}),t.d(n,"insertBefore",function(){return u.i}),t.d(n,"DFS",function(){return u.a}),t.d(n,"matchGrammar",function(){return u.l}),t.d(n,"tokenize",function(){return u.p}),t.d(n,"addHook",function(){return u.b}),t.d(n,"runHook",function(){return u.o}),Object(u.k)([a.a,r.a,i.a,s.a])},function(e,n,t){"use strict";n.a={language:"markup",init:function(e){e.languages.markup={comment:/<!--[\s\S]*?-->/,prolog:/<\?[\s\S]+?\?>/,doctype:/<!DOCTYPE[\s\S]+?>/i,cdata:/<!\[CDATA\[[\s\S]*?]]>/i,tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/i,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+)/i,inside:{punctuation:[/^=/,{pattern:/(^|[^\\])["']/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/&#?[\da-z]{1,8};/i},e.languages.markup.tag.inside["attr-value"].inside.entity=e.languages.markup.entity,e.hooks.add("wrap",function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))}),e.languages.xml=e.languages.markup,e.languages.html=e.languages.markup,e.languages.mathml=e.languages.markup,e.languages.svg=e.languages.markup}}},function(e,n,t){"use strict";n.a={language:"css",init:function(e){e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-]+?.*?(?:;|(?=\s*\{))/i,inside:{rule:/@[\w-]+/}},url:/url\((?:(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,selector:/[^{}\s][^{};]*?(?=\s*\{)/,string:{pattern:/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},property:/[-_a-z\xA0-\uFFFF][-\w\xA0-\uFFFF]*(?=\s*:)/i,important:/\B!important\b/i,function:/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:]/},e.languages.css.atrule.inside.rest=e.languages.css,e.languages.markup&&(e.languages.insertBefore("markup","tag",{style:{pattern:/(<style[\s\S]*?>)[\s\S]*?(?=<\/style>)/i,lookbehind:!0,inside:e.languages.css,alias:"language-css",greedy:!0}}),e.languages.insertBefore("inside","attr-value",{"style-attr":{pattern:/\s*style=("|')(?:\\[\s\S]|(?!\1)[^\\])*\1/i,inside:{"attr-name":{pattern:/^\s*style/i,inside:e.languages.markup.tag.inside},punctuation:/^\s*=\s*['"]|['"]\s*$/,"attr-value":{pattern:/.+/i,inside:e.languages.css}},alias:"language-css"}},e.languages.markup.tag))}}},function(e,n,t){"use strict";n.a={language:"clike",init:function(e){e.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,boolean:/\b(?:true|false)\b/,function:/[a-z0-9_]+(?=\()/i,number:/\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/}}}},function(e,n,t){"use strict";n.a={language:"javascript",init:function(e){e.languages.javascript=e.languages.extend("clike",{keyword:/\b(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)\b/,number:/\b(?:0[xX][\dA-Fa-f]+|0[bB][01]+|0[oO][0-7]+|NaN|Infinity)\b|(?:\b\d+\.?\d*|\B\.\d+)(?:[Ee][+-]?\d+)?/,function:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*\()/i,operator:/-[-=]?|\+[+=]?|!=?=?|<<?=?|>>?>?=?|=(?:==?|>)?|&[&=]?|\|[|=]?|\*\*?=?|\/=?|~|\^=?|%=?|\?|\.{3}/}),e.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(\[[^\]\r\n]+]|\\.|[^/\\\[\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})]))/,lookbehind:!0,greedy:!0},"function-variable":{pattern:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=\s*(?:function\b|(?:\([^()]*\)|[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/i,alias:"function"},constant:/\b[A-Z][A-Z\d_]*\b/}),e.languages.insertBefore("javascript","string",{"template-string":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,greedy:!0,inside:{interpolation:{pattern:/\$\{[^}]+\}/,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:e.languages.javascript}},string:/[\s\S]+/}}}),e.languages.markup&&e.languages.insertBefore("markup","tag",{script:{pattern:/(<script[\s\S]*?>)[\s\S]*?(?=<\/script>)/i,lookbehind:!0,inside:e.languages.javascript,alias:"language-javascript",greedy:!0}}),e.languages.js=e.languages.javascript}}}]).default}); | ||
!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.ReactSyntax=n():e.ReactSyntax=n()}("undefined"!=typeof self?self:this,function(){return function(e){var n={};function t(a){if(n[a])return n[a].exports;var r=n[a]={i:a,l:!1,exports:{}};return e[a].call(r.exports,r,r.exports,t),r.l=!0,r.exports}return t.m=e,t.c=n,t.d=function(e,n,a){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:a})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s=1)}([function(e,n,t){"use strict";var a,r;t.d(n,"j",function(){return s}),t.d(n,"n",function(){return u}),t.d(n,"h",function(){return o}),n.g=function(e,n){var t=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).component,a=void 0===t?"pre":t;if(!s[n]){if(!n)throw new Error("A language is required!");throw new Error("The language: "+n+" hasn't been loaded yet!")}var r={code:e,grammar:s[n],language:n};return o.run("before-tokenize",r),r.tokens=k(r.code,r.grammar),o.run("after-tokenize",r),(a?"<"+a+" class='reprism "+n+" language-"+n+"'>":"")+c.stringify(f(r.tokens),r.language)+(a?"</"+a+">":"")+"\n "},n.d=f,n.f=g,n.m=p,n.k=function(){for(var e=arguments.length,n=Array(e),t=0;t<e;t++)n[t]=arguments[t];n.forEach(function(e){"Array"===g(e)?e.forEach(function(e){e.init(l)}):e.init(l)})},n.c=d,n.e=y,n.i=h,n.a=b,n.l=m,n.p=k,n.b=v,n.o=x;var i=0,s={extend:y,insertBefore:h,DFS:b},u={},o={all:{},add:v,run:x},c=(r=a=function e(n,t,a,r,i){!function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e),this.type=n,this.content=t,this.alias=a,this.length=0|(r||"").length,this.greedy=!!i},a.stringify=function(e,n,t){if("String"===g(e))return e;if("Array"===g(e))return e.map(function(t){return c.stringify(t,n,e)}).join("");var a={type:e.type,content:c.stringify(e.content,n,t),tag:"span",classes:["token",e.type],attributes:{},language:n,parent:t};if(e.alias){var r=Array.isArray(e.alias)?e.alias:[e.alias];Array.prototype.push.apply(a.classes,r)}o.run("wrap",a);var i=Object.keys(a.attributes).map(function(e){return e+'="'+(a.attributes[e]||"").replace(/"/g,""")+'"'}).join(" ");return"<"+a.tag+' class="'+a.classes.join(" ")+'"'+(i?" "+i:"")+">"+a.content+"</"+a.tag+">"},r),l={languages:s,plugins:u,insertBefore:h,matchGrammar:m,tokenize:k,hooks:o,util:{encode:f,type:g,objId:p,clone:d},Token:c};function f(e){return e instanceof c?new c(e.type,f(e.content),e.alias):"Array"===g(e)?e.map(f):e.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")}function g(e){return Object.prototype.toString.call(e).match(/\[object (\w+)\]/)[1]}function p(e){return e.__id||(i+=1,Object.defineProperty(e,"__id",{value:i})),e.__id}function d(e,n){if(n=n||{},"Array"===g(e)){if(n[p(e)])return n[p(e)];var t=[];return n[p(e)]=t,e.forEach(function(e,a){t[a]=d(e,n)}),t}if("Object"===g(e)){if(n[p(e)])return n[p(e)];var a={};return n[p(e)]=a,Object.keys(e).forEach(function(t){a[t]=d(e[t],n)}),a}return e}function y(e,n){var t=d(s[e]);return Object.keys(n).forEach(function(e){t[e]=n[e]}),t}function h(){for(var e=arguments.length,n=Array(e),t=0;t<e;t++)n[t]=arguments[t];var a=n[0],r=n[1],i=n[2],u=n[3],o=void 0===u?s:u,c=o[a],l=i;if(2===n.length)return l=n[1],Object.keys(l).forEach(function(e){c[e]=l[e]}),c;var f={};return Object.keys(c).forEach(function(e){e===r&&Object.keys(i).forEach(function(e){f[e]=i[e]}),f[e]=c[e]}),b(s,function(e,n){n===o[a]&&e!==a&&(this[e]=f)}),o[a]=f,o[a]}function b(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments[1],t=arguments[2],a=arguments[3];a=a||{},Object.keys(e).forEach(function(r){n.call(e,r,e[r],t||r),"Object"!==g(e[r])||a[p(e[r])]?"Array"!==g(e[r])||a[p(e[r])]||(a[p(e[r])]=!0,b(e[r],n,null,a)):(a[p(e[r])]=!0,b(e[r],n,r,a))})}function m(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=arguments[3],r=arguments[4],i=arguments[5],s=arguments[6];Object.keys(t).forEach(function(u){if(t[u]&&u!==s){var o=t[u];(o=Array.isArray(o)?o:[o]).forEach(function(s){var o=s.inside,l=!!s.lookbehind,f=!!s.greedy,g=0,p=s.alias;if(f&&!s.pattern.global){var d=s.pattern.toString().match(/[imuy]*$/)[0];s.pattern=RegExp(s.pattern.source,d+"g")}s=s.pattern||s;for(var y=a,h=r;y<n.length;h+=n[y].length,y+=1){var b=n[y];if(n.length>e.length)return;if(!(b instanceof c)){var v=0,x=void 0;if(f&&y!==n.length-1){if(s.lastIndex=h,!(x=s.exec(e)))break;for(var F=x.index+(l?x[1].length:0),j=x.index+x[0].length,w=y,A=h,S=n.length;w<S&&(A<j||!n[w].type&&!n[w-1].greedy);++w)F>=(A+=n[w].length)&&(y+=1,h=A);if(n[y]instanceof c)continue;v=w-y,b=e.slice(h,A),x.index-=h}else s.lastIndex=0,x=s.exec(b),v=1;if(x){l&&(g=x[1]?x[1].length:0);var O=x.index+g,E=O+(x=x[0].slice(g)).length,_=b.slice(0,O),$=b.slice(E),B=[y,v];_&&(y+=1,h+=_.length,B.push(_));var z=new c(u,o?k(x,o):x,p,x,f);if(B.push(z),$&&B.push($),Array.prototype.splice.apply(n,B),1!==v&&m(e,n,t,y,h,!0,u),i)break}else if(i)break}}})}})}function k(e,n){var t=[e],a=n.rest;return a&&(Object.keys(a).forEach(function(e){n[e]=a[e]}),delete n.rest),m(e,t,n,0,0,!1),t}function v(e,n){var t=o.all;t[e]=t[e]||[],t[e].push(n)}function x(e,n){var t=o.all[e];t&&t.length&&t.forEach(function(e){return e(n)})}},function(e,n,t){e.exports=t(2)},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var a=t(3),r=t(4),i=t(5),s=t(6),u=t(0);t.d(n,"languages",function(){return u.j}),t.d(n,"plugins",function(){return u.n}),t.d(n,"hooks",function(){return u.h}),t.d(n,"highlight",function(){return u.g}),t.d(n,"encode",function(){return u.d}),t.d(n,"getType",function(){return u.f}),t.d(n,"objId",function(){return u.m}),t.d(n,"loadLanguages",function(){return u.k}),t.d(n,"clone",function(){return u.c}),t.d(n,"extend",function(){return u.e}),t.d(n,"insertBefore",function(){return u.i}),t.d(n,"DFS",function(){return u.a}),t.d(n,"matchGrammar",function(){return u.l}),t.d(n,"tokenize",function(){return u.p}),t.d(n,"addHook",function(){return u.b}),t.d(n,"runHook",function(){return u.o}),Object(u.k)([a.a,r.a,i.a,s.a])},function(e,n,t){"use strict";n.a={language:"markup",init:function(e){e.languages.markup={comment:/<!--[\s\S]*?-->/,prolog:/<\?[\s\S]+?\?>/,doctype:/<!DOCTYPE[\s\S]+?>/i,cdata:/<!\[CDATA\[[\s\S]*?]]>/i,tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/i,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+)/i,inside:{punctuation:[/^=/,{pattern:/(^|[^\\])["']/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/&#?[\da-z]{1,8};/i},e.languages.markup.tag.inside["attr-value"].inside.entity=e.languages.markup.entity,e.hooks.add("wrap",function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))}),e.languages.xml=e.languages.markup,e.languages.html=e.languages.markup,e.languages.mathml=e.languages.markup,e.languages.svg=e.languages.markup}}},function(e,n,t){"use strict";n.a={language:"css",init:function(e){e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-]+?.*?(?:;|(?=\s*\{))/i,inside:{rule:/@[\w-]+/}},url:/url\((?:(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,selector:/[^{}\s][^{};]*?(?=\s*\{)/,string:{pattern:/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},property:/[-_a-z\xA0-\uFFFF][-\w\xA0-\uFFFF]*(?=\s*:)/i,important:/\B!important\b/i,function:/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:]/},e.languages.css.atrule.inside.rest=e.languages.css,e.languages.markup&&(e.languages.insertBefore("markup","tag",{style:{pattern:/(<style[\s\S]*?>)[\s\S]*?(?=<\/style>)/i,lookbehind:!0,inside:e.languages.css,alias:"language-css",greedy:!0}}),e.languages.insertBefore("inside","attr-value",{"style-attr":{pattern:/\s*style=("|')(?:\\[\s\S]|(?!\1)[^\\])*\1/i,inside:{"attr-name":{pattern:/^\s*style/i,inside:e.languages.markup.tag.inside},punctuation:/^\s*=\s*['"]|['"]\s*$/,"attr-value":{pattern:/.+/i,inside:e.languages.css}},alias:"language-css"}},e.languages.markup.tag))}}},function(e,n,t){"use strict";n.a={language:"clike",init:function(e){e.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,boolean:/\b(?:true|false)\b/,function:/[a-z0-9_]+(?=\()/i,number:/\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/}}}},function(e,n,t){"use strict";n.a={language:"javascript",init:function(e){e.languages.javascript=e.languages.extend("clike",{keyword:/\b(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)\b/,number:/\b(?:0[xX][\dA-Fa-f]+|0[bB][01]+|0[oO][0-7]+|NaN|Infinity)\b|(?:\b\d+\.?\d*|\B\.\d+)(?:[Ee][+-]?\d+)?/,function:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*\()/i,operator:/-[-=]?|\+[+=]?|!=?=?|<<?=?|>>?>?=?|=(?:==?|>)?|&[&=]?|\|[|=]?|\*\*?=?|\/=?|~|\^=?|%=?|\?|\.{3}/}),e.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(\[[^\]\r\n]+]|\\.|[^/\\\[\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})]))/,lookbehind:!0,greedy:!0},"function-variable":{pattern:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=\s*(?:function\b|(?:\([^()]*\)|[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/i,alias:"function"},constant:/\b[A-Z][A-Z\d_]*\b/}),e.languages.insertBefore("javascript","string",{"template-string":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,greedy:!0,inside:{interpolation:{pattern:/\$\{[^}]+\}/,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:e.languages.javascript}},string:/[\s\S]+/}}}),e.languages.markup&&e.languages.insertBefore("markup","tag",{script:{pattern:/(<script[\s\S]*?>)[\s\S]*?(?=<\/script>)/i,lookbehind:!0,inside:e.languages.javascript,alias:"language-javascript",greedy:!0}}),e.languages.js=e.languages.javascript}}}]).default}); | ||
//# sourceMappingURL=reprism.min.js.map |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
887500
17789
190