MCPcopy
hub / github.com/helloxz/onenav / code

Method code

templates/default2/assets/index.js:128–129  ·  view source on GitHub ↗
(t)

Source from the content-addressed store, hash-verified

126]`).replace("lheading",QN).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},t5=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,lEe=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,n5=/^( {2,}|\\)\n(?!\s*$)/,sEe=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,my=/[\p{P}\p{S}]/u,z_=/[\s\p{P}\p{S}]/u,o5=/[^\s\p{P}\p{S}]/u,iEe=Gn(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,z_).getRegex(),uEe=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,cEe=Gn(/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,"u").replace(/punct/g,my).getRegex(),dEe=Gn("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)","gu").replace(/notPunctSpace/g,o5).replace(/punctSpace/g,z_).replace(/punct/g,my).getRegex(),fEe=Gn("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,o5).replace(/punctSpace/g,z_).replace(/punct/g,my).getRegex(),pEe=Gn(/\\(punct)/,"gu").replace(/punct/g,my).getRegex(),hEe=Gn(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),vEe=Gn(V_).replace("(?:-->|$)","-->").getRegex(),gEe=Gn("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",vEe).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),t0=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,mEe=Gn(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",t0).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),r5=Gn(/^!?\[(label)\]\[(ref)\]/).replace("label",t0).replace("ref",F_).getRegex(),a5=Gn(/^!?\[(ref)\](?:\[\])?/).replace("ref",F_).getRegex(),yEe=Gn("reflink|nolink(?!\\()","g").replace("reflink",r5).replace("nolink",a5).getRegex(),W_={_backpedal:xp,anyPunctuation:pEe,autolink:hEe,blockSkip:uEe,br:n5,code:lEe,del:xp,emStrongLDelim:cEe,emStrongRDelimAst:dEe,emStrongRDelimUnd:fEe,escape:t5,link:mEe,nolink:a5,punctuation:iEe,reflink:r5,reflinkSearch:yEe,tag:gEe,text:sEe,url:xp},bEe={...W_,link:Gn(/^!?\[(label)\]\((.*?)\)/).replace("label",t0).getRegex(),reflink:Gn(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",t0).getRegex()},tS={...W_,escape:Gn(t5).replace("])","~|])").getRegex(),url:Gn(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},wEe={...tS,br:Gn(n5).replace("{2,}","*").getRegex(),text:Gn(tS.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Eg={normal:H_,gfm:rEe,pedantic:aEe},jf={normal:W_,gfm:tS,breaks:wEe,pedantic:bEe},SEe={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ZO=e=>SEe[e];function Ul(e,t){if(t){if(Fr.escapeTest.test(e))return e.replace(Fr.escapeReplace,ZO)}else if(Fr.escapeTestNoEncode.test(e))return e.replace(Fr.escapeReplaceNoEncode,ZO);return e}function JO(e){try{e=encodeURI(e).replace(Fr.percentDecode,"%")}catch{return null}return e}function QO(e,t){var l;const n=e.replace(Fr.findPipe,(a,s,i)=>{let u=!1,d=s;for(;--d>=0&&i[d]==="\\";)u=!u;return u?"|":" |"}),o=n.split(Fr.splitPipe);let r=0;if(o[0].trim()||o.shift(),o.length>0&&!((l=o.at(-1))!=null&&l.trim())&&o.pop(),t)if(o.length>t)o.splice(t);else for(;o.length<t;)o.push("");for(;r<o.length;r++)o[r]=o[r].trim().replace(Fr.slashPipe,"|");return o}function Uf(e,t,n){const o=e.length;if(o===0)return"";let r=0;for(;r<o;){const l=e.charAt(o-r-1);if(l===t&&!n)r++;else if(l!==t&&n)r++;else break}return e.slice(0,o-r)}function CEe(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let o=0;o<e.length;o++)if(e[o]==="\\")o++;else if(e[o]===t[0])n++;else if(e[o]===t[1]&&(n--,n<0))return o;return-1}function eI(e,t,n,o,r){const l=t.href,a=t.title||null,s=e[1].replace(r.other.outputLinkReplace,"$1");if(e[0].charAt(0)!=="!"){o.state.inLink=!0;const i={type:"link",raw:n,href:l,title:a,text:s,tokens:o.inlineTokens(s)};return o.state.inLink=!1,i}return{type:"image",raw:n,href:l,title:a,text:s}}function _Ee(e,t,n){const o=e.match(n.other.indentCodeCompensation);if(o===null)return t;const r=o[1];return t.split(`
127`).map(l=>{const a=l.match(n.other.beginningSpace);if(a===null)return l;const[s]=a;return s.length>=r.length?l.slice(r.length):l}).join(`
128`)}class n0{constructor(t){Zn(this,"options");Zn(this,"rules");Zn(this,"lexer");this.options=t||vc}space(t){const n=this.rules.block.newline.exec(t);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(t){const n=this.rules.block.code.exec(t);if(n){const o=n[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?o:Uf(o,`
129`)}}}fences(t){const n=this.rules.block.fences.exec(t);if(n){const o=n[0],r=_Ee(o,n[3]||"",this.rules);return{type:"code",raw:o,lang:n[2]?n[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):n[2],text:r}}}heading(t){const n=this.rules.block.heading.exec(t);if(n){let o=n[2].trim();if(this.rules.other.endingHash.test(o)){const r=Uf(o,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(o=r.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:o,tokens:this.lexer.inline(o)}}}hr(t){const n=this.rules.block.hr.exec(t);if(n)return{type:"hr",raw:Uf(n[0],`
130`)}}blockquote(t){const n=this.rules.block.blockquote.exec(t);if(n){let o=Uf(n[0],`
131`).split(`
132`),r="",l="";const a=[];for(;o.length>0;){let s=!1;const i=[];let u;for(u=0;u<o.length;u++)if(this.rules.other.blockquoteStart.test(o[u]))i.push(o[u]),s=!0;else if(!s)i.push(o[u]);else break;o=o.slice(u);const d=i.join(`

Callers 3

layui.jsFile · 0.45
blockTokensMethod · 0.45
parseMethod · 0.45

Calls 1

UfFunction · 0.70

Tested by

no test coverage detected