wikiparser-node 1.5.4-b → 1.5.5-b
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/bundle.min.js +1 -1
- package/extensions/dist/base.js +1 -1
- package/package.json +1 -1
package/bundle/bundle.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(()=>{var yt=Object.defineProperty;var Xi=Object.getOwnPropertyDescriptor;var Ki=Object.getOwnPropertyNames;var Ji=Object.prototype.hasOwnProperty;var Yi=(d,i,e)=>i in d?yt(d,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):d[i]=e;var k=(d,i)=>()=>(d&&(i=d(d=0)),i);var es=(d,i)=>()=>(i||d((i={exports:{}}).exports,i),i.exports),U=(d,i)=>{for(var e in i)yt(d,e,{get:i[e],enumerable:!0})},ts=(d,i,e,t)=>{if(i&&typeof i=="object"||typeof i=="function")for(let r of Ki(i))!Ji.call(d,r)&&r!==e&&yt(d,r,{get:()=>i[r],enumerable:!(t=Xi(i,r))||t.enumerable});return d};var _=d=>ts(yt({},"__esModule",{value:!0}),d);var f=(d,i,e)=>(Yi(d,typeof i!="symbol"?i+"":i,e),e),kr=(d,i,e)=>{if(!i.has(d))throw TypeError("Cannot "+e)};var h=(d,i,e)=>(kr(d,i,"read from private field"),e?e.call(d):i.get(d)),y=(d,i,e)=>{if(i.has(d))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(d):i.set(d,e)},C=(d,i,e,t)=>(kr(d,i,"write to private field"),t?t.call(d,e):i.set(d,e),e);var vt=(d,i,e,t)=>({set _(r){C(d,i,r,e)},get _(){return h(d,i,t)}}),L=(d,i,e)=>(kr(d,i,"access private method"),e);var an,ln=k(()=>{"use strict";an=["bold-header","format-leakage","fostered-content","h1","illegal-attr","insecure-style","invalid-gallery","invalid-imagemap","invalid-invoke","lonely-apos","lonely-bracket","lonely-http","nested-link","no-arg","no-duplicate","no-ignored","obsolete-attr","obsolete-tag","parsing-order","pipe-like","table-layout","tag-like","unbalanced-header","unclosed-comment","unclosed-quote","unclosed-table","unescaped","unknown-page","unmatched-tag","unterminated-url","url-encoding","var-anchor","void-ext"]});var Ie,Fe,yr,Le=k(()=>{"use strict";Ie={running:!1,run(d){return d()}},Fe=d=>i=>i.type===d,yr=(d,i,e,t=[])=>{let r=[...d.childNodes],n=r.splice(i,e,...t);d.setAttribute("childNodes",r);for(let s of t)s.setAttribute("parentNode",d);return n}});var dn=es((qs,rs)=>{rs.exports={ext:[],html:[["b","bdi","del","i","ins","u","font","big","small","sub","sup","h1","h2","h3","h4","h5","h6","cite","code","em","s","strike","strong","tt","var","div","center","blockquote","ol","ul","dl","table","caption","pre","ruby","rb","rp","rt","rtc","p","span","abbr","dfn","kbd","samp","data","time","mark","tr","td","th","q","bdo"],["li","dt","dd"],["br","wbr","hr","meta","link"]],namespaces:{},nsid:{file:6,category:14},parserFunction:[{"#language":"language","#special":"special","#speciale":"speciale","#tag":"tag","#formatdate":"formatdate","#dateformat":"formatdate","#invoke":"invoke","#while":"while","#dowhile":"dowhile","#loop":"loop","#forargs":"forargs","#fornumargs":"fornumargs","#if":"if","#ifeq":"ifeq","#switch":"switch","#ifexist":"ifexist","#ifexpr":"ifexpr","#iferror":"iferror","#time":"time","#timel":"timel","#expr":"expr","#rel2abs":"rel2abs","#titleparts":"titleparts","#categorytree":"categorytree","#urldecode":"urldecode","#choose":"choose","#var":"var","#varexists":"varexists","#var_final":"var_final","#vardefine":"vardefine","#vardefineecho":"vardefineecho","#widget":"widget","#regex":"regex","#related":"related","#cscore":"cscore"},["!","="],["msg","raw"],["subst","safesubst"]],doubleUnderscore:[[],[]],protocol:"bitcoin:|ftp://|ftps://|geo:|git://|gopher://|http://|https://|irc://|ircs://|magnet:|mailto:|matrix:|mms://|news:|nntp://|redis://|sftp://|sip:|sips:|sms:|ssh://|svn://|tel:|telnet://|urn:|worldwind://|xmpp:",interwiki:[],img:{},variants:[]}});var gn,ue=k(()=>{"use strict";gn=dn()});var pn,ve,Ae,dt,un,re,cn,ce,At,hn,fe,D=k(()=>{"use strict";pn='[^[\\]<>"\0-\x7F\\p{Zs}\uFFFD]',ve=`(?:\\[[\\da-f:.]+\\]|${pn})`,Ae=`(?:${pn}|\0\\d+[c!~]\x7F)*`,dt=(d,i)=>e=>e.replace(d,i),un=dt(/[\0\x7F]/gu,""),re=dt(/\0\d+c\x7F/gu,""),cn=dt(/[\\{}()|.?*+^$[\]]/gu,"\\$&"),ce=(d,i="")=>d.map(e=>typeof e=="string"?e:e.text()).join(i),At=dt(/&#(\d+|x[\da-f]+);/giu,(d,i)=>String.fromCodePoint(+`${i.toLowerCase().startsWith("x")?"0":""}${i}`)),hn=dt(/\n/gu,"\\n"),fe=(d,i={})=>{let{pre:e="",post:t="",sep:r=""}=i;return`${e}${d.map(n=>n.print()).join(r)}${t}`}});var mn={};U(mn,{Title:()=>vr});var gt,vr,fn=k(()=>{"use strict";D();S();vr=class{constructor(i,e=0,t=m.getConfig(),r=!1,n=!1){f(this,"valid");f(this,"ns");f(this,"fragment");f(this,"encoded",!1);y(this,gt,void 0);if(i=At(i),r&&i.includes("%"))try{let g=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(i);i=decodeURIComponent(i),this.encoded=g}catch(g){}i=i.replace(/_/gu," ").trim();let s=e;i.startsWith(":")&&(s=0,i=i.slice(1).trim());let a=i.split(":");if(a.length>1){let g=t.nsid[a[0].trim().toLowerCase()];g&&(s=g,i=a.slice(1).join(":").trim())}this.ns=s;let o=i.indexOf("#");if(o!==-1){let g=i.slice(o+1).trimEnd();if(g.includes("%"))try{g=decodeURIComponent(g)}catch(p){}else if(g.includes("."))try{g=decodeURIComponent(g.replace(/\./gu,"%"))}catch(p){}this.fragment=g,i=i.slice(0,o).trim()}this.valid=!!(i||this.interwiki||n&&this.fragment!==void 0)&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|]|%[\da-f]{2}/iu.test(i),this.main=i}get main(){return h(this,gt)}set main(i){i=i.replace(/_/gu," ").trim(),C(this,gt,i&&`${i[0].toUpperCase()}${i.slice(1)}`)}get extension(){let{main:i}=this,e=i.lastIndexOf(".");return e===-1?void 0:i.slice(e+1).toLowerCase()}};gt=new WeakMap});var pt,ut,Ar,ze,Sr=k(()=>{"use strict";ze=class{constructor(){y(this,ut);f(this,"childNodes",[]);y(this,pt,void 0)}get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes[this.childNodes.length-1]}get parentNode(){return h(this,pt)}get nextSibling(){var e;let i=(e=this.parentNode)==null?void 0:e.childNodes;return i&&i[i.indexOf(this)+1]}get previousSibling(){var e;let i=(e=this.parentNode)==null?void 0:e.childNodes;return i&&i[i.indexOf(this)-1]}get offsetHeight(){return L(this,ut,Ar).call(this).height}get offsetWidth(){return L(this,ut,Ar).call(this).width}getAttribute(i){return i==="padding"?0:
|
|
1
|
+
"use strict";(()=>{var yt=Object.defineProperty;var Xi=Object.getOwnPropertyDescriptor;var Ki=Object.getOwnPropertyNames;var Ji=Object.prototype.hasOwnProperty;var Yi=(d,i,e)=>i in d?yt(d,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):d[i]=e;var k=(d,i)=>()=>(d&&(i=d(d=0)),i);var es=(d,i)=>()=>(i||d((i={exports:{}}).exports,i),i.exports),U=(d,i)=>{for(var e in i)yt(d,e,{get:i[e],enumerable:!0})},ts=(d,i,e,t)=>{if(i&&typeof i=="object"||typeof i=="function")for(let r of Ki(i))!Ji.call(d,r)&&r!==e&&yt(d,r,{get:()=>i[r],enumerable:!(t=Xi(i,r))||t.enumerable});return d};var _=d=>ts(yt({},"__esModule",{value:!0}),d);var f=(d,i,e)=>(Yi(d,typeof i!="symbol"?i+"":i,e),e),kr=(d,i,e)=>{if(!i.has(d))throw TypeError("Cannot "+e)};var h=(d,i,e)=>(kr(d,i,"read from private field"),e?e.call(d):i.get(d)),y=(d,i,e)=>{if(i.has(d))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(d):i.set(d,e)},C=(d,i,e,t)=>(kr(d,i,"write to private field"),t?t.call(d,e):i.set(d,e),e);var vt=(d,i,e,t)=>({set _(r){C(d,i,r,e)},get _(){return h(d,i,t)}}),L=(d,i,e)=>(kr(d,i,"access private method"),e);var an,ln=k(()=>{"use strict";an=["bold-header","format-leakage","fostered-content","h1","illegal-attr","insecure-style","invalid-gallery","invalid-imagemap","invalid-invoke","lonely-apos","lonely-bracket","lonely-http","nested-link","no-arg","no-duplicate","no-ignored","obsolete-attr","obsolete-tag","parsing-order","pipe-like","table-layout","tag-like","unbalanced-header","unclosed-comment","unclosed-quote","unclosed-table","unescaped","unknown-page","unmatched-tag","unterminated-url","url-encoding","var-anchor","void-ext"]});var Ie,Fe,yr,Le=k(()=>{"use strict";Ie={running:!1,run(d){return d()}},Fe=d=>i=>i.type===d,yr=(d,i,e,t=[])=>{let r=[...d.childNodes],n=r.splice(i,e,...t);d.setAttribute("childNodes",r);for(let s of t)s.setAttribute("parentNode",d);return n}});var dn=es((qs,rs)=>{rs.exports={ext:[],html:[["b","bdi","del","i","ins","u","font","big","small","sub","sup","h1","h2","h3","h4","h5","h6","cite","code","em","s","strike","strong","tt","var","div","center","blockquote","ol","ul","dl","table","caption","pre","ruby","rb","rp","rt","rtc","p","span","abbr","dfn","kbd","samp","data","time","mark","tr","td","th","q","bdo"],["li","dt","dd"],["br","wbr","hr","meta","link"]],namespaces:{},nsid:{file:6,category:14},parserFunction:[{"#language":"language","#special":"special","#speciale":"speciale","#tag":"tag","#formatdate":"formatdate","#dateformat":"formatdate","#invoke":"invoke","#while":"while","#dowhile":"dowhile","#loop":"loop","#forargs":"forargs","#fornumargs":"fornumargs","#if":"if","#ifeq":"ifeq","#switch":"switch","#ifexist":"ifexist","#ifexpr":"ifexpr","#iferror":"iferror","#time":"time","#timel":"timel","#expr":"expr","#rel2abs":"rel2abs","#titleparts":"titleparts","#categorytree":"categorytree","#urldecode":"urldecode","#choose":"choose","#var":"var","#varexists":"varexists","#var_final":"var_final","#vardefine":"vardefine","#vardefineecho":"vardefineecho","#widget":"widget","#regex":"regex","#related":"related","#cscore":"cscore"},["!","="],["msg","raw"],["subst","safesubst"]],doubleUnderscore:[[],[]],protocol:"bitcoin:|ftp://|ftps://|geo:|git://|gopher://|http://|https://|irc://|ircs://|magnet:|mailto:|matrix:|mms://|news:|nntp://|redis://|sftp://|sip:|sips:|sms:|ssh://|svn://|tel:|telnet://|urn:|worldwind://|xmpp:",interwiki:[],img:{},variants:[]}});var gn,ue=k(()=>{"use strict";gn=dn()});var pn,ve,Ae,dt,un,re,cn,ce,At,hn,fe,D=k(()=>{"use strict";pn='[^[\\]<>"\0-\x7F\\p{Zs}\uFFFD]',ve=`(?:\\[[\\da-f:.]+\\]|${pn})`,Ae=`(?:${pn}|\0\\d+[c!~]\x7F)*`,dt=(d,i)=>e=>e.replace(d,i),un=dt(/[\0\x7F]/gu,""),re=dt(/\0\d+c\x7F/gu,""),cn=dt(/[\\{}()|.?*+^$[\]]/gu,"\\$&"),ce=(d,i="")=>d.map(e=>typeof e=="string"?e:e.text()).join(i),At=dt(/&#(\d+|x[\da-f]+);/giu,(d,i)=>String.fromCodePoint(+`${i.toLowerCase().startsWith("x")?"0":""}${i}`)),hn=dt(/\n/gu,"\\n"),fe=(d,i={})=>{let{pre:e="",post:t="",sep:r=""}=i;return`${e}${d.map(n=>n.print()).join(r)}${t}`}});var mn={};U(mn,{Title:()=>vr});var gt,vr,fn=k(()=>{"use strict";D();S();vr=class{constructor(i,e=0,t=m.getConfig(),r=!1,n=!1){f(this,"valid");f(this,"ns");f(this,"fragment");f(this,"encoded",!1);y(this,gt,void 0);if(i=At(i),r&&i.includes("%"))try{let g=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(i);i=decodeURIComponent(i),this.encoded=g}catch(g){}i=i.replace(/_/gu," ").trim();let s=e;i.startsWith(":")&&(s=0,i=i.slice(1).trim());let a=i.split(":");if(a.length>1){let g=t.nsid[a[0].trim().toLowerCase()];g&&(s=g,i=a.slice(1).join(":").trim())}this.ns=s;let o=i.indexOf("#");if(o!==-1){let g=i.slice(o+1).trimEnd();if(g.includes("%"))try{g=decodeURIComponent(g)}catch(p){}else if(g.includes("."))try{g=decodeURIComponent(g.replace(/\./gu,"%"))}catch(p){}this.fragment=g,i=i.slice(0,o).trim()}this.valid=!!(i||this.interwiki||n&&this.fragment!==void 0)&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|]|%[\da-f]{2}/iu.test(i),this.main=i}get main(){return h(this,gt)}set main(i){i=i.replace(/_/gu," ").trim(),C(this,gt,i&&`${i[0].toUpperCase()}${i.slice(1)}`)}get extension(){let{main:i}=this,e=i.lastIndexOf(".");return e===-1?void 0:i.slice(e+1).toLowerCase()}};gt=new WeakMap});var pt,ut,Ar,ze,Sr=k(()=>{"use strict";ze=class{constructor(){y(this,ut);f(this,"childNodes",[]);y(this,pt,void 0)}get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes[this.childNodes.length-1]}get parentNode(){return h(this,pt)}get nextSibling(){var e;let i=(e=this.parentNode)==null?void 0:e.childNodes;return i&&i[i.indexOf(this)+1]}get previousSibling(){var e;let i=(e=this.parentNode)==null?void 0:e.childNodes;return i&&i[i.indexOf(this)-1]}get offsetHeight(){return L(this,ut,Ar).call(this).height}get offsetWidth(){return L(this,ut,Ar).call(this).width}getAttribute(i){return i==="padding"?0:this[i]}setAttribute(i,e){i==="parentNode"?C(this,pt,e):this[i]=e}getRootNode(){let{parentNode:i}=this;for(;i!=null&&i.parentNode;)({parentNode:i}=i);return i!=null?i:this}posFromIndex(i){let e=String(this);if(i>=-e.length&&i<=e.length){let t=e.slice(0,i).split(`
|
|
2
2
|
`),r=t.length-1;return{top:r,left:t[r].length}}}getGaps(i){return 0}getRelativeIndex(i){let e,t=(r,n)=>e.slice(0,r).reduce((s,a,o)=>s+String(a).length+n.getGaps(o),0)+n.getAttribute("padding");if(i===void 0){let{parentNode:r}=this;return r?({childNodes:e}=r,t(e.indexOf(this),r)):0}return{childNodes:e}=this,t(i,this)}getAbsoluteIndex(){let{parentNode:i}=this;return i?i.getAbsoluteIndex()+this.getRelativeIndex():0}seal(i,e){Object.defineProperty(this,i,{enumerable:!e&&!!this[i],configurable:!0})}};pt=new WeakMap,ut=new WeakSet,Ar=function(){let i=String(this).split(`
|
|
3
3
|
`),e=i.length;return{height:e,width:i[e-1].length}}});var wt,xn,St,Tn=k(()=>{"use strict";D();Le();Sr();St=class extends ze{constructor(){super(...arguments);y(this,wt)}get length(){return this.childNodes.length}text(e){return ce(this.childNodes,e)}normalize(){let e=[...this.childNodes];for(let t=e.length-1;t>=0;t--){let{type:r,data:n}=e[t];r!=="text"||this.getGaps(t-1)||n===""&&e.splice(t,1)}this.setAttribute("childNodes",e)}removeAt(e){return yr(this,e,1)[0]}insertAt(e,t=this.length){return yr(this,t,0,[e]),e}closest(e){let t=L(this,wt,xn).call(this,e),{parentNode:r}=this;for(;r;){if(t(r))return r;({parentNode:r}=r)}}append(...e){for(let t of e)this.insertAt(t)}replaceChildren(...e){for(let t=this.length-1;t>=0;t--)this.removeAt(t);this.append(...e)}setText(e,t=0){t+=t<0?this.length:0;let r=this.childNodes[t],{data:n}=r;return r.replaceData(e),n}toString(e=""){return this.childNodes.map(String).join(e)}lint(e=this.getAbsoluteIndex(),t){let r=[];for(let n=0,s=e+this.getAttribute("padding");n<this.length;n++){let a=this.childNodes[n];r.push(...a.lint(s,t)),s+=String(a).length+this.getGaps(n)}return r}print(e={}){var t;return String(this)?`<span class="wpb-${(t=e.class)!=null?t:this.type}">${fe(this.childNodes,e)}</span>`:""}json(e,t=this.getAbsoluteIndex()){let r={...this,range:[t,t+String(this).length],childNodes:[]};for(let n=0,s=t+this.getAttribute("padding");n<this.length;n++){let a=this.childNodes[n],{length:o}=String(a);a.type==="text"?r.childNodes.push({data:a.data,range:[s,s+o]}):r.childNodes.push(a.json(void 0,s)),s+=o+this.getGaps(n)}return r}};wt=new WeakSet,xn=function(e){let t=new Set(e.split(",").map(r=>r.trim()));return({type:r})=>t.has(r)}});var bn,ns,is,ss,os,as,$t,kn,ct,yn=k(()=>{"use strict";S();Sr();bn="<\\s*(?:\\/\\s*)?([a-z]\\w*)|\\{+|\\}+|\\[{2,}|\\[(?![^[]*?\\])|((?:^|\\])[^[]*?)\\]+",ns=new RegExp(`${bn}|https?[:/]\\/+`,"giu"),is=new RegExp(bn,"giu"),ss={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},os={"<":"tag-like","[":"lonely-bracket","{":"lonely-bracket","]":"lonely-bracket","}":"lonely-bracket",h:"lonely-http"},as=["html","head","style","title","body","a","audio","img","video","embed","iframe","object","canvas","script","col","colgroup","tbody","tfoot","thead","button","input","label","option","select","textarea"],ct=class extends ze{constructor(e){super();y(this,$t);f(this,"type","text");f(this,"data","");Object.defineProperties(this,{childNodes:{enumerable:!1,configurable:!1},type:{enumerable:!1,writable:!1},data:{value:e}})}toString(){return this.data}text(){return this.data}lint(e=this.getAbsoluteIndex(),t){var F,j,J;let{data:r,parentNode:n,nextSibling:s,previousSibling:a}=this;if(!n)return[];let{type:o,name:g,parentNode:p}=n,l=!1;if(o==="attr-value"){let{type:M,name:ae,tag:ke}=p;if(M!=="ext-attr")l=!0;else if(ke==="choose"&&(ae==="before"||ae==="after"))return[]}if(t!=null||(t=o==="free-ext-link"||o==="ext-link-url"||o==="image-parameter"&&g==="link"||l?is:ns),r.search(t)===-1)return[];t.lastIndex=0;let u=[],c=s==null?void 0:s.type,x=s==null?void 0:s.name,T=a==null?void 0:a.type,v=this.getRootNode(),{ext:R,html:$}=v.getAttribute("config"),{top:A,left:I}=v.posFromIndex(e),P=new Set(["onlyinclude","noinclude","includeonly",R,$,as].flat(2));for(let M=t.exec(r);M;M=t.exec(r)){let[,ae,ke]=M,{0:te,index:W}=M;if(ke&&ke!=="]"){let{length:ee}=ke;W+=ee,te=te.slice(ee)}let{0:E,length:le}=te;if(E==="<"&&!P.has(ae.toLowerCase())||E==="["&&o==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(r.slice(W+1))||c==="ext"&&x==="nowiki"&&((F=s.innerText)!=null&&F.includes("]"))))continue;E==="]"&&(W||le>1)&&t.lastIndex--;let ge=e+W,ye=ge+le,K=String(v),pe=K[ye],_e=K[ge-1],xr=le>1&&!(E==="<"&&!/[\s/>]/u.test(pe!=null?pe:"")||l&&(E==="["||E==="]"))||E==="{"&&(pe===E||_e==="-")||E==="}"&&(_e===E||pe==="-")||E==="["&&(pe===E||o==="ext-link-text"||c==="free-ext-link"&&!r.slice(W+1).trim())||E==="]"&&(_e===E||T==="free-ext-link"&&!r.slice(0,W).includes("]"))?"error":"warning",Tr=E==="{"||E==="[";if(xr==="warning"&&(Tr||(E==="]"||E==="}"))){let ee=ss[E],br=Tr?r.slice(W+1):r.slice(0,W);if(E==="{"&&((j=ee.exec(br))==null?void 0:j[0])==="}"||E==="}"&&((J=ee.exec(br))==null?void 0:J[0])==="{")continue;if(!br.includes(E)){let on=Tr?"nextSibling":"previousSibling",Ee=this[on];for(;Ee&&(Ee.type!=="text"||!ee.test(Ee.data));)Ee=Ee[on];if(Ee&&ee.exec(Ee.data)[0]!==E)continue}}let kt=r.slice(0,W).split(`
|
|
4
4
|
`),rn=kt.length+A-1,nn=kt[kt.length-1],sn=kt.length===1?I+nn.length:nn.length,lt={rule:os[E],message:m.msg('lonely "$1"',E==="h"?te:E),severity:xr,startIndex:ge,endIndex:ye,startLine:rn,endLine:rn,startCol:sn,endCol:sn+le};if(E==="<")lt.suggestions=[{desc:"escape",range:[ge,ge+1],text:"<"}];else if(E==="h"&&!(o==="ext-link-text"||o==="link-text")&&/[\p{L}\d_]/u.test(_e||""))lt.suggestions=[{desc:"whitespace",range:[ge,ge],text:" "}];else if(E==="["&&o==="ext-link-text"){let ee=n.getAbsoluteIndex()+String(n).length;lt.suggestions=[{desc:"escape",range:[ee,ee+1],text:"]"}]}else if(E==="]"&&T==="free-ext-link"&&xr==="error"){let ee=e-String(a).length;lt.fix={range:[ee,ee],text:"["}}u.push(lt)}return u}replaceData(e){L(this,$t,kn).call(this,e)}print(){let e={"&":"amp","<":"lt",">":"gt"};return this.data.replace(/[&<>]/gu,t=>`&${e[t]};`)}};$t=new WeakSet,kn=function(e){this.setAttribute("data",e)}});var Ct,vn=k(()=>{"use strict";G();Ct=class extends b{constructor(){super(...arguments);f(this,"type","onlyinclude")}toString(){return`<onlyinclude>${super.toString()}</onlyinclude>`}getAttribute(e){return e==="padding"?13:e==="plain"||super.getAttribute(e)}print(){return super.print({pre:'<span class="wpb-ext"><onlyinclude></span>',post:'<span class="wpb-ext"></onlyinclude></span>'})}}});var he,Me=k(()=>{"use strict";he=d=>{class i extends d{text(){return""}lint(){return[]}}return i}});var Q,Se=k(()=>{"use strict";S();G();Q=class extends b{get innerText(){return this.firstChild.data}constructor(i="",e=m.getConfig(),t=[]){super(i,e,t)}}});var V,Re=k(()=>{"use strict";Me();Se();V=class extends he(Q){constructor(){super(...arguments);f(this,"type","noinclude")}}});var An,w,N,q=k(()=>{"use strict";S();An=d=>(i,e,t,r,n="error")=>{let{start:s}=e,{top:a,left:o}="top"in e?e:i.getRootNode().posFromIndex(s),{offsetHeight:g,offsetWidth:p}=i,{startIndex:l,startLine:u,startCol:c}=d(i,s,a,o);return{rule:t,message:m.msg(r),severity:n,startIndex:l,endIndex:l+String(i).length,startLine:u,endLine:u+g-1,startCol:c,endCol:g===1?c+p:p}},w=An((d,i,e,t)=>{let r=d.getRelativeIndex(),{top:n,left:s}=d.parentNode.posFromIndex(r);return{startIndex:i+r,startLine:e+n,startCol:n?s:t+s}}),N=An((d,i,e,t)=>({startIndex:i,startLine:e,startCol:t}))});var we,We,wr=k(()=>{"use strict";S();G();We=class extends b{constructor(e,t,r,n,s=m.getConfig(),a=[]){super(void 0,s);y(this,we,void 0);f(this,"closed");f(this,"selfClosing");this.setAttribute("name",e.toLowerCase()),C(this,we,[e,n||e]),this.closed=n!=="",this.selfClosing=n===void 0,this.append(t,r);let o=typeof t=="string"?-1:a.indexOf(t);a.splice(o===-1?1/0:o,0,this)}get innerText(){return this.selfClosing?void 0:this.lastChild.text()}toString(){let{selfClosing:e,firstChild:t,lastChild:r}=this,[n,s]=h(this,we);return e?`<${n}${String(t)}/>`:`<${n}${String(t)}>${String(r)}${this.closed?`</${s}>`:""}`}text(){let[e,t]=h(this,we);return this.selfClosing?`<${e}${this.firstChild.text()}/>`:`<${e}${super.text(">")}${this.closed?`</${t}>`:""}`}getAttribute(e){return e==="padding"?h(this,we)[0].length+1:super.getAttribute(e)}getGaps(){return 1}print(){let[e,t]=h(this,we);return super.print(this.selfClosing?{pre:`<${e}`,post:"/>"}:{pre:`<${e}`,sep:">",post:this.closed?`</${t}>`:""})}};we=new WeakMap});var Nt,Sn=k(()=>{"use strict";q();Me();S();wr();Nt=class extends he(We){constructor(e,t="",r,n,s=m.getConfig(),a=[]){super(e,t,r!=null?r:"",r===void 0||n!=null?n:"",s,a);f(this,"type","include")}lint(e=this.getAbsoluteIndex()){if(this.closed)return[];let t=N(this,{start:e},"unclosed-comment",m.msg("unclosed $1",`<${this.name}>`));return t.suggestions=[{desc:"close",range:[t.endIndex,t.endIndex],text:`</${this.name}>`}],[t]}}});var B,xe=k(()=>{"use strict";S();G();B=class extends b{constructor(i,e,t=m.getConfig(),r=[],n){super(i,t,r,n),this.type=e}}});var ls,H,wn,$n,It,$r,Cn,ht,En,In,Fn,Nn,Et,ds,gs,ps,Ue,Z,ne,He,Ln=k(()=>{"use strict";q();D();ue();S();G();xe();ls=new Set(["id","class","style","lang","dir","title","tabindex","aria-describedby","aria-flowto","aria-hidden","aria-label","aria-labelledby","aria-level","aria-owns","role","about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),H=new Set(["align"]),wn=new Set(["cite"]),$n=new Set(["cite","datetime"]),It=new Set(["width"]),$r=new Set(["axis","align","bgcolor","height","width","valign"]),Cn=new Set([...$r,"abbr","headers","scope","rowspan","colspan"]),ht=new Set(["type"]),En=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),In=new Set(["clear"]),Fn=new Set(["bgcolor","align","valign"]),Nn={div:H,h1:H,h2:H,h3:H,h4:H,h5:H,h6:H,blockquote:wn,q:wn,p:H,br:In,pre:It,ins:$n,del:$n,ul:ht,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...En,"border"]),caption:H,tr:Fn,td:Cn,th:Cn,img:new Set(["alt","src","width","height","srcset"]),font:new Set(["size","color","face"]),hr:It,rt:new Set(["rbspan"]),data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:new Set(["mode","showfilename","caption","perrow","widths","heights","showthumbnails","type"]),poem:new Set(["compact","align"]),categorytree:new Set(["align","hideroot","onlyroot","depth","mode","hideprefix","namespaces","showcount","notranslations"]),combooption:new Set(["name","for","inline","align"])},Et=new Set,ds={nowiki:Et,indicator:new Set(["name"]),langconvert:new Set(["from","to"]),ref:new Set(["group","name","extends","follow","dir"]),references:new Set(["group","responsive"]),charinsert:new Set(["label"]),choose:new Set(["uncached","before","after"]),option:new Set(["weight"]),imagemap:Et,inputbox:Et,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:Et,poll:new Set(["id","show-results-before-voting"]),sm2:ht,flashmp3:ht,score:new Set(["line_width_inches","lang","override_midi","raw","note-language","override_audio","override_ogg","sound","vorbis"]),seo:new Set(["title","title_mode","title_separator","keywords","description","robots","google_bot","image","image_width","image_height","image_alt","type","site_name","locale","section","author","published_time","twitter_site"]),tab:new Set(["nested","name","index","class","block","inline","openname","closename","collapsed","dropdown","style","bgcolor","container","id","title"]),tabs:new Set(["plain","class","container","id","title","style"]),combobox:new Set(["placeholder","value","id","class","text","dropdown","style"])},gs=new RegExp("expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\\s*:|(?:url|image(?:-set)?)\\s*\\(|attr\\s*\\([^)]+[\\s,]url","u"),ps={table:En,td:new Set([...$r,"scope"]),th:$r,br:In,caption:H,div:H,hr:It,h1:H,h2:H,h3:H,h4:H,h5:H,h6:H,li:ht,p:H,pre:It,tr:Fn,ul:ht},He=class extends b{constructor(e,t,r,n="",s,a=[],o=m.getConfig(),g=[]){let p=new B(r,"attr-key",o,g,{}),l;if(r==="title"||t==="img"&&r==="alt")l=new b(s,o,g,{}),l.type="attr-value",l.setAttribute("stage",10);else if(t==="gallery"&&r==="caption"){let u={...o,excludes:[...o.excludes,"quote","extLink","magicLink","list"]};l=new b(s,u,g,{}),l.type="attr-value",l.setAttribute("stage",5)}else if(t==="choose"&&(r==="before"||r==="after")){let u={...o,excludes:[...o.excludes,"heading","html","table","hr","list"]};l=new b(s,u,g,{}),l.type="attr-value",l.setAttribute("stage",1)}else l=new B(s,"attr-value",o,g,{});super(void 0,o,g);y(this,Ue,void 0);y(this,Z,void 0);y(this,ne,void 0);this.type=e,this.append(p,l),C(this,Z,n),C(this,ne,[...a]),C(this,Ue,t),this.setAttribute("name",re(r).trim().toLowerCase())}get tag(){return h(this,Ue)}get balanced(){return!h(this,Z)||h(this,ne)[0]===h(this,ne)[1]}afterBuild(){h(this,Z).includes("\0")&&C(this,Z,this.buildFromStr(h(this,Z),0)),this.parentNode&&C(this,Ue,this.parentNode.name),this.setAttribute("name",this.firstChild.text().trim().toLowerCase())}toString(){let[e="",t=""]=h(this,ne);return h(this,Z)?`${super.toString(`${h(this,Z)}${e}`)}${t}`:String(this.firstChild)}text(){return h(this,Z)?`${super.text(`${h(this,Z).trim()}"`)}"`:this.firstChild.text()}getGaps(){var e,t;return h(this,Z)?h(this,Z).length+((t=(e=h(this,ne)[0])==null?void 0:e.length)!=null?t:0):0}lint(e=this.getAbsoluteIndex(),t){var x,T;let r=super.lint(e,t),{balanced:n,firstChild:s,lastChild:a,type:o,name:g,tag:p}=this,l=this.getValue(),u;if(!n){let v=this.getRootNode();u={start:e,...v.posFromIndex(e)};let R=w(a,u,"unclosed-quote",m.msg("unclosed $1","quotes"),"warning");R.startIndex--,R.startCol--;let $={range:[R.endIndex,R.endIndex],text:h(this,ne)[0]};a.childNodes.some(A=>A.type==="text"&&/\s/u.test(A.text()))?R.suggestions=[{desc:"close",...$}]:R.fix=$,r.push(R)}let c=ds[p];if(c&&!c.has(g)||(o==="ext-attr"?p in Nn:!/\{\{[^{]+\}\}/u.test(g))&&!((x=Nn[p])!=null&&x.has(g))&&!/^(?:xmlns:[\w:.-]+|data-[^:]*)$/u.test(g)&&(p==="meta"||p==="link"||!ls.has(g)))u!=null||(u={start:e,...this.getRootNode().posFromIndex(e)}),r.push(w(s,u,"illegal-attr","illegal attribute name"));else if((T=ps[p])!=null&&T.has(g))u!=null||(u={start:e,...this.getRootNode().posFromIndex(e)}),r.push(w(s,u,"obsolete-attr","obsolete attribute","warning"));else if(g==="style"&&typeof l=="string"&&gs.test(l))u!=null||(u={start:e,...this.getRootNode().posFromIndex(e)}),r.push(w(a,u,"insecure-style","insecure style"));else if(g==="tabindex"&&typeof l=="string"&&l.trim()!=="0"){u!=null||(u={start:e,...this.getRootNode().posFromIndex(e)});let v=w(a,u,"illegal-attr","nonzero tabindex");v.suggestions=[{desc:"remove",range:[e,v.endIndex],text:""},{desc:"0 tabindex",range:[v.startIndex,v.endIndex],text:"0"}],r.push(v)}return r}getValue(){if(h(this,Z)){let e=this.lastChild.text();return h(this,ne)[1]?e:e[h(this,ne)[0]?"trimEnd":"trim"]()}return this.type==="ext-attr"||""}print(){let[e="",t=""]=h(this,ne);return h(this,Z)?super.print({sep:`${h(this,Z)}${e}`,post:t}):super.print()}};Ue=new WeakMap,Z=new WeakMap,ne=new WeakMap});var Rn,us,$e,Lt=k(()=>{"use strict";q();D();S();G();xe();Ln();Rn=d=>d.slice(0,-1),us=d=>`${Rn(d)}-dirty`,$e=class extends b{constructor(i,e,t,r=m.getConfig(),n=[]){if(super(void 0,r,n,{}),this.type=e,this.setAttribute("name",t),i){let s=new RegExp(`([^\\s/](?:(?!\0\\d+~\x7F)[^\\s/=])*)(?:((?:\\s|\0\\d+c\x7F)*(?:=|\0\\d+~\x7F)(?:\\s|\0\\d+c\x7F)*)(?:(["'])(.*?)(\\3|$)|(\\S*)))?`,"gsu"),a="",o=s.exec(i),g=0,p=()=>{a&&(super.insertAt(new B(a,us(e),r,n,{})),a="")};for(;o;){let{index:l,0:u,1:c,2:x,3:T,4:v,5:R,6:$}=o;if(a+=i.slice(g,l),/^(?:[\w:]|\0\d+[t!~{}+-]\x7F)(?:[\w:.-]|\0\d+[t!~{}+-]\x7F)*$/u.test(re(c).trim())){let A=v!=null?v:$,I=[T,R],P=new He(Rn(e),t,c,x,A,I,r,n);p(),super.insertAt(P)}else a+=u;({lastIndex:g}=s),o=s.exec(i)}a+=i.slice(g),p()}}afterBuild(){if(this.type==="table-attrs"){let{parentNode:i}=this;this.setAttribute("name",(i==null?void 0:i.type)==="td"&&i.subtype==="caption"?"caption":i==null?void 0:i.type)}}getAttrTokens(i){return this.childNodes.filter(e=>e instanceof He&&(!i||e.name===i.toLowerCase().trim()))}getAttrToken(i){let e=this.getAttrTokens(i);return e[e.length-1]}getAttr(i){var e;return(e=this.getAttrToken(i))==null?void 0:e.getValue()}lint(i=this.getAbsoluteIndex(),e){let t=super.lint(i,e),{parentNode:r,length:n,childNodes:s}=this,a=new Map,o=new Set,g;if((r==null?void 0:r.type)==="html"&&r.closing&&this.text().trim()){g={start:i,...this.getRootNode().posFromIndex(i)};let p=N(this,g,"no-ignored","attributes of a closing tag");p.fix={range:[i,p.endIndex],text:""},t.push(p)}for(let p=0;p<n;p++){let l=s[p];if(l instanceof B&&l.text().trim()){g!=null||(g={start:i,...this.getRootNode().posFromIndex(i)});let u=w(l,g,"no-ignored","containing invalid attribute");u.suggestions=[{desc:"remove",range:[u.startIndex,u.endIndex],text:" "}],t.push(u)}else if(l instanceof He){let{name:u}=l;a.has(u)?(o.add(u),a.get(u).push(l)):u!=="class"&&a.set(u,[l])}}if(o.size>0){g!=null||(g={start:i,...this.getRootNode().posFromIndex(i)});for(let p of o)t.push(...a.get(p).map(l=>w(l,g,"no-duplicate",m.msg("duplicated $1 attribute",p))))}return t}print(){return String(this)?`<span class="wpb-${this.type}">${this.childNodes.map(i=>i.print(i instanceof B?{class:"attr-dirty"}:void 0)).join("")}</span>`:""}}});var Pn={};U(Pn,{PreToken:()=>Cr});var Cr,Gn=k(()=>{"use strict";ue();S();G();Re();Cr=class extends b{constructor(e,t=m.getConfig(),r=[]){if(e){let n="<nowiki>",s="</nowiki>",{length:a}=n,o=e.indexOf(n),g=e.indexOf(s,o+a),p="";for(;o!==-1&&g!==-1;)new V(n,t,r),new V(s,t,r),p+=`${e.slice(0,o)}\0${r.length-1}c\x7F${e.slice(o+a,g)}\0${r.length}c\x7F`,e=e.slice(g+a+1),o=e.indexOf(n),g=e.indexOf(s,o+a);e=`${p}${e}`}super(e,t,r,{});f(this,"type","ext-inner");this.setAttribute("stage",10)}getAttribute(e){return e==="plain"||super.getAttribute(e)}lint(e=this.getAbsoluteIndex()){return super.lint(e,/<\s*\/\s*(pre)\b/giu)}}});var qn={};U(qn,{ParamTagToken:()=>mt});var mt,Nr=k(()=>{"use strict";q();S();G();xe();mt=class extends b{constructor(e,t=m.getConfig(),r=[],n={}){super(void 0,t,r,{});f(this,"type","ext-inner");if(e){let s=B;this.append(...e.split(`
|
package/extensions/dist/base.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
const workerJS = () => {
|
|
3
|
-
importScripts('https://testingcf.jsdelivr.net/npm/wikiparser-node@1.5.
|
|
3
|
+
importScripts('https://testingcf.jsdelivr.net/npm/wikiparser-node@1.5.5-b/bundle/bundle.min.js');
|
|
4
4
|
const entities = { '&': 'amp', '<': 'lt', '>': 'gt' };
|
|
5
5
|
self.onmessage = ({ data }) => {
|
|
6
6
|
const [command, qid, wikitext, include, stage] = data;
|