wikiparser-node 1.13.5 → 1.13.6

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.
@@ -29,7 +29,7 @@ ${d}`;continue}let k=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\
29
29
  ${d}`,l),i.push(l);continue}let[,x,A,S,$]=k;if(x){for(;l.type!=="table";)l=i.pop();l.close(`
30
30
  ${c}${x}`,!0),p($,i[i.length-1])}else if(A){l=g(),l.type==="tr"&&(l=i.pop());let w=new _r(`
31
31
  ${c}${A}`,$,t,n);i.push(l,w),l.insertAt(w)}else{l=g();let w=S==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu,L=w.exec($),B=0,j=`
32
- ${c}${S}`,q=D=>{let H=new it(j,$.slice(B,L==null?void 0:L.index),t,n);return D.insertAt(H),H};for(;L;)q(l),{lastIndex:B}=w,[j]=L,L=w.exec($);i.push(l,q(l))}}return o.slice(1)}});var Or,As=b(()=>{"use strict";_e();Or=class extends re{get type(){return"hr"}}});var ws,Ln,ba,ot,Ss=b(()=>{"use strict";Xe();F();_e();ws=[ue()];ot=class extends(ba=re){get type(){return"double-underscore"}constructor(r,e,t=f.getConfig(),n){super(r,t,n)}getAttribute(r){return r==="padding"?2:super.getAttribute(r)}toString(){return`__${this.innerText}__`}print(){return super.print({pre:"__",post:"__"})}};Ln=le(ba),ot=ge(Ln,0,"DoubleUnderscoreToken",ws,ot),de(Ln,1,ot)});var Cs={};se(Cs,{parseHrAndDoubleUnderscore:()=>Ta});var Ta,$s=b(()=>{"use strict";As();Ss();un();Ta=({firstChild:{data:a},type:r,name:e},t,n)=>{var l;let{doubleUnderscore:i}=t,s=new Set(i[0]),o=new Set(i[1]);return(l=t.regexHrAndDoubleUnderscore)!=null||(t.regexHrAndDoubleUnderscore=new RegExp(`__(${[...s,...o].join("|")})__`,"giu")),r!=="root"&&(r!=="ext-inner"||e!=="poem")&&(a=`\0${a}`),a=a.replace(/^((?:\0\d+[cno]\x7F)*)(-{4,})/gmu,(p,g,d)=>(new Or(d,t,n),`${g}\0${n.length-1}r\x7F`)).replace(t.regexHrAndDoubleUnderscore,(p,g)=>{var m,k;let d=o.has(g),c=g.toLowerCase(),h=s.has(c);return d||h?(new ot(g,d,t,n),`\0${n.length-1}${h&&((k=(m=i[2])==null?void 0:m[c])!=null?k:c)==="toc"?"u":"n"}\x7F`):p}).replace(/^((?:\0\d+[cn]\x7F)*)(={1,6})(.+)\2((?:\s|\0\d+[cn]\x7F)*)$/gmu,(p,g,d,c,h)=>{let m=`${g}\0${n.length}h\x7F`;return new kt(d.length,[c,h],t,n),m}),r==="root"||r==="ext-inner"&&e==="poem"?a:a.slice(1)}});var Mr,Ns=b(()=>{"use strict";_();Q();F();_e();Mr=class extends re{get type(){return"quote"}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}text(){let{parentNode:r,innerText:e}=this;return(r==null?void 0:r.type)==="image-parameter"&&r.name!=="caption"?"":e}lint(r=this.getAbsoluteIndex()){let{previousSibling:e,nextSibling:t,bold:n}=this,i=f.msg('lonely "$1"',"'"),s=[],o=new E(this,r),l,p=(g,d,c)=>({desc:"escape",range:[g,d],text:"&apos;".repeat(c)});if((e==null?void 0:e.type)==="text"&&e.data.endsWith("'")){l=N(this,o,"lonely-apos",i);let{startIndex:g,startLine:d,startCol:c}=l,[,{length:h}]=/(?:^|[^'])('+)$/u.exec(e.data),m=r-h;s.push({...l,startIndex:m,endIndex:g,startCol:c-h,endLine:d,endCol:c,suggestions:[p(m,g,h)]})}if((t==null?void 0:t.type)==="text"&&t.data.startsWith("'")){l!=null||(l=N(this,o,"lonely-apos",i));let{endIndex:g,endLine:d,endCol:c}=l,[{length:h}]=/^'+/u.exec(t.data),m=g+h;s.push({...l,startIndex:g,endIndex:m,startLine:d,startCol:c,endCol:c+h,suggestions:[p(g,m,h)]})}return n&&this.closest("heading-title")&&s.push(N(this,o,"bold-header","bold in section header","warning")),s}json(){let r=super.json();return Object.assign(r,{bold:this.bold,italic:this.italic}),r}}});var Es={};se(Es,{parseQuotes:()=>In});var In,Fn=b(()=>{"use strict";Ns();In=(a,r,e)=>{var g;let t=a.split(/('{2,})/u),{length:n}=t;if(n===1)return a;let i=0,s=0,o,l,p;for(let d=1;d<n;d+=2){let c=t[d].length;switch(c){case 2:s++;break;case 4:t[d-1]+="'",t[d]="'''";case 3:if(i++,o!==void 0)break;t[d-1].endsWith(" ")?l===void 0&&p===void 0&&(p=d):t[d-1].slice(-2,-1)===" "?o=d:l!=null||(l=d);break;default:t[d-1]+="'".repeat(c-5),t[d]="'''''",s++,i++}}if(s%2===1&&i%2===1){let d=(g=o!=null?o:l)!=null?g:p;d!==void 0&&(t[d]="''",t[d-1]+="'")}for(let d=1;d<n;d+=2)new Mr(t[d],r,e),t[d]=`\0${e.length-1}q\x7F`;return t.join("")}});var Ls={};se(Ls,{parseExternalLinks:()=>Rn});var Rn,Pn=b(()=>{"use strict";J();Tn();Ir();Rn=(a,r,e,t)=>{var n;return(n=r.regexExternalLinks)!=null||(r.regexExternalLinks=new RegExp(String.raw`\[(\0\d+f\x7F|(?:(?:${r.protocol}|//)${Ae}|\0\d+m\x7F)${we}(?=[[\]<>"\t\p{Zs}]|\0\d))(\p{Zs}*(?!\p{Zs}))([^\]\x01-\x08\x0A-\x1F\uFFFD]*)\]`,"giu")),a.replace(r.regexExternalLinks,(i,s,o,l)=>{let{length:p}=e,g=/&[lg]t;/u.exec(s);return g&&(s=s.slice(0,g.index),o="",l=s.slice(g.index)+o+l),t?(new Le(s,"ext-link-url",r,e),`[\0${p}f\x7F${o}${l}]`):(new Ct(s,o,l,r,e),`\0${p}w\x7F`)})}});var Gr,Is=b(()=>{"use strict";Ht();Gr=class extends Ce{get type(){return"category"}}});var Rs={};se(Rs,{parseLinks:()=>Fs});var ya,Fs,Ps=b(()=>{"use strict";F();Fn();Pn();bn();fn();Is();ya=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)(.*)$/su,Fs=(a,r,e)=>{var s;(s=r.regexLinks)!=null||(r.regexLinks=new RegExp(String.raw`^\s*(?:${r.protocol}|//)`,"iu"));let t=r.inExt?/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)(.*?[^\]]))?\]\](.*)$/su:/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)(.*?[^\]])?)?\]\](.*)$/su,n=a.split("[["),i=n.shift();for(let o=0;o<n.length;o++){let l=!1,p,g,d,c,h=n[o],m=t.exec(h);if(m)[,p,g,d,c]=m,c.startsWith("]")&&(d!=null&&d.includes("["))&&(d+="]",c=c.slice(1));else{let L=ya.exec(h);L&&(l=!0,[,p,g,d]=L)}if(p===void 0||r.regexLinks.test(p)||/\0\d+[exhbru]\x7F/u.test(p)){i+=`[[${h}`;continue}let k=p.trim().startsWith(":");if(k&&l){i+=`[[${h}`;continue}let x=f.normalizeTitle(p,0,!1,r,!0,!0,!0),{ns:A,valid:S,interwiki:$}=x;if(S){if(l){if($||A!==6){i+=`[[${h}`;continue}let L=!1;for(o++;o<n.length;o++){let B=n[o],j=B.split("]]");if(j.length>2){L=!0,d+=`[[${j[0]}]]${j[1]}`,c=j.slice(2).join("]]");break}else if(j.length===2)d+=`[[${j[0]}]]${j[1]}`;else{d+=`[[${B}`;break}}if(d=Fs(d,r,e),!L){i+=`[[${p}${g}${d}`;continue}}}else{i+=`[[${h}`;continue}d&&(d=In(d,r,e));let w=St;k||(!$&&A===6?(d&&(d=Rn(d,r,e,!0)),w=At):!$&&A===14&&(w=Gr)),d===void 0&&g&&(d=""),i+=`\0${e.length}l\x7F${c}`,new w(p,d,r,e,g)}return i}});var _s={};se(_s,{parseMagicLinks:()=>va});var qs,Bs,js,ka,va,Os=b(()=>{"use strict";J();Ir();qs=String.raw`[\p{Zs}\t]|&nbsp;|&#0*160;|&#x0*a0;`,Bs=`(?:${qs})+`,js=`(?:${qs}|-)`,ka=String.raw`(?:RFC|PMID)${Bs}\d+\b|ISBN${Bs}(?:97[89]${js}?)?(?:\d${js}?){9}[\dx]\b`,va=(a,r,e)=>{var t;return(t=r.regexMagicLinks)!=null||(r.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\d_])(?:(?:${r.protocol})(${Ae}${we})|${ka})`,"giu")),a.replace(r.regexMagicLinks,(n,i,s)=>{let o=i?n.slice(i.length):n;if(s){let l="",p=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(o);p&&(l=o.slice(p.index),o=o.slice(0,p.index));let g=o.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,d=g.exec(o);if(d){let c=1;d[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(o.slice(0,d.index))&&(c=2),l=o.slice(d.index+c)+l,o=o.slice(0,d.index+c)}return l.length>=s.length?n:(new Le(o,void 0,r,e),`${i}\0${e.length-1}w\x7F${l}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(o))return n;return new Le(o,"magic-link",r,e),`${i}\0${e.length-1}i\x7F`})}});var Ms,Gs=b(()=>{"use strict";Ms=(a,r)=>a.startsWith(r)?r.length:[...r].findIndex((e,t)=>e!==a[t])});var zr,zs=b(()=>{"use strict";Nn();zr=class extends Ft{get type(){return"list"}}});var Ws={};se(Ws,{parseList:()=>Aa});var Aa,Us=b(()=>{"use strict";Gs();zs();En();Aa=(a,r,e,t)=>{let n=/^((?:\0\d+[cno]\x7F)*)([;:*#]+\s*)/u.exec(a);if(!n)return r.lastPrefix="",a;let[i,s,o]=n,l=o.replace(/;/gu,":"),p=Ms(l,r.lastPrefix),g=(p>1?o.slice(p-1):o).split(/(?=;)/u),d=g[0].startsWith(";"),c=g.length-(d?0:1);if(p>1){let q=o.slice(0,p-1);d?g.unshift(q):g[0]=q+g[0]}r.lastPrefix=l;let h=s+g.map((q,D)=>`\0${t.length+D}d\x7F`).join("")+a.slice(i.length);for(let q of g)new zr(q,e,t);if(!c)return h;let{html:[m]}=e,k=/:+|-\{|\0\d+[xq]\x7F/gu,x=k,A=x.exec(h),S=0,$=!1,w=!1,L=0,B=(q,D)=>(new Rt(q,e,t),`${h.slice(0,D)}\0${t.length-1}d\x7F${h.slice(D+q.length)}`),j=q=>{q?S&&S--:S++};for(;A&&c;){let{0:q,index:D}=A;if(q==="-{"){if(!L){let{lastIndex:H}=x;x=/-\{|\}-/gu,x.lastIndex=H}L++}else if(q==="}-"){if(L--,!L){let{lastIndex:H}=x;x=k,x.lastIndex=H}}else if(q.endsWith("x\x7F")){let{name:H,closing:ne,selfClosing:ee}=t[Number(q.slice(1,-2))];(!ee||m.includes(H))&&j(ne)}else if(q.endsWith("q\x7F")){let{bold:H,italic:ne}=t[Number(q.slice(1,-2))];H&&(j($),$=!$),ne&&(j(w),w=!w)}else if(S===0){if(q.length>=c)return B(q.slice(0,c),D);c-=q.length,x.lastIndex=D+4+String(t.length).length,h=B(q,D)}A=x.exec(h)}return h}});var Ds,Fe,Wr,Hs=b(()=>{"use strict";_();Q();F();P();Ee();Ds=new Set(["A","T","R","D","-","H","N"]),Wr=class extends y{constructor(e,t=f.getConfig(),n=[]){super(void 0,t,n,{});T(this,Fe);this.append(...e.map(i=>new G(i,"converter-flag",t,n)))}get type(){return"converter-flags"}afterBuild(){v(this,Fe,this.childNodes.map(e=>e.text().trim())),super.afterBuild()}toString(e){return super.toString(e,";")}text(){return super.text(";")}getGaps(){return 1}getUnknownFlags(){return new Set(u(this,Fe).filter(e=>/\{{3}[^{}]+\}{3}/u.test(e)))}getVariantFlags(){let e=new Set(this.getAttribute("config").variants);return new Set(u(this,Fe).filter(t=>e.has(t)))}lint(e=this.getAbsoluteIndex(),t){let n=this.getVariantFlags(),i=this.getUnknownFlags(),s=new Set(u(this,Fe).filter(d=>Ds.has(d))),o=u(this,Fe).filter(d=>!d).length,l=u(this,Fe).length-i.size-o,p=super.lint(e,t);if(n.size===l||s.size===l)return p;let g=new E(this,e);for(let[d,c]of this.childNodes.entries()){let h=c.text().trim();if(h&&!n.has(h)&&!i.has(h)&&(n.size>0||!s.has(h))){let m=C(c,g,"no-ignored","invalid conversion flag");n.size===0&&Ds.has(h.toUpperCase())?m.fix={range:[m.startIndex,m.endIndex],text:h.toUpperCase()}:m.suggestions=[{desc:"remove",range:[m.startIndex-(d&&1),m.endIndex],text:""}],p.push(m)}}return p}print(){return super.print({sep:";"})}};Fe=new WeakMap});var Pt,Vs=b(()=>{"use strict";F();P();Ee();Pt=class extends y{get type(){return"converter-rule"}constructor(r,e=!0,t=f.getConfig(),n=[]){super(void 0,t,n);let i=r.indexOf(":"),s=r.slice(0,i).indexOf("=>"),o=s===-1?r.slice(0,i):r.slice(s+2,i);e&&t.variants.includes(o.trim())?(super.insertAt(new G(o,"converter-rule-variant",t,n)),super.insertAt(new G(r.slice(i+1),"converter-rule-to",t,n)),s!==-1&&super.insertAt(new G(r.slice(0,s),"converter-rule-from",t,n),0)):super.insertAt(new G(r,"converter-rule-to",t,n))}toString(r){let{childNodes:e,firstChild:t,lastChild:n}=this;return e.length===3?`${t.toString(r)}=>${e[1].toString(r)}:${n.toString(r)}`:super.toString(r,":")}text(){let{childNodes:r,firstChild:e,lastChild:t}=this;return r.length===3?`${e.text()}=>${r[1].text()}:${t.text()}`:super.text(":")}getGaps(r){return r===0&&this.length===3?2:1}print(){let{childNodes:r}=this;if(r.length===3){let[e,t,n]=r;return`<span class="wpb-converter-rule">${e.print()}=>${t.print()}:${n.print()}</span>`}return super.print({sep:":"})}}});var Ur,Xs=b(()=>{"use strict";J();F();P();Hs();Vs();Ur=class extends y{get type(){return"converter"}constructor(r,e,t=f.getConfig(),n=[]){super(void 0,t,n),this.append(new Wr(r,t,n));let[i]=e,s=i.includes(":"),o=new Pt(i,s,t,n);s&&o.length===1||!s&&e.length===2&&!te(e[1]).trim()?this.insertAt(new Pt(e.join(";"),!1,t,n)):this.append(o,...e.slice(1).map(l=>new Pt(l,!0,t,n)))}toString(r){let{childNodes:[e,...t]}=this;return`-{${e.toString(r)}${e.length>0?"|":""}${t.map(n=>n.toString(r)).join(";")}}-`}text(){let{childNodes:[r,...e]}=this;return`-{${r.text()}|${pe(e,";")}}-`}getAttribute(r){return r==="padding"?2:super.getAttribute(r)}getGaps(r){return r||this.firstChild.length>0?1:0}print(){let{childNodes:[r,...e]}=this;return`<span class="wpb-converter">-{${r.print()}${r.length>0?"|":""}${Ne(e,{sep:";"})}}-</span>`}}});var Qs={};se(Qs,{parseConverter:()=>wa});var wa,Zs=b(()=>{"use strict";Xs();wa=(a,r,e)=>{var l;(l=r.regexConverter)!=null||(r.regexConverter=new RegExp(String.raw`;(?=(?:[^;]*?=>)?\s*(?:${r.variants.join("|")})\s*:|(?:\s|\0\d+[cn]\x7F)*$)`,"u"));let t=/-\{/gu,n=/-\{|\}-/gu,i=[],s=t,o=s.exec(a);for(;o;){let{0:p,index:g}=o;if(p==="}-"){let d=i.pop(),{length:c}=e,h=a.slice(d.index+2,g),m=h.indexOf("|"),[k,x]=m===-1?[[],h]:[h.slice(0,m).split(";"),h.slice(m+1)],A=x.replace(/(&[#a-z\d]+);/giu,"$1"),S=A.split(r.regexConverter).map($=>$.replace(/\x01/gu,";"));new Ur(k,S,r,e),a=`${a.slice(0,d.index)}\0${c}v\x7F${a.slice(g+2)}`,i.length===0&&(s=t),s.lastIndex=d.index+3+String(c).length}else i.push(o),s=n,s.lastIndex=g+2;o=s.exec(a)}return a}});var Dr={};se(Dr,{Token:()=>y});var ir,fe,O,z,at,Bt,sr,M,Js,Ks,Ys,eo,to,ro,no,io,so,oo,ao,lo,Bn,y,P=b(()=>{"use strict";J();Se();be();_();F();hi();xi();Bn=class Bn extends ur{constructor(e,t=f.getConfig(),n=[],i){super();T(this,M);T(this,ir,"plain");T(this,fe,0);T(this,O);T(this,z);T(this,at);T(this,Bt,!1);T(this,sr);typeof e=="string"&&this.insertAt(e),v(this,O,t),v(this,z,n),n.push(this)}get type(){return u(this,ir)}set type(e){v(this,ir,e)}parseOnce(e=u(this,fe),t=!1){if(e<u(this,fe)||this.length===0||!this.getAttribute("plain"))return this;if(u(this,fe)>=11)return this;switch(e){case 0:if(this.type==="root"){u(this,z).pop();let n=R(this,M,Js).call(this);t&&(t=!n)}v(this,at,t),R(this,M,Ks).call(this,t);break;case 1:R(this,M,Ys).call(this);break;case 2:R(this,M,eo).call(this);break;case 3:R(this,M,to).call(this);break;case 4:R(this,M,ro).call(this);break;case 5:R(this,M,no).call(this);break;case 6:R(this,M,io).call(this);break;case 7:R(this,M,so).call(this);break;case 8:R(this,M,oo).call(this);break;case 9:R(this,M,ao).call(this);break;case 10:R(this,M,lo).call(this)}if(this.type==="root")for(let n of u(this,z))n==null||n.parseOnce(e,t);return dr(this,fe)._++,this}buildFromStr(e,t){let n=e.split(/[\0\x7F]/u).map((i,s)=>{if(s%2===0)return new Wt(i);if(isNaN(i.slice(-1)))return u(this,z)[Number(i.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${i}`)});return t===0?n.map(String).join(""):t===1?pe(n):n}build(){v(this,fe,11);let{length:e,firstChild:t}=this,n=t==null?void 0:t.toString();if(e===1&&t.type==="text"&&n.includes("\0")&&(this.replaceChildren(...this.buildFromStr(n)),this.normalize(),this.type==="root"))for(let i of u(this,z))i==null||i.build()}afterBuild(){if(this.type==="root")for(let e of u(this,z))e==null||e.afterBuild();v(this,Bt,!0)}parse(e=11,t){for(e=Math.min(e,11);u(this,fe)<e;)this.parseOnce(u(this,fe),t);return e&&(this.build(),this.afterBuild()),this}getAttribute(e){var t;switch(e){case"plain":return this.constructor===Bn;case"config":return u(this,O);case"include":return(t=u(this,at))!=null?t:!!u(this.getRootNode(),at);case"accum":return u(this,z);case"built":return u(this,Bt);default:return super.getAttribute(e)}}setAttribute(e,t){switch(e){case"stage":u(this,fe)===0&&this.type==="root"&&u(this,z).shift(),v(this,fe,t);break;default:super.setAttribute(e,t)}}insertAt(e,t=this.length){let n=typeof e=="string"?new Wt(e):e;return super.insertAt(n,t),n.type==="root"&&(n.type="plain"),n}normalizeTitle(e,t=0,n,i,s){return f.normalizeTitle(e,t,u(this,at),u(this,O),n,i,s)}lint(e=this.getAbsoluteIndex(),t){var i;let n=super.lint(e,t);if(this.type==="root"){let s={},o="category,html-attr#id,ext-attr#id,table-attr#id";for(let m of this.querySelectorAll(o)){let k;if(m.type==="category")k=m.name;else{let A=m.getValue();k=`#${A===!0?"":A}`}let x=s[k];x?x.add(m):s[k]=new Set([m])}for(let[m,k]of Object.entries(s))if(k.size>1&&!m.startsWith("#mw-customcollapsible-")){let x=!m.startsWith("#"),A=`duplicated ${x?"category":"id"}`,S=x?"error":"warning";n.push(...[...k].map($=>{let w=N($,{start:$.getAbsoluteIndex()},"no-duplicate",A,S);return x&&(w.suggestions=[{desc:"remove",range:[w.startIndex,w.endIndex],text:""}]),w}))}let l=/<!--\s*lint-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->/gu,p=this.toString(),g=[],d=l.exec(p),c=0,h=0;for(;d;){let{1:m,index:k}=d,x=(i=d[2])==null?void 0:i.trim();h+=p.slice(c,k).split(`
32
+ ${c}${S}`,q=D=>{let H=new it(j,$.slice(B,L==null?void 0:L.index),t,n);return D.insertAt(H),H};for(;L;)q(l),{lastIndex:B}=w,[j]=L,L=w.exec($);i.push(l,q(l))}}return o.slice(1)}});var Or,As=b(()=>{"use strict";_e();Or=class extends re{get type(){return"hr"}}});var ws,Ln,ba,ot,Ss=b(()=>{"use strict";Xe();F();_e();ws=[ue()];ot=class extends(ba=re){get type(){return"double-underscore"}constructor(r,e,t=f.getConfig(),n){super(r,t,n)}getAttribute(r){return r==="padding"?2:super.getAttribute(r)}toString(){return`__${this.innerText}__`}print(){return super.print({pre:"__",post:"__"})}};Ln=le(ba),ot=ge(Ln,0,"DoubleUnderscoreToken",ws,ot),de(Ln,1,ot)});var Cs={};se(Cs,{parseHrAndDoubleUnderscore:()=>Ta});var Ta,$s=b(()=>{"use strict";As();Ss();un();Ta=({firstChild:{data:a},type:r,name:e},t,n)=>{var l;let{doubleUnderscore:i}=t,s=new Set(i[0]),o=new Set(i[1]);return(l=t.regexHrAndDoubleUnderscore)!=null||(t.regexHrAndDoubleUnderscore=new RegExp(`__(${[...s,...o].join("|")})__`,"giu")),r!=="root"&&(r!=="ext-inner"||e!=="poem")&&(a=`\0${a}`),a=a.replace(/^((?:\0\d+[cno]\x7F)*)(-{4,})/gmu,(p,g,d)=>(new Or(d,t,n),`${g}\0${n.length-1}r\x7F`)).replace(t.regexHrAndDoubleUnderscore,(p,g)=>{var m,k;let d=o.has(g),c=g.toLowerCase(),h=s.has(c);return d||h?(new ot(g,d,t,n),`\0${n.length-1}${h&&((k=(m=i[2])==null?void 0:m[c])!=null?k:c)==="toc"?"u":"n"}\x7F`):p}).replace(/^((?:\0\d+[cn]\x7F)*)(={1,6})(.+)\2((?:\s|\0\d+[cn]\x7F)*)$/gmu,(p,g,d,c,h)=>{let m=`${g}\0${n.length}h\x7F`;return new kt(d.length,[c,h],t,n),m}),r==="root"||r==="ext-inner"&&e==="poem"?a:a.slice(1)}});var Mr,Ns=b(()=>{"use strict";_();Q();F();_e();Mr=class extends re{get type(){return"quote"}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}text(){let{parentNode:r,innerText:e}=this;return(r==null?void 0:r.type)==="image-parameter"&&r.name!=="caption"?"":e}lint(r=this.getAbsoluteIndex()){let{previousSibling:e,nextSibling:t,bold:n}=this,i=f.msg('lonely "$1"',"'"),s=[],o=new E(this,r),l,p=(g,d,c)=>({desc:"escape",range:[g,d],text:"&apos;".repeat(c)});if((e==null?void 0:e.type)==="text"&&e.data.endsWith("'")){l=N(this,o,"lonely-apos",i);let{startIndex:g,startLine:d,startCol:c}=l,[,{length:h}]=/(?:^|[^'])('+)$/u.exec(e.data),m=r-h;s.push({...l,startIndex:m,endIndex:g,startCol:c-h,endLine:d,endCol:c,suggestions:[p(m,g,h)]})}if((t==null?void 0:t.type)==="text"&&t.data.startsWith("'")){l!=null||(l=N(this,o,"lonely-apos",i));let{endIndex:g,endLine:d,endCol:c}=l,[{length:h}]=/^'+/u.exec(t.data),m=g+h;s.push({...l,startIndex:g,endIndex:m,startLine:d,startCol:c,endCol:c+h,suggestions:[p(g,m,h)]})}return n&&this.closest("heading-title")&&s.push(N(this,o,"bold-header","bold in section header","warning")),s}json(){let r=super.json();return Object.assign(r,{bold:this.bold,italic:this.italic}),r}}});var Es={};se(Es,{parseQuotes:()=>In});var In,Fn=b(()=>{"use strict";Ns();In=(a,r,e)=>{var g;let t=a.split(/('{2,})/u),{length:n}=t;if(n===1)return a;let i=0,s=0,o,l,p;for(let d=1;d<n;d+=2){let c=t[d].length;switch(c){case 2:s++;break;case 4:t[d-1]+="'",t[d]="'''";case 3:if(i++,o!==void 0)break;t[d-1].endsWith(" ")?l===void 0&&p===void 0&&(p=d):t[d-1].slice(-2,-1)===" "?o=d:l!=null||(l=d);break;default:t[d-1]+="'".repeat(c-5),t[d]="'''''",s++,i++}}if(s%2===1&&i%2===1){let d=(g=o!=null?o:l)!=null?g:p;d!==void 0&&(t[d]="''",t[d-1]+="'")}for(let d=1;d<n;d+=2)new Mr(t[d],r,e),t[d]=`\0${e.length-1}q\x7F`;return t.join("")}});var Ls={};se(Ls,{parseExternalLinks:()=>Rn});var Rn,Pn=b(()=>{"use strict";J();Tn();Ir();Rn=(a,r,e,t)=>{var n;return(n=r.regexExternalLinks)!=null||(r.regexExternalLinks=new RegExp(String.raw`\[(\0\d+f\x7F|(?:(?:${r.protocol}|//)${Ae}|\0\d+m\x7F)${we}(?=[[\]<>"\t\p{Zs}]|\0\d))(\p{Zs}*(?!\p{Zs}))([^\]\x01-\x08\x0A-\x1F\uFFFD]*)\]`,"giu")),a.replace(r.regexExternalLinks,(i,s,o,l)=>{let{length:p}=e,g=/&[lg]t;/u.exec(s);return g&&(s=s.slice(0,g.index),o="",l=s.slice(g.index)+o+l),t?(new Le(s,"ext-link-url",r,e),`[\0${p}f\x7F${o}${l}]`):(new Ct(s,o,l,r,e),`\0${p}w\x7F`)})}});var Gr,Is=b(()=>{"use strict";Ht();Gr=class extends Ce{get type(){return"category"}}});var Rs={};se(Rs,{parseLinks:()=>Fs});var ya,Fs,Ps=b(()=>{"use strict";F();Fn();Pn();bn();fn();Is();ya=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)(.*)$/su,Fs=(a,r,e)=>{var s;(s=r.regexLinks)!=null||(r.regexLinks=new RegExp(String.raw`^\s*(?:${r.protocol}|//)`,"iu"));let t=r.inExt?/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)(.*?[^\]]))?\]\](.*)$/su:/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)(.*?[^\]])?)?\]\](.*)$/su,n=a.split("[["),i=n.shift();for(let o=0;o<n.length;o++){let l=!1,p,g,d,c,h=n[o],m=t.exec(h);if(m)[,p,g,d,c]=m,c.startsWith("]")&&(d!=null&&d.includes("["))&&(d+="]",c=c.slice(1));else{let L=ya.exec(h);L&&(l=!0,[,p,g,d]=L)}if(p===void 0||r.regexLinks.test(p)||/\0\d+[exhbru]\x7F/u.test(p)){i+=`[[${h}`;continue}let k=p.trim().startsWith(":");if(k&&l){i+=`[[${h}`;continue}let x=f.normalizeTitle(p,0,!1,r,!0,!0,!0),{ns:A,valid:S,interwiki:$}=x;if(S){if(l){if($||A!==6){i+=`[[${h}`;continue}let L=!1;for(o++;o<n.length;o++){let B=n[o],j=B.split("]]");if(j.length>2){L=!0,d+=`[[${j[0]}]]${j[1]}`,c=j.slice(2).join("]]");break}else if(j.length===2)d+=`[[${j[0]}]]${j[1]}`;else{d+=`[[${B}`;break}}if(d=Fs(d,r,e),!L){i+=`[[${p}${g}${d}`;continue}}}else{i+=`[[${h}`;continue}d&&(d=In(d,r,e));let w=St;k||(!$&&A===6?(d&&(d=Rn(d,r,e,!0)),w=At):!$&&A===14&&(w=Gr)),d===void 0&&g&&(d=""),i+=`\0${e.length}l\x7F${c}`,new w(p,d,r,e,g)}return i}});var _s={};se(_s,{parseMagicLinks:()=>va});var qs,Bs,js,ka,va,Os=b(()=>{"use strict";J();Ir();qs=String.raw`[\p{Zs}\t]|&nbsp;|&#0*160;|&#x0*a0;`,Bs=`(?:${qs})+`,js=`(?:${qs}|-)`,ka=String.raw`(?:RFC|PMID)${Bs}\d+\b|ISBN${Bs}(?:97[89]${js}?)?(?:\d${js}?){9}[\dx]\b`,va=(a,r,e)=>{var t;return(t=r.regexMagicLinks)!=null||(r.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\d_])(?:(?:${r.protocol})(${Ae}${we})|${ka})`,"giu")),a.replace(r.regexMagicLinks,(n,i,s)=>{let o=i?n.slice(i.length):n;if(s){let l="",p=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(o);p&&(l=o.slice(p.index),o=o.slice(0,p.index));let g=o.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,d=g.exec(o);if(d){let c=1;d[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(o.slice(0,d.index))&&(c=2),l=o.slice(d.index+c)+l,o=o.slice(0,d.index+c)}return l.length>=s.length?n:(new Le(o,void 0,r,e),`${i}\0${e.length-1}w\x7F${l}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(o))return n;return new Le(o,"magic-link",r,e),`${i}\0${e.length-1}i\x7F`})}});var Ms,Gs=b(()=>{"use strict";Ms=(a,r)=>a.startsWith(r)?r.length:[...r].findIndex((e,t)=>e!==a[t])});var zr,zs=b(()=>{"use strict";Nn();zr=class extends Ft{get type(){return"list"}}});var Ws={};se(Ws,{parseList:()=>Aa});var Aa,Us=b(()=>{"use strict";Gs();zs();En();Aa=(a,r,e,t)=>{let n=/^((?:\0\d+[cno]\x7F)*)([;:*#]+\s*)/u.exec(a);if(!n)return r.lastPrefix="",a;let[i,s,o]=n,l=o.replace(/;/gu,":"),p=Ms(l,r.lastPrefix),g=(p>1?o.slice(p-1):o).split(/(?=;)/u),d=g[0].startsWith(";"),c=g.length-(d?0:1);if(p>1){let q=o.slice(0,p-1);d?g.unshift(q):g[0]=q+g[0]}r.lastPrefix=l;let h=s+g.map((q,D)=>`\0${t.length+D}d\x7F`).join("")+a.slice(i.length);for(let q of g)new zr(q,e,t);if(!c)return h;let{html:[m]}=e,k=/:+|-\{|\0\d+[xq]\x7F/gu,x=k,A=x.exec(h),S=0,$=!1,w=!1,L=0,B=(q,D)=>(new Rt(q,e,t),`${h.slice(0,D)}\0${t.length-1}d\x7F${h.slice(D+q.length)}`),j=q=>{q?S&&S--:S++};for(;A&&c;){let{0:q,index:D}=A;if(q==="-{"){if(!L){let{lastIndex:H}=x;x=/-\{|\}-/gu,x.lastIndex=H}L++}else if(q==="}-"){if(L--,!L){let{lastIndex:H}=x;x=k,x.lastIndex=H}}else if(q.endsWith("x\x7F")){let{name:H,closing:ne,selfClosing:ee}=t[Number(q.slice(1,-2))];(!ee||m.includes(H))&&j(ne)}else if(q.endsWith("q\x7F")){let{bold:H,italic:ne}=t[Number(q.slice(1,-2))];H&&(j($),$=!$),ne&&(j(w),w=!w)}else if(S===0){if(q.length>=c)return B(q.slice(0,c),D);c-=q.length,x.lastIndex=D+4+String(t.length).length,h=B(q,D)}A=x.exec(h)}return h}});var Ds,Fe,Wr,Hs=b(()=>{"use strict";_();Q();F();P();Ee();Ds=new Set(["A","T","R","D","-","H","N"]),Wr=class extends y{constructor(e,t=f.getConfig(),n=[]){super(void 0,t,n,{});T(this,Fe);this.append(...e.map(i=>new G(i,"converter-flag",t,n)))}get type(){return"converter-flags"}afterBuild(){v(this,Fe,this.childNodes.map(e=>e.text().trim())),super.afterBuild()}toString(e){return super.toString(e,";")}text(){return super.text(";")}getGaps(){return 1}getUnknownFlags(){return new Set(u(this,Fe).filter(e=>/\{{3}[^{}]+\}{3}/u.test(e)))}getVariantFlags(){let e=new Set(this.getAttribute("config").variants);return new Set(u(this,Fe).filter(t=>e.has(t)))}lint(e=this.getAbsoluteIndex(),t){let n=this.getVariantFlags(),i=this.getUnknownFlags(),s=new Set(u(this,Fe).filter(d=>Ds.has(d))),o=u(this,Fe).filter(d=>!d).length,l=u(this,Fe).length-i.size-o,p=super.lint(e,t);if(n.size===l||s.size===l)return p;let g=new E(this,e);for(let[d,c]of this.childNodes.entries()){let h=c.text().trim();if(h&&!n.has(h)&&!i.has(h)&&(n.size>0||!s.has(h))){let m=C(c,g,"no-ignored","invalid conversion flag");n.size===0&&Ds.has(h.toUpperCase())?m.fix={range:[m.startIndex,m.endIndex],text:h.toUpperCase()}:m.suggestions=[{desc:"remove",range:[m.startIndex-(d&&1),m.endIndex],text:""}],p.push(m)}}return p}print(){return super.print({sep:";"})}};Fe=new WeakMap});var Pt,Vs=b(()=>{"use strict";F();P();Ee();Pt=class extends y{get type(){return"converter-rule"}constructor(r,e=!0,t=f.getConfig(),n=[]){super(void 0,t,n);let i=r.indexOf(":"),s=r.slice(0,i).indexOf("=>"),o=s===-1?r.slice(0,i):r.slice(s+2,i);e&&t.variants.includes(o.trim())?(super.insertAt(new G(o,"converter-rule-variant",t,n)),super.insertAt(new G(r.slice(i+1),"converter-rule-to",t,n)),s!==-1&&super.insertAt(new G(r.slice(0,s),"converter-rule-from",t,n),0)):super.insertAt(new G(r,"converter-rule-to",t,n))}toString(r){let{childNodes:e,firstChild:t,lastChild:n}=this;return e.length===3?`${t.toString(r)}=>${e[1].toString(r)}:${n.toString(r)}`:super.toString(r,":")}text(){let{childNodes:r,firstChild:e,lastChild:t}=this;return r.length===3?`${e.text()}=>${r[1].text()}:${t.text()}`:super.text(":")}getGaps(r){return r===0&&this.length===3?2:1}print(){let{childNodes:r}=this;if(r.length===3){let[e,t,n]=r;return`<span class="wpb-converter-rule">${e.print()}=>${t.print()}:${n.print()}</span>`}return super.print({sep:":"})}}});var Ur,Xs=b(()=>{"use strict";J();F();P();Hs();Vs();Ur=class extends y{get type(){return"converter"}constructor(r,e,t=f.getConfig(),n=[]){super(void 0,t,n),this.append(new Wr(r,t,n));let[i]=e,s=i.includes(":"),o=new Pt(i,s,t,n);s&&o.length===1||!s&&e.length===2&&!te(e[1]).trim()?this.insertAt(new Pt(e.join(";"),!1,t,n)):this.append(o,...e.slice(1).map(l=>new Pt(l,!0,t,n)))}toString(r){let{childNodes:[e,...t]}=this;return`-{${e.toString(r)}${e.length>0?"|":""}${t.map(n=>n.toString(r)).join(";")}}-`}text(){let{childNodes:[r,...e]}=this;return`-{${r.text()}|${pe(e,";")}}-`}getAttribute(r){return r==="padding"?2:super.getAttribute(r)}getGaps(r){return r||this.firstChild.length>0?1:0}print(){let{childNodes:[r,...e]}=this;return`<span class="wpb-converter">-{${r.print()}${r.length>0?"|":""}${Ne(e,{sep:";"})}}-</span>`}}});var Qs={};se(Qs,{parseConverter:()=>wa});var wa,Zs=b(()=>{"use strict";Xs();wa=(a,r,e)=>{var l;(l=r.regexConverter)!=null||(r.regexConverter=new RegExp(String.raw`;(?=(?:[^;]*?=>)?\s*(?:${r.variants.join("|")})\s*:|(?:\s|\0\d+[cn]\x7F)*$)`,"u"));let t=/-\{/gu,n=/-\{|\}-/gu,i=[],s=t,o=s.exec(a);for(;o;){let{0:p,index:g}=o;if(p==="}-"){let d=i.pop(),{length:c}=e,h=a.slice(d.index+2,g),m=h.indexOf("|"),[k,x]=m===-1?[[],h]:[h.slice(0,m).split(";"),h.slice(m+1)],A=x.replace(/(&[#a-z\d]+);/giu,"$1"),S=A.split(r.regexConverter).map($=>$.replace(/\x01/gu,";"));new Ur(k,S,r,e),a=`${a.slice(0,d.index)}\0${c}v\x7F${a.slice(g+2)}`,i.length===0&&(s=t),s.lastIndex=d.index+3+String(c).length}else i.push(o),s=n,s.lastIndex=g+2;o=s.exec(a)}return a}});var Dr={};se(Dr,{Token:()=>y});var ir,fe,O,z,at,Bt,sr,M,Js,Ks,Ys,eo,to,ro,no,io,so,oo,ao,lo,Bn,y,P=b(()=>{"use strict";J();Se();be();_();F();hi();xi();Bn=class Bn extends ur{constructor(e,t=f.getConfig(),n=[],i){super();T(this,M);T(this,ir,"plain");T(this,fe,0);T(this,O);T(this,z);T(this,at);T(this,Bt,!1);T(this,sr);typeof e=="string"&&this.insertAt(e),v(this,O,t),v(this,z,n),n.push(this)}get type(){return u(this,ir)}set type(e){v(this,ir,e)}parseOnce(e=u(this,fe),t=!1){if(e<u(this,fe)||this.length===0||!this.getAttribute("plain"))return this;if(u(this,fe)>=11)return this;switch(e){case 0:if(this.type==="root"){u(this,z).pop();let n=R(this,M,Js).call(this);t&&(t=!n)}v(this,at,t),R(this,M,Ks).call(this,t);break;case 1:R(this,M,Ys).call(this);break;case 2:R(this,M,eo).call(this);break;case 3:R(this,M,to).call(this);break;case 4:R(this,M,ro).call(this);break;case 5:R(this,M,no).call(this);break;case 6:R(this,M,io).call(this);break;case 7:R(this,M,so).call(this);break;case 8:R(this,M,oo).call(this);break;case 9:R(this,M,ao).call(this);break;case 10:R(this,M,lo).call(this)}if(this.type==="root")for(let n of u(this,z))n==null||n.parseOnce(e,t);return dr(this,fe)._++,this}buildFromStr(e,t){let n=e.split(/[\0\x7F]/u).map((i,s)=>{if(s%2===0)return new Wt(i);if(isNaN(i.slice(-1)))return u(this,z)[Number(i.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${i}`)});return t===0?n.map(String).join(""):t===1?pe(n):n}build(){v(this,fe,11);let{length:e,firstChild:t}=this,n=t==null?void 0:t.toString();if(e===1&&t.type==="text"&&n.includes("\0")&&(this.replaceChildren(...this.buildFromStr(n)),this.normalize(),this.type==="root"))for(let i of u(this,z))i==null||i.build()}afterBuild(){if(this.type==="root")for(let e of u(this,z))e==null||e.afterBuild();v(this,Bt,!0)}parse(e=11,t){for(e=Math.min(e,11);u(this,fe)<e;)this.parseOnce(u(this,fe),t);return e&&(this.build(),this.afterBuild()),this}getAttribute(e){var t;switch(e){case"plain":return this.constructor===Bn;case"config":return u(this,O);case"include":return(t=u(this,at))!=null?t:!!u(this.getRootNode(),at);case"accum":return u(this,z);case"built":return u(this,Bt);default:return super.getAttribute(e)}}setAttribute(e,t){switch(e){case"stage":u(this,fe)===0&&this.type==="root"&&u(this,z).shift(),v(this,fe,t);break;default:super.setAttribute(e,t)}}insertAt(e,t=this.length){let n=typeof e=="string"?new Wt(e):e;return super.insertAt(n,t),n.type==="root"&&(n.type="plain"),n}normalizeTitle(e,t=0,n,i,s){return f.normalizeTitle(e,t,u(this,at),u(this,O),n,i,s)}lint(e=this.getAbsoluteIndex(),t){var i;let n=super.lint(e,t);if(this.type==="root"){let s={},o="category,html-attr#id,ext-attr#id,table-attr#id,ext-attr#name";for(let m of this.querySelectorAll(o)){let k;if(m.type==="category")k=m.name;else{let A=m.getValue();if(m.name==="id")k=`#${A===!0?"":A}`;else if(m.tag==="ref"&&A!==!0&&A&&m.parentNode.parentNode.innerText)k=`ref#${A}`;else continue}let x=s[k];x?x.add(m):s[k]=new Set([m])}for(let[m,k]of Object.entries(s))if(k.size>1&&!m.startsWith("#mw-customcollapsible-")){let x=!m.includes("#"),A=`duplicated ${x?"category":"id/name"}`,S=m.startsWith("#")?"warning":"error";n.push(...[...k].map($=>{let w=N($,{start:$.getAbsoluteIndex()},"no-duplicate",A,S);return x&&(w.suggestions=[{desc:"remove",range:[w.startIndex,w.endIndex],text:""}]),w}))}let l=/<!--\s*lint-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->/gu,p=this.toString(),g=[],d=l.exec(p),c=0,h=0;for(;d;){let{1:m,index:k}=d,x=(i=d[2])==null?void 0:i.trim();h+=p.slice(c,k).split(`
33
33
  `).length-1,c=k,g.push({line:h+(m==="disable-line"?0:1),from:m==="disable"?l.lastIndex:void 0,to:m==="enable"?l.lastIndex:void 0,rules:x?new Set(x.split(",").map(A=>A.trim())):void 0}),d=l.exec(p)}n=n.filter(({rule:m,startLine:k,startIndex:x})=>{let A={pos:0};for(let{line:S,from:$,to:w,rules:L}of g){if(S>k+1)break;if(L&&!L.has(m))continue;if(S===k&&$===void 0&&w===void 0)return!1;$<=x&&$>A.pos?(A.pos=$,A.type="from"):w<=x&&w>A.pos&&(A.pos=w,A.type="to")}return A.type!=="from"})}return n}toString(e,t){var s;let{rev:n}=ye,i=this.getRootNode();return!e&&i.type==="root"&&u(i,Bt)?((s=u(this,sr))!=null||v(this,sr,[n,super.toString(!1,t)]),u(this,sr)[1]):super.toString(e,t)}};ir=new WeakMap,fe=new WeakMap,O=new WeakMap,z=new WeakMap,at=new WeakMap,Bt=new WeakMap,sr=new WeakMap,M=new WeakSet,Js=function(){let{parseRedirect:e}=(Ai(),Z(vi)),t=this.firstChild.toString(),n=e(t,u(this,O),u(this,z));return n&&this.setText(n),!!n},Ks=function(e){let{parseCommentAndExt:t}=(Qt(),Z(gs));this.setText(t(this.firstChild.toString(),u(this,O),u(this,z),e))},Ys=function(){let{parseBraces:e}=(Sr(),Z(Xi)),t=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,n=e(t,u(this,O),u(this,z));this.setText(this.type==="root"?n:n.slice(1))},eo=function(){var t;if((t=u(this,O).excludes)!=null&&t.includes("html"))return;let{parseHtml:e}=(cs(),Z(us));this.setText(e(this.firstChild.toString(),u(this,O),u(this,z)))},to=function(){var t;if((t=u(this,O).excludes)!=null&&t.includes("table"))return;let{parseTable:e}=(vs(),Z(ks));this.setText(e(this,u(this,O),u(this,z)))},ro=function(){var t;if((t=u(this,O).excludes)!=null&&t.includes("hr"))return;let{parseHrAndDoubleUnderscore:e}=($s(),Z(Cs));this.setText(e(this,u(this,O),u(this,z)))},no=function(){let{parseLinks:e}=(Ps(),Z(Rs));this.setText(e(this.firstChild.toString(),u(this,O),u(this,z)))},io=function(){var n;if((n=u(this,O).excludes)!=null&&n.includes("quote"))return;let{parseQuotes:e}=(Fn(),Z(Es)),t=this.firstChild.toString().split(`
34
34
  `);for(let i=0;i<t.length;i++)t[i]=e(t[i],u(this,O),u(this,z));this.setText(t.join(`
35
35
  `))},so=function(){var t;if((t=u(this,O).excludes)!=null&&t.includes("extLink"))return;let{parseExternalLinks:e}=(Pn(),Z(Ls));this.setText(e(this.firstChild.toString(),u(this,O),u(this,z)))},oo=function(){var t;if((t=u(this,O).excludes)!=null&&t.includes("magicLink"))return;let{parseMagicLinks:e}=(Os(),Z(_s));this.setText(e(this.firstChild.toString(),u(this,O),u(this,z)))},ao=function(){var s;if((s=u(this,O).excludes)!=null&&s.includes("list"))return;let{parseList:e}=(Us(),Z(Ws)),t=this.firstChild.toString().split(`
package/dist/index.js CHANGED
@@ -6,9 +6,9 @@ const base_1 = require("./base");
6
6
  const debug_1 = require("./util/debug");
7
7
  const constants_1 = require("./util/constants");
8
8
  const string_1 = require("./util/string");
9
+ const diff_1 = require("./util/diff");
9
10
  /* NOT FOR BROWSER */
10
11
  const chalk = require("chalk");
11
- const diff_1 = require("./util/diff");
12
12
  /**
13
13
  * 从根路径require
14
14
  * @param file 文件名
package/dist/lib/text.js CHANGED
@@ -359,16 +359,14 @@ class AstText extends node_1.AstNode {
359
359
  }
360
360
  /** @private */
361
361
  removeBlankLines() {
362
- const mt = /\n[^\S\n]*$/u.exec(this.data);
363
362
  if (/\s$/u.test(this.data)) {
364
- const spaces = [];
363
+ const spaces = [], mt = /\n[^\S\n]*$/u.exec(this.data);
365
364
  let { nextSibling } = this, mt2 = null;
366
365
  while (nextSibling
367
366
  && (nextSibling.type === 'comment' || nextSibling.type === 'category' || nextSibling.type === 'text')) {
368
367
  if (nextSibling.type === 'text') {
369
- const { data } = nextSibling;
370
- mt2 = mt && /^[^\S\n]*(?=\n)/u.exec(data);
371
- if (mt2 || data.trim()) {
368
+ mt2 = mt && /^[^\S\n]*(?=\n)/u.exec(nextSibling.data);
369
+ if (mt2 || nextSibling.data.trim()) {
372
370
  break;
373
371
  }
374
372
  else {
@@ -405,9 +403,9 @@ class AstText extends node_1.AstNode {
405
403
  }
406
404
  }
407
405
  /** @private */
408
- toHtmlInternal(nowrap) {
406
+ toHtmlInternal(opt) {
409
407
  this.removeBlankLines();
410
- return this.toHtml(nowrap);
408
+ return this.toHtml(opt?.nowrap);
411
409
  }
412
410
  }
413
411
  exports.AstText = AstText;
@@ -28,8 +28,8 @@ const hiddenToken = (linter = true, html = true) => (constructor, _) => {
28
28
  dispatchEvent() {
29
29
  //
30
30
  }
31
- toHtmlInternal() {
32
- return html ? '' : super.toHtmlInternal();
31
+ toHtmlInternal(opt) {
32
+ return html ? '' : super.toHtmlInternal(opt);
33
33
  }
34
34
  }
35
35
  (0, debug_1.mixin)(AnyHiddenToken, constructor);
package/dist/src/arg.js CHANGED
@@ -208,12 +208,12 @@ class ArgToken extends index_2.Token {
208
208
  }
209
209
  }
210
210
  /** @private */
211
- toHtmlInternal(nowrap, nocc) {
211
+ toHtmlInternal(opt) {
212
212
  if (this.length === 1) {
213
213
  const html = (0, html_1.font)(this, this.toString());
214
- return nowrap ? html.replaceAll('\n', ' ') : html;
214
+ return opt?.nowrap ? html.replaceAll('\n', ' ') : html;
215
215
  }
216
- return (0, html_1.font)(this, this.childNodes[1].toHtmlInternal(nowrap, nocc));
216
+ return (0, html_1.font)(this, this.childNodes[1].toHtmlInternal(opt));
217
217
  }
218
218
  }
219
219
  exports.ArgToken = ArgToken;
@@ -135,14 +135,14 @@ let ConverterToken = (() => {
135
135
  });
136
136
  }
137
137
  /** @private */
138
- toHtmlInternal(nowrap, nocc) {
139
- const flags = this.getEffectiveFlags(), { childNodes: [, ...rules] } = this;
138
+ toHtmlInternal(opt) {
139
+ const flags = this.getEffectiveFlags(), nocc = opt?.nocc, { childNodes: [, ...rules] } = this;
140
140
  if (nocc || flags.has('R') || this.getVariantFlags().size > 0) {
141
- return (0, html_1.font)(this, (nocc ? '-{' : '') + (0, html_1.html)(rules, ';', nowrap, nocc) + (nocc ? '}-' : ''));
141
+ return (0, html_1.font)(this, (nocc ? '-{' : '') + (0, html_1.html)(rules, ';', opt) + (nocc ? '}-' : ''));
142
142
  }
143
143
  else if (flags.has('S')) {
144
- return (0, html_1.font)(this, rules.find(({ variant }) => variant)?.lastChild.toHtmlInternal(nowrap).trim()
145
- ?? rules[0].lastChild.toHtmlInternal(nowrap));
144
+ return (0, html_1.font)(this, rules.find(({ variant }) => variant)?.lastChild.toHtmlInternal(opt).trim()
145
+ ?? rules[0].lastChild.toHtmlInternal(opt));
146
146
  }
147
147
  return '';
148
148
  }
@@ -207,11 +207,11 @@ class ConverterRuleToken extends index_2.Token {
207
207
  }
208
208
  }
209
209
  /** @private */
210
- toHtmlInternal(nowrap, nocc) {
210
+ toHtmlInternal(opt) {
211
211
  const { childNodes, firstChild, lastChild } = this;
212
212
  return childNodes.length === 3
213
- ? `${firstChild.toHtmlInternal(nowrap, nocc)}=>${childNodes[1].text()}:${lastChild.toHtmlInternal(nowrap, nocc)}`
214
- : (0, html_1.html)(childNodes, ':', nowrap, nocc);
213
+ ? `${firstChild.toHtmlInternal(opt)}=>${childNodes[1].text()}:${lastChild.toHtmlInternal(opt)}`
214
+ : (0, html_1.html)(childNodes, ':', opt);
215
215
  }
216
216
  }
217
217
  exports.ConverterRuleToken = ConverterRuleToken;
@@ -191,7 +191,7 @@ let ExtLinkToken = (() => {
191
191
  this.#space ||= ' ';
192
192
  }
193
193
  /** @private */
194
- toHtmlInternal(nowrap, nocc) {
194
+ toHtmlInternal(opt) {
195
195
  const { length, lastChild } = this;
196
196
  let trail = '', innerText, autonumber = false, href;
197
197
  if (length > 1) {
@@ -201,9 +201,9 @@ let ExtLinkToken = (() => {
201
201
  if (i !== -1) {
202
202
  const after = childNodes.slice(i);
203
203
  this.after(...after);
204
- trail = (0, html_1.html)(after, '', nowrap, nocc);
204
+ trail = (0, html_1.html)(after, '', opt);
205
205
  }
206
- innerText = lastChild.toHtmlInternal(false, nocc);
206
+ innerText = lastChild.toHtmlInternal(opt);
207
207
  }
208
208
  else {
209
209
  ({ innerText } = this);
@@ -192,7 +192,7 @@ let HeadingToken = (() => {
192
192
  */
193
193
  #getId(expand) {
194
194
  const token = expand ? this.firstChild.expand() : this.firstChild;
195
- let id = (0, string_1.decodeHtml)((0, string_1.sanitizeAlt)(token.toHtmlInternal(false, true))).replace(/[\s_]+/gu, '_');
195
+ let id = (0, string_1.decodeHtml)((0, string_1.sanitizeAlt)(token.toHtmlInternal({ nocc: true }))).replace(/[\s_]+/gu, '_');
196
196
  if (id.endsWith('_')) {
197
197
  id = id.slice(0, -1);
198
198
  }
@@ -3,7 +3,7 @@ import { AstElement } from '../lib/element';
3
3
  import { AstText } from '../lib/text';
4
4
  import type { LintError, TokenTypes } from '../base';
5
5
  import type { Title } from '../lib/title';
6
- import type { AstNodes, IncludeToken, HtmlToken, ExtToken, TranscludeToken, CommentToken, FileToken, LinkToken, RedirectTargetToken, ExtLinkToken, MagicLinkToken, ImageParameterToken } from '../internal';
6
+ import type { AstNodes, ExtToken, IncludeToken, HtmlToken, TranscludeToken, CommentToken, FileToken, LinkToken, RedirectTargetToken, ExtLinkToken, MagicLinkToken, ImageParameterToken } from '../internal';
7
7
  import { Ranges } from '../lib/ranges';
8
8
  import { AstRange } from '../lib/range';
9
9
  import type { Range } from '../lib/ranges';
package/dist/src/index.js CHANGED
@@ -446,7 +446,7 @@ class Token extends element_1.AstElement {
446
446
  index_1.default.viewOnly = true;
447
447
  let errors = super.lint(start, re);
448
448
  if (this.type === 'root') {
449
- const record = {}, selector = 'category,html-attr#id,ext-attr#id,table-attr#id';
449
+ const record = {}, selector = 'category,html-attr#id,ext-attr#id,table-attr#id,ext-attr#name';
450
450
  for (const cat of this.querySelectorAll(selector)) {
451
451
  let key;
452
452
  if (cat.type === 'category') {
@@ -454,7 +454,16 @@ class Token extends element_1.AstElement {
454
454
  }
455
455
  else {
456
456
  const value = cat.getValue();
457
- key = `#${value === true ? '' : value}`;
457
+ if (cat.name === 'id') {
458
+ key = `#${value === true ? '' : value}`;
459
+ }
460
+ else if (cat.tag === 'ref' && value !== true && value
461
+ && cat.parentNode.parentNode.innerText) {
462
+ key = `ref#${value}`;
463
+ }
464
+ else {
465
+ continue;
466
+ }
458
467
  }
459
468
  const thisCat = record[key];
460
469
  if (thisCat) {
@@ -466,7 +475,7 @@ class Token extends element_1.AstElement {
466
475
  }
467
476
  for (const [key, value] of Object.entries(record)) {
468
477
  if (value.size > 1 && !key.startsWith('#mw-customcollapsible-')) {
469
- const isCat = !key.startsWith('#'), msg = `duplicated ${isCat ? 'category' : 'id'}`, severity = isCat ? 'error' : 'warning';
478
+ const isCat = !key.includes('#'), msg = `duplicated ${isCat ? 'category' : 'id/name'}`, severity = key.startsWith('#') ? 'warning' : 'error';
470
479
  errors.push(...[...value].map(cat => {
471
480
  const e = (0, lint_1.generateForSelf)(cat, { start: cat.getAbsoluteIndex() }, 'no-duplicate', msg, severity);
472
481
  if (isCat) {
@@ -771,7 +780,7 @@ class Token extends element_1.AstElement {
771
780
  return this.toHtml();
772
781
  }
773
782
  /** @private */
774
- toHtmlInternal(nowrap, nocc) {
783
+ toHtmlInternal(opt) {
775
784
  for (const child of this.childNodes) {
776
785
  if (child.type === 'text') {
777
786
  child.removeBlankLines();
@@ -784,7 +793,7 @@ class Token extends element_1.AstElement {
784
793
  }
785
794
  }
786
795
  this.normalize();
787
- return (0, html_1.font)(this, (0, html_1.html)(this.childNodes, '', nowrap, nocc));
796
+ return (0, html_1.font)(this, (0, html_1.html)(this.childNodes, '', opt));
788
797
  }
789
798
  }
790
799
  exports.Token = Token;
@@ -246,10 +246,12 @@ class LinkBaseToken extends index_2.Token {
246
246
  }
247
247
  }
248
248
  /** @private */
249
- toHtmlInternal(_, nocc) {
249
+ toHtmlInternal(opt) {
250
250
  if (this.is('link') || this.is('redirect-target')) {
251
251
  const { link, length, lastChild, type } = this, title = link.getTitleAttr();
252
- return (0, html_1.font)(this, `<a${link.interwiki && ' class="extiw"'} href="${link.getUrl()}"${title && ` title="${title}"`}>${type === 'link' && length > 1 ? lastChild.toHtmlInternal(true, nocc) : (0, string_1.sanitize)(this.innerText)}</a>`);
252
+ return (0, html_1.font)(this, `<a${link.interwiki && ' class="extiw"'} href="${link.getUrl()}"${title && ` title="${title}"`}>${type === 'link' && length > 1
253
+ ? lastChild.toHtmlInternal({ ...opt, nowrap: true })
254
+ : (0, string_1.sanitize)(this.innerText)}</a>`);
253
255
  }
254
256
  return '';
255
257
  }
@@ -307,10 +307,10 @@ class FileToken extends base_1.LinkBaseToken {
307
307
  throw new Error('LinkBaseToken.setLinkText method is not applicable to images!');
308
308
  }
309
309
  /** @private */
310
- toHtmlInternal(_, nocc) {
310
+ toHtmlInternal(opt) {
311
311
  /** @ignore */
312
312
  const isInteger = (n) => Boolean(n && !/\D/u.test(n));
313
- const { link, width, height, type } = this, file = this.getAttribute('title'), fr = this.getFrame(), manual = fr instanceof title_1.Title, visibleCaption = manual || fr === 'thumbnail' || fr === 'framed' || type === 'gallery-image', caption = this.getArg('caption')?.toHtmlInternal(true, nocc) ?? '', titleFromCaption = visibleCaption && type !== 'gallery-image' ? '' : (0, string_1.sanitizeAlt)(caption), hasLink = manual || link !== file, title = titleFromCaption || (hasLink && typeof link !== 'string' ? link.getTitleAttr() : ''), titleAttr = title && ` title="${title}"`, alt = (0, string_1.sanitizeAlt)(this.getArg('alt')?.toHtmlInternal(true)) ?? titleFromCaption, horiz = this.getHorizAlign() ?? '', vert = this.getVertAlign() ?? '', className = `${horiz ? `mw-halign-${horiz}` : vert && `mw-valign-${vert}`}${this.getValue('border') ? ' mw-image-border' : ''} ${(0, string_1.sanitizeAlt)(this.getValue('class')) ?? ''}`.trim(), classAttr = className && ` class="${className}"`, img = `<img${alt && ` alt="${alt}"`} src="${(manual ? fr : file).getUrl()}" class="mw-file-element"${isInteger(width) ? ` width="${width}"` : ''}${isInteger(height) ? ` height="${height}"` : ''}>`;
313
+ const { link, width, height, type } = this, file = this.getAttribute('title'), fr = this.getFrame(), manual = fr instanceof title_1.Title, visibleCaption = manual || fr === 'thumbnail' || fr === 'framed' || type === 'gallery-image', caption = this.getArg('caption')?.toHtmlInternal({ ...opt, nowrap: true }) ?? '', titleFromCaption = visibleCaption && type !== 'gallery-image' ? '' : (0, string_1.sanitizeAlt)(caption), hasLink = manual || link !== file, title = titleFromCaption || (hasLink && typeof link !== 'string' ? link.getTitleAttr() : ''), titleAttr = title && ` title="${title}"`, alt = (0, string_1.sanitizeAlt)(this.getArg('alt')?.toHtmlInternal({ ...opt, nowrap: true })) ?? titleFromCaption, horiz = this.getHorizAlign() ?? '', vert = this.getVertAlign() ?? '', className = `${horiz ? `mw-halign-${horiz}` : vert && `mw-valign-${vert}`}${this.getValue('border') ? ' mw-image-border' : ''} ${(0, string_1.sanitizeAlt)(this.getValue('class')) ?? ''}`.trim(), classAttr = className && ` class="${className}"`, img = `<img${alt && ` alt="${alt}"`} src="${(manual ? fr : file).getUrl()}" class="mw-file-element"${isInteger(width) ? ` width="${width}"` : ''}${isInteger(height) ? ` height="${height}"` : ''}>`;
314
314
  let href = '';
315
315
  if (link) {
316
316
  try {
@@ -491,14 +491,14 @@ class TableToken extends trBase_1.TrBaseToken {
491
491
  this.moveTableColAfter(x, after);
492
492
  }
493
493
  /** @private */
494
- toHtmlInternal(nowrap) {
494
+ toHtmlInternal(opt) {
495
495
  /**
496
496
  * 过滤需要移出表格的节点
497
497
  * @param token 表格或表格行
498
498
  */
499
499
  const filter = (token) => token.childNodes.filter((0, debug_1.isToken)('table-inter'));
500
- const { childNodes } = this, tr = childNodes.filter((0, debug_1.isToken)('tr')), inter = [this, ...tr].flatMap(filter).map(token => token.toHtmlInternal(true).trim()).join(' ');
501
- return `${inter}<table${childNodes[1].toHtmlInternal()}>${nowrap ? ' ' : '\n'}<tbody>${super.toHtmlInternal(nowrap)}${(0, html_1.html)(tr, '', nowrap)}</tbody></table>`;
500
+ const { childNodes } = this, tr = childNodes.filter((0, debug_1.isToken)('tr')), newOpt = { ...opt, nowrap: true }, inter = [this, ...tr].flatMap(filter).map(token => token.toHtmlInternal(newOpt).trim()).join(' ');
501
+ return `${inter}<table${childNodes[1].toHtmlInternal()}>${opt?.nowrap ? ' ' : '\n'}<tbody>${super.toHtmlInternal(opt)}${(0, html_1.html)(tr, '', opt)}</tbody></table>`;
502
502
  }
503
503
  }
504
504
  exports.TableToken = TableToken;
@@ -340,9 +340,9 @@ let TdToken = (() => {
340
340
  }
341
341
  }
342
342
  /** @private */
343
- toHtmlInternal(nowrap) {
344
- const { subtype, childNodes: [, attr, inner], nextSibling } = this, notEOL = nextSibling?.toString().startsWith('\n') === false, lf = nowrap ? ' ' : '\n';
345
- let html = inner.toHtmlInternal(nowrap).replace(/^[^\S\n]*/u, '');
343
+ toHtmlInternal(opt) {
344
+ const { subtype, childNodes: [, attr, inner], nextSibling } = this, notEOL = nextSibling?.toString().startsWith('\n') === false, lf = opt?.nowrap ? ' ' : '\n';
345
+ let html = inner.toHtmlInternal(opt).replace(/^[^\S\n]*/u, '');
346
346
  if (notEOL) {
347
347
  html = html.replace(/(?<=[\S\n])[^\S\n]*$/u, '');
348
348
  }
@@ -154,11 +154,11 @@ class TrBaseToken extends base_1.TableBaseToken {
154
154
  return this.insertBefore(token, this.getNthCol(column, true));
155
155
  }
156
156
  /** @private */
157
- toHtmlInternal(nowrap) {
157
+ toHtmlInternal(opt) {
158
158
  const { childNodes, type } = this, td = childNodes.filter((0, debug_2.isToken)('td'));
159
159
  return td.some(({ subtype }) => subtype !== 'caption')
160
- ? `<tr${type === 'tr' ? childNodes[1].toHtmlInternal() : ''}>${(0, html_1.html)(td, '', nowrap)}</tr>`
161
- : (0, html_1.html)(td, '', nowrap);
160
+ ? `<tr${type === 'tr' ? childNodes[1].toHtmlInternal() : ''}>${(0, html_1.html)(td, '', opt)}</tr>`
161
+ : (0, html_1.html)(td, '', opt);
162
162
  }
163
163
  }
164
164
  exports.TrBaseToken = TrBaseToken;
@@ -197,16 +197,16 @@ let ExtToken = (() => {
197
197
  });
198
198
  }
199
199
  /** @private */
200
- toHtmlInternal(_, nocc) {
200
+ toHtmlInternal(opt) {
201
201
  const { name, firstChild, lastChild } = this;
202
202
  switch (name) {
203
203
  case 'nowiki':
204
204
  return (0, html_1.font)(this, (0, string_1.newline)(lastChild.toHtmlInternal()));
205
205
  case 'pre':
206
- return (0, html_1.font)(this, `<pre${firstChild.toHtmlInternal()}>${(0, string_1.newline)(lastChild.toHtmlInternal(false, nocc))}</pre>`);
206
+ return (0, html_1.font)(this, `<pre${firstChild.toHtmlInternal()}>${(0, string_1.newline)(lastChild.toHtmlInternal({ ...opt, nowrap: false }))}</pre>`);
207
207
  case 'poem':
208
208
  firstChild.classList.add('poem');
209
- return (0, html_1.font)(this, `<div${firstChild.toHtmlInternal()}>${lastChild.toHtmlInternal(false, nocc).replace(/(?<!^|<hr>)\n(?!$)/gu, '<br>\n')
209
+ return (0, html_1.font)(this, `<div${firstChild.toHtmlInternal()}>${lastChild.toHtmlInternal({ ...opt, nowrap: false }).replace(/(?<!^|<hr>)\n(?!$)/gu, '<br>\n')
210
210
  .replace(/^ +/gmu, p => '&nbsp;'.repeat(p.length))}</div>`);
211
211
  case 'gallery': {
212
212
  const caption = firstChild.getAttrToken('caption'), perrow = parseInt(String(firstChild.getAttr('perrow'))), mode = firstChild.getAttr('mode'), nolines = typeof mode === 'string' && mode.toLowerCase() === 'nolines', padding = nolines ? 9 : 43;
@@ -218,7 +218,9 @@ let ExtToken = (() => {
218
218
  const style = firstChild.getAttr('style');
219
219
  firstChild.setAttr('style', `max-width: ${(lastChild.widths + padding) * perrow}px;${typeof style === 'string' ? style : ''}`);
220
220
  }
221
- return (0, html_1.font)(this, `<ul${firstChild.toHtmlInternal()}>\n${caption ? `\t<li class="gallerycaption">${caption.lastChild.toHtmlInternal(true)}</li>\n` : ''}${lastChild.toHtmlInternal()}\n</ul>`);
221
+ return (0, html_1.font)(this, `<ul${firstChild.toHtmlInternal()}>\n${caption
222
+ ? `\t<li class="gallerycaption">${caption.lastChild.toHtmlInternal({ nowrap: true })}</li>\n`
223
+ : ''}${lastChild.toHtmlInternal()}\n</ul>`);
222
224
  }
223
225
  default:
224
226
  return '';
@@ -590,7 +590,7 @@ class TranscludeToken extends index_2.Token {
590
590
  return this.escapeTables();
591
591
  }
592
592
  /** @private */
593
- toHtmlInternal(nowrap) {
593
+ toHtmlInternal(opt) {
594
594
  const { type, name } = this;
595
595
  if (type === 'template' && !name.startsWith('Special:')) {
596
596
  if (this.normalizeTitle(name, 0, true).valid) {
@@ -598,7 +598,7 @@ class TranscludeToken extends index_2.Token {
598
598
  return `<a href="${this.#getTitle().getUrl()}?action=edit&redlink=1" class="new" title="${title} (page does not exist)">${title}</a>`;
599
599
  }
600
600
  const str = this.toString(true);
601
- return nowrap ? str.replaceAll('\n', ' ') : str;
601
+ return opt?.nowrap ? str.replaceAll('\n', ' ') : str;
602
602
  }
603
603
  return basicMagicWords.has(name) ? basicMagicWords.get(name) : '';
604
604
  }
package/dist/util/html.js CHANGED
@@ -79,15 +79,14 @@ const openList = (chars, state) => {
79
79
  * convert to HTML
80
80
  * @param childNodes a Token's contents
81
81
  * @param separator delimiter between nodes
82
- * @param nowrap whether to normalize newlines
83
- * @param nocc whether to perform language conversion
82
+ * @param opt options
84
83
  */
85
- const html = (childNodes, separator = '', nowrap, nocc) => {
84
+ const html = (childNodes, separator = '', opt) => {
86
85
  let lastPrefix = '';
87
86
  const results = [], state = { dt: [] };
88
87
  for (let j = 0; j < childNodes.length; j++) {
89
88
  const child = childNodes[j];
90
- let result = child.toHtmlInternal(nowrap, nocc);
89
+ let result = child.toHtmlInternal(opt);
91
90
  if (child.is('list-range')) {
92
91
  result = result.trim();
93
92
  const { previousSibling: { firstChild: { data } } } = child, prefix = data.trim(), prefix2 = prefix.replaceAll(';', ':'), commonPrefixLength = (0, exports.getCommon)(prefix2, lastPrefix);
@@ -111,7 +110,7 @@ const html = (childNodes, separator = '', nowrap, nocc) => {
111
110
  for (let i = 0; i < nextSibling.indent; i++) {
112
111
  result += nextItem(':', state);
113
112
  }
114
- result += next.toHtmlInternal(nowrap).trim();
113
+ result += next.toHtmlInternal(opt).trim();
115
114
  ({ nextSibling } = next);
116
115
  j += 2;
117
116
  }
@@ -1,6 +1,6 @@
1
1
  (() => {
2
2
  var _a;
3
- const version = '1.13.5', src = (_a = document.currentScript) === null || _a === void 0 ? void 0 : _a.src, file = /\/extensions\/dist\/base\.(?:min\.)?js$/u, CDN = src && file.test(src)
3
+ const version = '1.13.6', src = (_a = document.currentScript) === null || _a === void 0 ? void 0 : _a.src, file = /\/extensions\/dist\/base\.(?:min\.)?js$/u, CDN = src && file.test(src)
4
4
  ? src.replace(file, '')
5
5
  : `https://testingcf.jsdelivr.net/npm/wikiparser-node@${version}`;
6
6
  const workerJS = () => {
package/i18n/zh-hans.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "content to be moved out from the table": "将被移出表格的内容",
12
12
  "duplicated $1 attribute": "重复的$1属性",
13
13
  "duplicated category": "重复的分类",
14
- "duplicated id": "重复的id",
14
+ "duplicated id/name": "重复的id/name",
15
15
  "duplicated image $1 parameter": "重复的图片$1参数",
16
16
  "duplicated parameter": "重复参数",
17
17
  "extension tag in HTML tag attributes": "HTML标签属性中的扩展标签",
package/i18n/zh-hant.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "content to be moved out from the table": "將被移出表格的內容",
12
12
  "duplicated $1 attribute": "重複的$1屬性",
13
13
  "duplicated category": "重複的分類",
14
- "duplicated id": "重複的id",
14
+ "duplicated id/name": "重複的id/name",
15
15
  "duplicated image $1 parameter": "重複的圖片$1參數",
16
16
  "duplicated parameter": "重複參數",
17
17
  "extension tag in HTML tag attributes": "HTML標籤屬性中的擴展標籤",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wikiparser-node",
3
- "version": "1.13.5",
3
+ "version": "1.13.6",
4
4
  "description": "A Node.js parser for MediaWiki markup with AST",
5
5
  "keywords": [
6
6
  "mediawiki",