15 lines
38 KiB
JavaScript
Executable File
15 lines
38 KiB
JavaScript
Executable File
function smartypants(e){return e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function mangle(e){let t="",n,r;var i=e.length;for(n=0;n<i;n++)r=e.charCodeAt(n),.5<Math.random()&&(r="x"+r.toString(16)),t+="&#"+r+";";return t}class Lexer{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||defaults,this.options.tokenizer=this.options.tokenizer||new Tokenizer,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,(this.tokenizer.lexer=this).inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};e={block:block.normal,inline:inline.normal};this.options.pedantic?(e.block=block.pedantic,e.inline=inline.pedantic):this.options.gfm&&(e.block=block.gfm,this.options.breaks?e.inline=inline.breaks:e.inline=inline.gfm),this.tokenizer.rules=e}static get rules(){return{block:block,inline:inline}}static lex(e,t){return new Lexer(t).lex(e)}static lexInline(e,t){return new Lexer(t).inlineTokens(e)}lex(e){var t;for(e=e.replace(/\r\n|\r/g,"\n"),this.blockTokens(e,this.tokens);t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens}blockTokens(r,t=[]){r=this.options.pedantic?r.replace(/\t/g," ").replace(/^ +$/gm,""):r.replace(/^( *)(\t+)/gm,(e,t,n)=>t+" ".repeat(n.length));let n,e,i,s;for(;r;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(e=>!!(n=e.call({lexer:this},r,t))&&(r=r.substring(n.raw.length),t.push(n),!0))))if(n=this.tokenizer.space(r))r=r.substring(n.raw.length),1===n.raw.length&&0<t.length?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(r))r=r.substring(n.raw.length),!(e=t[t.length-1])||"paragraph"!==e.type&&"text"!==e.type?t.push(n):(e.raw+="\n"+n.raw,e.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=e.text);else if(n=this.tokenizer.fences(r))r=r.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(r))r=r.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(r))r=r.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(r))r=r.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(r))r=r.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(r))r=r.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(r))r=r.substring(n.raw.length),!(e=t[t.length-1])||"paragraph"!==e.type&&"text"!==e.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(e.raw+="\n"+n.raw,e.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=e.text);else if(n=this.tokenizer.table(r))r=r.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(r))r=r.substring(n.raw.length),t.push(n);else{if(i=r,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const a=r.slice(1);let n;this.options.extensions.startBlock.forEach(function(e){"number"==typeof(n=e.call({lexer:this},a))&&0<=n&&(t=Math.min(t,n))}),t<1/0&&0<=t&&(i=r.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(i)))e=t[t.length-1],s&&"paragraph"===e.type?(e.raw+="\n"+n.raw,e.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=e.text):t.push(n),s=i.length!==r.length,r=r.substring(n.raw.length);else if(n=this.tokenizer.text(r))r=r.substring(n.raw.length),(e=t[t.length-1])&&"text"===e.type?(e.raw+="\n"+n.raw,e.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=e.text):t.push(n);else if(r){var l="Infinite loop on byte: "+r.charCodeAt(0);if(this.options.silent){console.error(l);break}throw new Error(l)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(r,t=[]){let n,e,i,s=r,l,a,o;if(this.tokens.links){var c=Object.keys(this.tokens.links);if(0<c.length)for(;null!=(l=this.tokenizer.rules.inline.reflinkSearch.exec(s));)c.includes(l[0].slice(l[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,l.index)+"["+repeatString("a",l[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(l=this.tokenizer.rules.inline.blockSkip.exec(s));)s=s.slice(0,l.index)+"["+repeatString("a",l[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(l=this.tokenizer.rules.inline.escapedEmSt.exec(s));)s=s.slice(0,l.index+l[0].length-2)+"++"+s.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;r;)if(a||(o=""),a=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(e=>!!(n=e.call({lexer:this},r,t))&&(r=r.substring(n.raw.length),t.push(n),!0))))if(n=this.tokenizer.escape(r))r=r.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(r))r=r.substring(n.raw.length),(e=t[t.length-1])&&"text"===n.type&&"text"===e.type?(e.raw+=n.raw,e.text+=n.text):t.push(n);else if(n=this.tokenizer.link(r))r=r.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(r,this.tokens.links))r=r.substring(n.raw.length),(e=t[t.length-1])&&"text"===n.type&&"text"===e.type?(e.raw+=n.raw,e.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(r,s,o))r=r.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(r))r=r.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(r))r=r.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(r))r=r.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(r,mangle))r=r.substring(n.raw.length),t.push(n);else if(!this.state.inLink&&(n=this.tokenizer.url(r,mangle)))r=r.substring(n.raw.length),t.push(n);else{if(i=r,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const h=r.slice(1);let n;this.options.extensions.startInline.forEach(function(e){"number"==typeof(n=e.call({lexer:this},h))&&0<=n&&(t=Math.min(t,n))}),t<1/0&&0<=t&&(i=r.substring(0,t+1))}if(n=this.tokenizer.inlineText(i,smartypants))r=r.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(o=n.raw.slice(-1)),a=!0,(e=t[t.length-1])&&"text"===e.type?(e.raw+=n.raw,e.text+=n.text):t.push(n);else if(r){var p="Infinite loop on byte: "+r.charCodeAt(0);if(this.options.silent){console.error(p);break}throw new Error(p)}}return t}}class Parser{constructor(e){this.options=e||defaults,this.options.renderer=this.options.renderer||new Renderer,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new TextRenderer,this.slugger=new Slugger}static parse(e,t){return new Parser(t).parse(e)}static parseInline(e,t){return new Parser(t).parseInline(e)}parse(e,t=!0){let n="",r,i,s,l,a,o,c,p,h,u,g,k,d,f,m,x,b,w,_;var y=e.length;for(r=0;r<y;r++)if(u=e[r],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[u.type]&&(!1!==(_=this.options.extensions.renderers[u.type].call({parser:this},u))||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(u.type)))n+=_||"";else switch(u.type){case"space":continue;case"hr":n+=this.renderer.hr();continue;case"heading":n+=this.renderer.heading(this.parseInline(u.tokens),u.depth,unescape(this.parseInline(u.tokens,this.textRenderer)),this.slugger);continue;case"code":n+=this.renderer.code(u.text,u.lang,u.escaped);continue;case"table":for(p="",c="",l=u.header.length,i=0;i<l;i++)c+=this.renderer.tablecell(this.parseInline(u.header[i].tokens),{header:!0,align:u.align[i]});for(p+=this.renderer.tablerow(c),h="",l=u.rows.length,i=0;i<l;i++){for(o=u.rows[i],c="",a=o.length,s=0;s<a;s++)c+=this.renderer.tablecell(this.parseInline(o[s].tokens),{header:!1,align:u.align[s]});h+=this.renderer.tablerow(c)}n+=this.renderer.table(p,h);continue;case"blockquote":h=this.parse(u.tokens),n+=this.renderer.blockquote(h);continue;case"list":for(g=u.ordered,k=u.start,d=u.loose,l=u.items.length,h="",i=0;i<l;i++)x=(m=u.items[i]).checked,b=m.task,f="",m.task&&(w=this.renderer.checkbox(x),d?0<m.tokens.length&&"paragraph"===m.tokens[0].type?(m.tokens[0].text=w+" "+m.tokens[0].text,m.tokens[0].tokens&&0<m.tokens[0].tokens.length&&"text"===m.tokens[0].tokens[0].type&&(m.tokens[0].tokens[0].text=w+" "+m.tokens[0].tokens[0].text)):m.tokens.unshift({type:"text",text:w}):f+=w),f+=this.parse(m.tokens,d),h+=this.renderer.listitem(f,b,x);n+=this.renderer.list(h,g,k);continue;case"html":n+=this.renderer.html(u.text);continue;case"paragraph":n+=this.renderer.paragraph(this.parseInline(u.tokens));continue;case"text":for(h=u.tokens?this.parseInline(u.tokens):u.text;r+1<y&&"text"===e[r+1].type;)u=e[++r],h+="\n"+(u.tokens?this.parseInline(u.tokens):u.text);n+=t?this.renderer.paragraph(h):h;continue;default:var $='Token with "'+u.type+'" type was not found.';if(this.options.silent)return void console.error($);throw new Error($)}return n}parseInline(e,t){t=t||this.renderer;let n="",r,i,s;var l=e.length;for(r=0;r<l;r++)if(i=e[r],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]&&(!1!==(s=this.options.extensions.renderers[i.type].call({parser:this},i))||!["escape","html","link","image","video","audio","strong","em","codespan","br","del","text"].includes(i.type)))n+=s||"";else switch(i.type){case"escape":n+=t.text(i.text);break;case"html":n+=t.html(i.text);break;case"link":n+=t.link(i.href,i.title,this.parseInline(i.tokens,t));break;case"image":n+=t.image(i.href,i.title,i.text);break;case"video":n+=t.video(i.href,i.title,i.text);break;case"audio":n+=t.audio(i.href,i.title,i.text);break;case"strong":n+=t.strong(this.parseInline(i.tokens,t));break;case"em":n+=t.em(this.parseInline(i.tokens,t));break;case"codespan":n+=t.codespan(i.text);break;case"br":n+=t.br();break;case"del":n+=t.del(this.parseInline(i.tokens,t));break;case"text":n+=t.text(i.text);break;default:var a='Token with "'+i.type+'" type was not found.';if(this.options.silent)return void console.error(a);throw new Error(a)}return n}}class Renderer{constructor(e){this.options=e||defaults}code(e,t,n){var r,t=(t||"").match(/\S*/)[0];return this.options.highlight&&null!=(r=this.options.highlight(e,t))&&r!==e&&(n=!0,e=r),e=e.replace(/\n$/,"")+"\n",t?'<pre><code class="'+this.options.langPrefix+escape(t)+'">'+(n?e:escape(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:escape(e,!0))+"</code></pre>\n"}blockquote(e){return`<blockquote>
|
||
${e}</blockquote>
|
||
`}html(e){return e}heading(e,t,n,r){return this.options.headerIds?`<h${t} id="${this.options.headerPrefix+r.slug(n)}">${e}</h${t}>
|
||
`:`<h${t}>${e}</h${t}>
|
||
`}hr(){return this.options.xhtml?"<hr/>\n":"<hr>\n"}list(e,t,n){var r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"}listitem(e){return`<li>${e}</li>
|
||
`}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "}paragraph(e){return`<p>${e}</p>
|
||
`}table(e,t){return"<table>\n<thead>\n"+e+"</thead>\n"+(t=t&&`<tbody>${t}</tbody>`)+"</table>\n"}tablerow(e){return`<tr>
|
||
${e}</tr>
|
||
`}tablecell(e,t){var n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
|
||
`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return this.options.xhtml?"<br/>":"<br>"}del(e){return`<del>${e}</del>`}link(e,t,n){if(null===(e=cleanUrl(this.options.sanitize,this.options.baseUrl,e)))return n;let r='<a href="'+e+'"';return t&&(r+=' title="'+t+'"'),r+=">"+n+"</a>"}image(e,t,n){if(null===(e=cleanUrl(this.options.sanitize,this.options.baseUrl,e)))return n;let r=`<img src="${e}" alt="${n}"`;return t&&(r+=` title="${t}"`),r+=this.options.xhtml?"/>":">"}video(e,t,n){return null===(e=cleanUrl(this.options.sanitize,this.options.baseUrl,e))?n:`<video controls width="100%" alt="${n}" >
|
||
<source src="${e}" ></source>
|
||
</video>`}audio(e,t,n){return null===(e=cleanUrl(this.options.sanitize,this.options.baseUrl,e))?n:`<audio controls width="100%" alt="${n}" >
|
||
<source src="${e}" ></source>
|
||
</audio>`}text(e){return e}}class Slugger{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let n=e,r=0;if(this.seen.hasOwnProperty(n))for(r=this.seen[e];r++,n=e+"-"+r,this.seen.hasOwnProperty(n););return t||(this.seen[e]=r,this.seen[n]=0),n}slug(e,t={}){e=this.serialize(e);return this.getNextSafeSlug(e,t.dryrun)}}class TextRenderer{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}video(e,t,n){return""+n}audio(e,t,n){return""+n}br(){return""}}function outputLink(e,t,n,r){var i=t.href,s=t.title?escape(t.title):null,l=e[1].replace(/\\([\[\]])/g,"$1");return console.log("outputLink() link=",t,"====================="),"!"!==e[0].charAt(0)?(r.state.inLink=!0,t={type:"link",raw:n,href:i,title:s,text:l,tokens:r.inlineTokens(l)},r.state.inLink=!1,console.log("outputLink(): cap=",e[0],"return a link"),t):e[0].startsWith("!v")?(console.log("outputLink(): cap=",e[0],"return a video"),{type:"video",raw:n,href:i,title:s,text:escape(l)}):e[0].startsWith("!a")?(console.log("outputLink(): cap=",e[0],"return a audio"),{type:"audio",raw:n,href:i,title:s,text:escape(l)}):(console.log("outputLink(): cap=",e[0],"return a image"),{type:"image",raw:n,href:i,title:s,text:escape(l)})}function indentCodeCompensation(e,t){e=e.match(/^(\s+)(?:```)/);if(null===e)return t;const n=e[1];return t.split("\n").map(e=>{var t=e.match(/^\s+/);return null!==t&&([t]=t,t.length>=n.length)?e.slice(n.length):e}).join("\n")}class Tokenizer{constructor(e){this.options=e||defaults}space(e){e=this.rules.block.newline.exec(e);if(e&&0<e[0].length)return{type:"space",raw:e[0]}}code(e){var t,e=this.rules.block.code.exec(e);if(e)return t=e[0].replace(/^ {1,4}/gm,""),{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:rtrim(t,"\n")}}fences(e){var t,n,e=this.rules.block.fences.exec(e);if(e)return n=indentCodeCompensation(t=e[0],e[3]||""),{type:"code",raw:t,lang:e[2]&&e[2].trim().replace(this.rules.inline._escapes,"$1"),text:n}}heading(t){var n,t=this.rules.block.heading.exec(t);if(t){let e=t[2].trim();return/#$/.test(e)&&(n=rtrim(e,"#"),!this.options.pedantic&&n&&!/ $/.test(n)||(e=n.trim())),{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){e=this.rules.block.hr.exec(e);if(e)return{type:"hr",raw:e[0]}}blockquote(e){var t,n,r,e=this.rules.block.blockquote.exec(e);if(e)return t=e[0].replace(/^ *>[ \t]?/gm,""),n=this.lexer.state.top,this.lexer.state.top=!0,r=this.lexer.blockTokens(t),this.lexer.state.top=n,{type:"blockquote",raw:e[0],tokens:r,text:t}}list(g){let k=this.rules.block.list.exec(g);if(k){let e,t,n,r,i,s,l,a,o,c,p,h,u=k[1].trim();for(var d=1<u.length,f={type:"list",raw:"",ordered:d,start:d?+u.slice(0,-1):"",loose:!1,items:[]},m=(u=d?"\\d{1,9}\\"+u.slice(-1):"\\"+u,this.options.pedantic&&(u=d?u:"[*+-]"),new RegExp(`^( {0,3}${u})((?:[ ][^\\n]*)?(?:\\n|$))`));g&&(h=!1,k=m.exec(g))&&!this.rules.block.hr.test(g);){if(e=k[0],g=g.substring(e.length),a=k[2].split("\n",1)[0].replace(/^\t+/,e=>" ".repeat(3*e.length)),o=g.split("\n",1)[0],this.options.pedantic?(r=2,p=a.trimLeft()):(r=4<(r=k[2].search(/[^ ]/))?1:r,p=a.slice(r),r+=k[1].length),s=!1,!a&&/^ *$/.test(o)&&(e+=o+"\n",g=g.substring(o.length+1),h=!0),!h)for(var x=new RegExp(`^ {0,${Math.min(3,r-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),b=new RegExp(`^ {0,${Math.min(3,r-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),w=new RegExp(`^ {0,${Math.min(3,r-1)}}(?:\`\`\`|~~~)`),_=new RegExp(`^ {0,${Math.min(3,r-1)}}#`);g&&(c=g.split("\n",1)[0],o=c,this.options.pedantic&&(o=o.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!w.test(o))&&!_.test(o)&&!x.test(o)&&!b.test(g);){if(o.search(/[^ ]/)>=r||!o.trim())p+="\n"+o.slice(r);else{if(s)break;if(4<=a.search(/[^ ]/))break;if(w.test(a))break;if(_.test(a))break;if(b.test(a))break;p+="\n"+o}s||o.trim()||(s=!0),e+=c+"\n",g=g.substring(c.length+1),a=o.slice(r)}f.loose||(l?f.loose=!0:/\n *\n *$/.test(e)&&(l=!0)),this.options.gfm&&(t=/^\[[ xX]\] /.exec(p))&&(n="[ ] "!==t[0],p=p.replace(/^\[[ xX]\] +/,"")),f.items.push({type:"list_item",raw:e,task:!!t,checked:n,loose:!1,text:p}),f.raw+=e}f.items[f.items.length-1].raw=e.trimRight(),f.items[f.items.length-1].text=p.trimRight(),f.raw=f.raw.trimRight();var y,$=f.items.length;for(i=0;i<$;i++)this.lexer.state.top=!1,f.items[i].tokens=this.lexer.blockTokens(f.items[i].text,[]),f.loose||(y=0<(y=f.items[i].tokens.filter(e=>"space"===e.type)).length&&y.some(e=>/\n.*\n/.test(e.raw)),f.loose=y);if(f.loose)for(i=0;i<$;i++)f.items[i].loose=!0;return f}}html(e){var t,e=this.rules.block.html.exec(e);if(e)return t={type:"html",raw:e[0],pre:!this.options.sanitizer&&("pre"===e[1]||"script"===e[1]||"style"===e[1]),text:e[0]},this.options.sanitize&&(e=this.options.sanitizer?this.options.sanitizer(e[0]):escape(e[0]),t.type="paragraph",t.text=e,t.tokens=this.lexer.inline(e)),t}def(e){var t,n,r,e=this.rules.block.def.exec(e);if(e)return t=e[1].toLowerCase().replace(/\s+/g," "),n=e[2]?e[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",r=e[3]&&e[3].substring(1,e[3].length-1).replace(this.rules.inline._escapes,"$1"),{type:"def",tag:t,raw:e[0],href:n,title:r}}table(s){s=this.rules.block.table.exec(s);if(s){var l={type:"table",header:splitCells(s[1]).map(e=>({text:e})),align:s[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:s[3]&&s[3].trim()?s[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(l.header.length===l.align.length){l.raw=s[0];let e=l.align.length,t,n,r,i;for(t=0;t<e;t++)/^ *-+: *$/.test(l.align[t])?l.align[t]="right":/^ *:-+: *$/.test(l.align[t])?l.align[t]="center":/^ *:-+ *$/.test(l.align[t])?l.align[t]="left":l.align[t]=null;for(e=l.rows.length,t=0;t<e;t++)l.rows[t]=splitCells(l.rows[t],l.header.length).map(e=>({text:e}));for(e=l.header.length,n=0;n<e;n++)l.header[n].tokens=this.lexer.inline(l.header[n].text);for(e=l.rows.length,n=0;n<e;n++)for(i=l.rows[n],r=0;r<i.length;r++)i[r].tokens=this.lexer.inline(i[r].text);return l}}}lheading(e){e=this.rules.block.lheading.exec(e);if(e)return{type:"heading",raw:e[0],depth:"="===e[2].charAt(0)?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(e){var t,e=this.rules.block.paragraph.exec(e);if(e)return t="\n"===e[1].charAt(e[1].length-1)?e[1].slice(0,-1):e[1],{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}text(e){e=this.rules.block.text.exec(e);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(e){e=this.rules.inline.escape.exec(e);if(e)return{type:"escape",raw:e[0],text:escape(e[1])}}tag(e){e=this.rules.inline.tag.exec(e);if(e)return!this.lexer.state.inLink&&/^<a /i.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(e[0]):escape(e[0]):e[0]}}link(n){n=this.rules.inline.link.exec(n);if(n){var r=n[2].trim();if(!this.options.pedantic&&/^</.test(r)){if(!/>$/.test(r))return;var i=rtrim(r.slice(0,-1),"\\");if((r.length-i.length)%2==0)return}else{var s,i=findClosingBracket(n[2],"()");-1<i&&(s=(0===n[0].indexOf("!")?5:4)+n[1].length+i,n[2]=n[2].substring(0,i),n[0]=n[0].substring(0,s).trim(),n[3]="")}let e=n[2],t="";return this.options.pedantic?(i=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(e))&&(e=i[1],t=i[3]):t=n[3]?n[3].slice(1,-1):"",e=e.trim(),outputLink(n,{href:(e=/^</.test(e)?this.options.pedantic&&!/>$/.test(r)?e.slice(1):e.slice(1,-1):e)&&e.replace(this.rules.inline._escapes,"$1"),title:t&&t.replace(this.rules.inline._escapes,"$1")},n[0],this.lexer)}}reflink(t,n){let r;if(r=(r=this.rules.inline.reflink.exec(t))||this.rules.inline.nolink.exec(t)){let e=(r[2]||r[1]).replace(/\s+/g," ");return(e=n[e.toLowerCase()])?outputLink(r,e,r[0],this.lexer):{type:"text",raw:t=r[0].charAt(0),text:t}}}emStrong(i,s,e=""){let l=this.rules.inline.emStrong.lDelim.exec(i);if(l&&(!l[3]||!e.match(/[\p{L}\p{N}]/u))){var t=l[1]||l[2]||"";if(!t||""===e||this.rules.inline.punctuation.exec(e)){var a=l[0].length-1;let e,t,n=a,r=0;var o,c,p="*"===l[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(p.lastIndex=0,s=s.slice(-1*i.length+a);null!=(l=p.exec(s));)if(e=l[1]||l[2]||l[3]||l[4]||l[5]||l[6])if(t=e.length,l[3]||l[4])n+=t;else if((l[5]||l[6])&&a%3&&!((a+t)%3))r+=t;else if(!(0<(n-=t)))return t=Math.min(t,t+n+r),o=i.slice(0,a+l.index+(l[0].length-e.length)+t),Math.min(a,t)%2?(c=o.slice(1,-1),{type:"em",raw:o,text:c,tokens:this.lexer.inlineTokens(c)}):(c=o.slice(2,-2),{type:"strong",raw:o,text:c,tokens:this.lexer.inlineTokens(c)})}}}codespan(t){t=this.rules.inline.code.exec(t);if(t){let e=t[2].replace(/\n/g," ");var n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return e=escape(e=n&&r?e.substring(1,e.length-1):e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){e=this.rules.inline.br.exec(e);if(e)return{type:"br",raw:e[0]}}del(e){e=this.rules.inline.del.exec(e);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(n,r){n=this.rules.inline.autolink.exec(n);if(n){let e,t;return t="@"===n[2]?"mailto:"+(e=escape(this.options.mangle?r(n[1]):n[1])):e=escape(n[1]),{type:"link",raw:n[0],text:e,href:t,tokens:[{type:"text",raw:e,text:e}]}}}url(e,n){var r,i;if(r=this.rules.inline.url.exec(e)){let e,t;if("@"===r[2])e=escape(this.options.mangle?n(r[0]):r[0]),t="mailto:"+e;else{for(;i=r[0],r[0]=this.rules.inline._backpedal.exec(r[0])[0],i!==r[0];);e=escape(r[0]),t="www."===r[1]?"http://"+r[0]:r[0]}return{type:"link",raw:r[0],text:e,href:t,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(t,n){t=this.rules.inline.text.exec(t);if(t){let e;return e=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):escape(t[0]):t[0]:escape(this.options.smartypants?n(t[0]):t[0]),{type:"text",raw:t[0],text:e}}}}function getDefaults(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let defaults=getDefaults();function changeDefaults(e){defaults=e}const escapeTest=/[&<>"']/,escapeReplace=new RegExp(escapeTest.source,"g"),escapeTestNoEncode=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode=new RegExp(escapeTestNoEncode.source,"g"),escapeReplacements={"&":"&","<":"<",">":">",'"':""","'":"'"},getEscapeReplacement=e=>escapeReplacements[e];function escape(e,t){if(t){if(escapeTest.test(e))return e.replace(escapeReplace,getEscapeReplacement)}else if(escapeTestNoEncode.test(e))return e.replace(escapeReplaceNoEncode,getEscapeReplacement);return e}const unescapeTest=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function unescape(e){return e.replace(unescapeTest,(e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):"")}const caret=/(^|[^\[])\^/g;function edit(n,e){n="string"==typeof n?n:n.source,e=e||"";const r={replace:(e,t)=>(t=(t=t.source||t).replace(caret,"$1"),n=n.replace(e,t),r),getRegex:()=>new RegExp(n,e)};return r}const nonWordAndColonTest=/[^\w:]/g,originIndependentUrl=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function cleanUrl(e,t,n){if(e){let e;try{e=decodeURIComponent(unescape(n)).replace(nonWordAndColonTest,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!originIndependentUrl.test(n)&&(n=resolveUrl(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n}const baseUrls={},justDomain=/^[^:]+:\/*[^/]*$/,protocol=/^([^:]+:)[\s\S]*$/,domain=/^([^:]+:\/*[^/]*)[\s\S]*$/;function resolveUrl(e,t){baseUrls[" "+e]||(justDomain.test(e)?baseUrls[" "+e]=e+"/":baseUrls[" "+e]=rtrim(e,"/",!0));var n=-1===(e=baseUrls[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(protocol,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(domain,"$1")+t:e+t}const noopTest={exec:function(){}};function merge(e){let t=1,n,r;for(;t<arguments.length;t++)for(r in n=arguments[t])Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r]);return e}function splitCells(e,t){var n=e.replace(/\|/g,(e,t,n)=>{let r=!1,i=t;for(;0<=--i&&"\\"===n[i];)r=!r;return r?"|":" |"}).split(/ \|/);let r=0;if(n[0].trim()||n.shift(),0<n.length&&!n[n.length-1].trim()&&n.pop(),n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,"|");return n}function rtrim(e,t,n){var r=e.length;if(0===r)return"";let i=0;for(;i<r;){var s=e.charAt(r-i-1);if((s!==t||n)&&(s===t||!n))break;i++}return e.slice(0,r-i)}function findClosingBracket(n,r){if(-1!==n.indexOf(r[1])){var i=n.length;let e=0,t=0;for(;t<i;t++)if("\\"===n[t])t++;else if(n[t]===r[0])e++;else if(n[t]===r[1]&&--e<0)return t}return-1}function checkSanitizeDeprecation(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function repeatString(e,t){if(t<1)return"";let n="";for(;1<t;)1&t&&(n+=e),t>>=1,e+=e;return n+e}function marked(e,i,s){if(null==e)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");if("function"==typeof i&&(s=i,i=null),checkSanitizeDeprecation(i=merge({},marked.defaults,i||{})),s){const l=i.highlight;let n;try{n=Lexer.lex(e,i)}catch(e){return s(e)}const a=function(t){let e;if(!t)try{i.walkTokens&&marked.walkTokens(n,i.walkTokens),e=Parser.parse(n,i)}catch(e){t=e}return i.highlight=l,t?s(t):s(null,e)};if(!l||l.length<3)return a();if(delete i.highlight,!n.length)return a();let r=0;marked.walkTokens(n,function(n){"code"===n.type&&(r++,setTimeout(()=>{l(n.text,n.lang,function(e,t){if(e)return a(e);null!=t&&t!==n.text&&(n.text=t,n.escaped=!0),0===--r&&a()})},0))}),void(0===r&&a())}else try{const n=Lexer.lex(e,i);if(i.walkTokens){if(i.async)return Promise.all(marked.walkTokens(n,i.walkTokens)).then(()=>Parser.parse(n,i)).catch(t);marked.walkTokens(n,i.walkTokens)}return Parser.parse(n,i)}catch(e){t(e)}function t(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",i.silent)return"<p>An error occurred:</p><pre>"+escape(e.message+"",!0)+"</pre>";throw e}}marked.options=marked.setOptions=function(e){return merge(marked.defaults,e),changeDefaults(marked.defaults),marked},marked.getDefaults=getDefaults,marked.defaults=defaults,marked.use=function(...e){const t=marked.defaults.extensions||{renderers:{},childTokens:{}};e.forEach(n=>{var e=merge({},n);if(e.async=marked.defaults.async||e.async,n.extensions&&(n.extensions.forEach(n=>{if(!n.name)throw new Error("extension name required");if(n.renderer){const r=t.renderers[n.name];r?t.renderers[n.name]=function(...e){let t=n.renderer.apply(this,e);return t=!1===t?r.apply(this,e):t}:t.renderers[n.name]=n.renderer}if(n.tokenizer){if(!n.level||"block"!==n.level&&"inline"!==n.level)throw new Error("extension level must be 'block' or 'inline'");t[n.level]?t[n.level].unshift(n.tokenizer):t[n.level]=[n.tokenizer],n.start&&("block"===n.level?t.startBlock?t.startBlock.push(n.start):t.startBlock=[n.start]:"inline"===n.level&&(t.startInline?t.startInline.push(n.start):t.startInline=[n.start]))}n.childTokens&&(t.childTokens[n.name]=n.childTokens)}),e.extensions=t),n.renderer){const r=marked.defaults.renderer||new Renderer;for(const i in n.renderer){const s=r[i];r[i]=(...e)=>{let t=n.renderer[i].apply(r,e);return t=!1===t?s.apply(r,e):t}}e.renderer=r}if(n.tokenizer){const l=marked.defaults.tokenizer||new Tokenizer;for(const a in n.tokenizer){const o=l[a];l[a]=(...e)=>{let t=n.tokenizer[a].apply(l,e);return t=!1===t?o.apply(l,e):t}}e.tokenizer=l}if(n.walkTokens){const c=marked.defaults.walkTokens;e.walkTokens=function(e){let t=[];return t.push(n.walkTokens.call(this,e)),t=c?t.concat(c.call(this,e)):t}}marked.setOptions(e)})},marked.walkTokens=function(e,t){let n=[];for(const r of e)switch(n=n.concat(t.call(marked,r)),r.type){case"table":for(const i of r.header)n=n.concat(marked.walkTokens(i.tokens,t));for(const s of r.rows)for(const l of s)n=n.concat(marked.walkTokens(l.tokens,t));break;case"list":n=n.concat(marked.walkTokens(r.items,t));break;default:marked.defaults.extensions&&marked.defaults.extensions.childTokens&&marked.defaults.extensions.childTokens[r.type]?marked.defaults.extensions.childTokens[r.type].forEach(function(e){n=n.concat(marked.walkTokens(r[e],t))}):r.tokens&&(n=n.concat(marked.walkTokens(r.tokens,t)))}return n},marked.parseInline=function(e,t){if(null==e)throw new Error("marked.parseInline(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");checkSanitizeDeprecation(t=merge({},marked.defaults,t||{}));try{var n=Lexer.lexInline(e,t);return t.walkTokens&&marked.walkTokens(n,t.walkTokens),Parser.parseInline(n,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+escape(e.message+"",!0)+"</pre>";throw e}},marked.Parser=Parser,marked.parser=Parser.parse,marked.Renderer=Renderer,marked.TextRenderer=TextRenderer,marked.Lexer=Lexer,marked.lexer=Lexer.lex,marked.Tokenizer=Tokenizer,marked.Slugger=Slugger;const options=(marked.parse=marked).options,setOptions=marked.setOptions,use=marked.use,walkTokens=marked.walkTokens,parseInline=marked.parseInline,parse=marked,parser=Parser.parse,lexer=Lexer.lex,block={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:noopTest,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/},inline=(block.def=edit(block.def).replace("label",block._label).replace("title",block._title).getRegex(),block.bullet=/(?:[*+-]|\d{1,9}[.)])/,block.listItemStart=edit(/^( *)(bull) */).replace("bull",block.bullet).getRegex(),block.list=edit(block.list).replace(/bull/g,block.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+block.def.source+")").getRegex(),block._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",block._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,block.html=edit(block.html,"i").replace("comment",block._comment).replace("tag",block._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),block.paragraph=edit(block._paragraph).replace("hr",block.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",block._tag).getRegex(),block.blockquote=edit(block.blockquote).replace("paragraph",block.paragraph).getRegex(),block.normal=merge({},block),block.gfm=merge({},block.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),block.gfm.table=edit(block.gfm.table).replace("hr",block.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",block._tag).getRegex(),block.gfm.paragraph=edit(block._paragraph).replace("hr",block.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",block.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",block._tag).getRegex(),block.pedantic=merge({},block.normal,{html:edit("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",block._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:noopTest,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:edit(block.normal._paragraph).replace("hr",block.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",block.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()}),{escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:noopTest,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^(?:![va]?)?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:noopTest,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/,_punctuation:"!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~"});inline.punctuation=edit(inline.punctuation).replace(/punctuation/g,inline._punctuation).getRegex(),inline.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,inline.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g,inline._comment=edit(block._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),inline.emStrong.lDelim=edit(inline.emStrong.lDelim).replace(/punct/g,inline._punctuation).getRegex(),inline.emStrong.rDelimAst=edit(inline.emStrong.rDelimAst,"g").replace(/punct/g,inline._punctuation).getRegex(),inline.emStrong.rDelimUnd=edit(inline.emStrong.rDelimUnd,"g").replace(/punct/g,inline._punctuation).getRegex(),inline._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,inline._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,inline._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])?)+(?![-_])/,inline.autolink=edit(inline.autolink).replace("scheme",inline._scheme).replace("email",inline._email).getRegex(),inline._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,inline.tag=edit(inline.tag).replace("comment",inline._comment).replace("attribute",inline._attribute).getRegex(),inline._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,inline._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,inline._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,inline.link=edit(inline.link).replace("label",inline._label).replace("href",inline._href).replace("title",inline._title).getRegex(),inline.reflink=edit(inline.reflink).replace("label",inline._label).replace("ref",block._label).getRegex(),inline.nolink=edit(inline.nolink).replace("ref",block._label).getRegex(),inline.reflinkSearch=edit(inline.reflinkSearch,"g").replace("reflink",inline.reflink).replace("nolink",inline.nolink).getRegex(),inline.normal=merge({},inline),inline.pedantic=merge({},inline.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:edit(/^(?:![va]?)?\[(label)\]\((.*?)\)/).replace("label",inline._label).getRegex(),reflink:edit(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",inline._label).getRegex()}),inline.gfm=merge({},inline.normal,{escape:edit(inline.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\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.!#$%&'*+\/=?_`{\|}~-]+@)))/}),inline.gfm.url=edit(inline.gfm.url,"i").replace("email",inline.gfm._extended_email).getRegex(),inline.breaks=merge({},inline.gfm,{br:edit(inline.br).replace("{2,}","*").getRegex(),text:edit(inline.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});
|