<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">import{NodeProp as e,Tree as t,NodeType as s,Parser as n,NodeSet as r,parseMixed as i}from"@lezer/common";import{Tag as l,styleTags as a,tags as o}from"@lezer/highlight";class CompositeBlock{static create(e,t,s,n,r){let i=n+(n&lt;&lt;8)+e+(t&lt;&lt;4)|0;return new CompositeBlock(e,t,s,i,r,[],[])}constructor(t,s,n,r,i,l,a){this.type=t;this.value=s;this.from=n;this.hash=r;this.end=i;this.children=l;this.positions=a;this.hashProp=[[e.contextHash,r]]}addChild(s,n){s.prop(e.contextHash)!=this.hash&amp;&amp;(s=new t(s.type,s.children,s.positions,s.length,this.hashProp));this.children.push(s);this.positions.push(n)}toTree(e,n=this.end){let r=this.children.length-1;r&gt;=0&amp;&amp;(n=Math.max(n,this.positions[r]+this.children[r].length+this.from));return new t(e.types[this.type],this.children,this.positions,n-this.from).balance({makeTree:(e,n,r)=&gt;new t(s.none,e,n,r,this.hashProp)})}}var h;(function(e){e[e.Document=1]="Document";e[e.CodeBlock=2]="CodeBlock";e[e.FencedCode=3]="FencedCode";e[e.Blockquote=4]="Blockquote";e[e.HorizontalRule=5]="HorizontalRule";e[e.BulletList=6]="BulletList";e[e.OrderedList=7]="OrderedList";e[e.ListItem=8]="ListItem";e[e.ATXHeading1=9]="ATXHeading1";e[e.ATXHeading2=10]="ATXHeading2";e[e.ATXHeading3=11]="ATXHeading3";e[e.ATXHeading4=12]="ATXHeading4";e[e.ATXHeading5=13]="ATXHeading5";e[e.ATXHeading6=14]="ATXHeading6";e[e.SetextHeading1=15]="SetextHeading1";e[e.SetextHeading2=16]="SetextHeading2";e[e.HTMLBlock=17]="HTMLBlock";e[e.LinkReference=18]="LinkReference";e[e.Paragraph=19]="Paragraph";e[e.CommentBlock=20]="CommentBlock";e[e.ProcessingInstructionBlock=21]="ProcessingInstructionBlock";e[e.Escape=22]="Escape";e[e.Entity=23]="Entity";e[e.HardBreak=24]="HardBreak";e[e.Emphasis=25]="Emphasis";e[e.StrongEmphasis=26]="StrongEmphasis";e[e.Link=27]="Link";e[e.Image=28]="Image";e[e.InlineCode=29]="InlineCode";e[e.HTMLTag=30]="HTMLTag";e[e.Comment=31]="Comment";e[e.ProcessingInstruction=32]="ProcessingInstruction";e[e.Autolink=33]="Autolink";e[e.HeaderMark=34]="HeaderMark";e[e.QuoteMark=35]="QuoteMark";e[e.ListMark=36]="ListMark";e[e.LinkMark=37]="LinkMark";e[e.EmphasisMark=38]="EmphasisMark";e[e.CodeMark=39]="CodeMark";e[e.CodeText=40]="CodeText";e[e.CodeInfo=41]="CodeInfo";e[e.LinkTitle=42]="LinkTitle";e[e.LinkLabel=43]="LinkLabel";e[e.URL=44]="URL"})(h||(h={}));class LeafBlock{constructor(e,t){this.start=e;this.content=t;this.marks=[];this.parsers=[]}}class Line{constructor(){this.text="";this.baseIndent=0;this.basePos=0;this.depth=0;this.markers=[];this.pos=0;this.indent=0;this.next=-1}forward(){this.basePos&gt;this.pos&amp;&amp;this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent);this.pos=e;this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return skipSpace(this.text,e)}reset(e){this.text=e;this.baseIndent=this.basePos=this.pos=this.indent=0;this.forwardInner();this.depth=1;while(this.markers.length)this.markers.pop()}moveBase(e){this.basePos=e;this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e;this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,t=0,s=0){for(let n=t;n&lt;e;n++)s+=this.text.charCodeAt(n)==9?4-s%4:1;return s}findColumn(e){let t=0;for(let s=0;t&lt;this.text.length&amp;&amp;s&lt;e;t++)s+=this.text.charCodeAt(t)==9?4-s%4:1;return t}scrub(){if(!this.baseIndent)return this.text;let e="";for(let t=0;t&lt;this.basePos;t++)e+=" ";return e+this.text.slice(this.basePos)}}function skipForList(e,t,s){if(s.pos==s.text.length||e!=t.block&amp;&amp;s.indent&gt;=t.stack[s.depth+1].value+s.baseIndent)return true;if(s.indent&gt;=s.baseIndent+4)return false;let n=(e.type==h.OrderedList?isOrderedList:isBulletList)(s,t,false);return n&gt;0&amp;&amp;(e.type!=h.BulletList||isHorizontalRule(s,t,false)&lt;0)&amp;&amp;s.text.charCodeAt(s.pos+n-1)==e.value}const f={[h.Blockquote](e,t,s){if(s.next!=62)return false;s.markers.push(elt(h.QuoteMark,t.lineStart+s.pos,t.lineStart+s.pos+1));s.moveBase(s.pos+(space(s.text.charCodeAt(s.pos+1))?2:1));e.end=t.lineStart+s.text.length;return true},[h.ListItem](e,t,s){if(s.indent&lt;s.baseIndent+e.value&amp;&amp;s.next&gt;-1)return false;s.moveBaseColumn(s.baseIndent+e.value);return true},[h.OrderedList]:skipForList,[h.BulletList]:skipForList,[h.Document](){return true}};function space(e){return e==32||e==9||e==10||e==13}function skipSpace(e,t=0){while(t&lt;e.length&amp;&amp;space(e.charCodeAt(t)))t++;return t}function skipSpaceBack(e,t,s){while(t&gt;s&amp;&amp;space(e.charCodeAt(t-1)))t--;return t}function isFencedCode(e){if(e.next!=96&amp;&amp;e.next!=126)return-1;let t=e.pos+1;while(t&lt;e.text.length&amp;&amp;e.text.charCodeAt(t)==e.next)t++;if(t&lt;e.pos+3)return-1;if(e.next==96)for(let s=t;s&lt;e.text.length;s++)if(e.text.charCodeAt(s)==96)return-1;return t}function isBlockquote(e){return e.next!=62?-1:e.text.charCodeAt(e.pos+1)==32?2:1}function isHorizontalRule(e,t,s){if(e.next!=42&amp;&amp;e.next!=45&amp;&amp;e.next!=95)return-1;let n=1;for(let t=e.pos+1;t&lt;e.text.length;t++){let s=e.text.charCodeAt(t);if(s==e.next)n++;else if(!space(s))return-1}return s&amp;&amp;e.next==45&amp;&amp;isSetextUnderline(e)&gt;-1&amp;&amp;e.depth==t.stack.length||n&lt;3?-1:1}function inList(e,t){for(let s=e.stack.length-1;s&gt;=0;s--)if(e.stack[s].type==t)return true;return false}function isBulletList(e,t,s){return e.next!=45&amp;&amp;e.next!=43&amp;&amp;e.next!=42||e.pos!=e.text.length-1&amp;&amp;!space(e.text.charCodeAt(e.pos+1))||!(!s||inList(t,h.BulletList)||e.skipSpace(e.pos+2)&lt;e.text.length)?-1:1}function isOrderedList(e,t,s){let n=e.pos,r=e.next;for(;;){if(!(r&gt;=48&amp;&amp;r&lt;=57))break;n++;if(n==e.text.length)return-1;r=e.text.charCodeAt(n)}return n==e.pos||n&gt;e.pos+9||r!=46&amp;&amp;r!=41||n&lt;e.text.length-1&amp;&amp;!space(e.text.charCodeAt(n+1))||s&amp;&amp;!inList(t,h.OrderedList)&amp;&amp;(e.skipSpace(n+1)==e.text.length||n&gt;e.pos+1||e.next!=49)?-1:n+1-e.pos}function isAtxHeading(e){if(e.next!=35)return-1;let t=e.pos+1;while(t&lt;e.text.length&amp;&amp;e.text.charCodeAt(t)==35)t++;if(t&lt;e.text.length&amp;&amp;e.text.charCodeAt(t)!=32)return-1;let s=t-e.pos;return s&gt;6?-1:s}function isSetextUnderline(e){if(e.next!=45&amp;&amp;e.next!=61||e.indent&gt;=e.baseIndent+4)return-1;let t=e.pos+1;while(t&lt;e.text.length&amp;&amp;e.text.charCodeAt(t)==e.next)t++;let s=t;while(t&lt;e.text.length&amp;&amp;space(e.text.charCodeAt(t)))t++;return t==e.text.length?s:-1}const d=/^[ \t]*$/,p=/--&gt;/,c=/\?&gt;/;const u=[[/^&lt;(?:script|pre|style)(?:\s|&gt;|$)/i,/&lt;\/(?:script|pre|style)&gt;/i],[/^\s*&lt;!--/,p],[/^\s*&lt;\?/,c],[/^\s*&lt;![A-Z]/,/&gt;/],[/^\s*&lt;!\[CDATA\[/,/\]\]&gt;/],[/^\s*&lt;\/?(?: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|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?&gt;|$)/i,d],[/^\s*(?:&lt;\/[a-z][\w-]*\s*&gt;|&lt;[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=&lt;&gt;`]+|'[^']*'|"[^"]*"))?)*\s*&gt;)\s*$/i,d]];function isHTMLBlock(e,t,s){if(e.next!=60)return-1;let n=e.text.slice(e.pos);for(let e=0,t=u.length-(s?1:0);e&lt;t;e++)if(u[e][0].test(n))return e;return-1}function getListIndent(e,t){let s=e.countIndent(t,e.pos,e.indent);let n=e.countIndent(e.skipSpace(t),t,s);return n&gt;=s+5?s+1:n}function addCodeText(e,t,s){let n=e.length-1;n&gt;=0&amp;&amp;e[n].to==t&amp;&amp;e[n].type==h.CodeText?e[n].to=s:e.push(elt(h.CodeText,t,s))}const m={LinkReference:void 0,IndentedCode(e,t){let s=t.baseIndent+4;if(t.indent&lt;s)return false;let n=t.findColumn(s);let r=e.lineStart+n,i=e.lineStart+t.text.length;let l=[],a=[];addCodeText(l,r,i);while(e.nextLine()&amp;&amp;t.depth&gt;=e.stack.length)if(t.pos==t.text.length){addCodeText(a,e.lineStart-1,e.lineStart);for(let e of t.markers)a.push(e)}else{if(t.indent&lt;s)break;{if(a.length){for(let e of a)e.type==h.CodeText?addCodeText(l,e.from,e.to):l.push(e);a=[]}addCodeText(l,e.lineStart-1,e.lineStart);for(let e of t.markers)l.push(e);i=e.lineStart+t.text.length;let s=e.lineStart+t.findColumn(t.baseIndent+4);s&lt;i&amp;&amp;addCodeText(l,s,i)}}if(a.length){a=a.filter((e=&gt;e.type!=h.CodeText));a.length&amp;&amp;(t.markers=a.concat(t.markers))}e.addNode(e.buffer.writeElements(l,-r).finish(h.CodeBlock,i-r),r);return true},FencedCode(e,t){let s=isFencedCode(t);if(s&lt;0)return false;let n=e.lineStart+t.pos,r=t.next,i=s-t.pos;let l=t.skipSpace(s),a=skipSpaceBack(t.text,t.text.length,l);let o=[elt(h.CodeMark,n,n+i)];l&lt;a&amp;&amp;o.push(elt(h.CodeInfo,e.lineStart+l,e.lineStart+a));for(let s=true;e.nextLine()&amp;&amp;t.depth&gt;=e.stack.length;s=false){let n=t.pos;if(t.indent-t.baseIndent&lt;4)while(n&lt;t.text.length&amp;&amp;t.text.charCodeAt(n)==r)n++;if(n-t.pos&gt;=i&amp;&amp;t.skipSpace(n)==t.text.length){for(let e of t.markers)o.push(e);o.push(elt(h.CodeMark,e.lineStart+t.pos,e.lineStart+n));e.nextLine();break}{s||addCodeText(o,e.lineStart-1,e.lineStart);for(let e of t.markers)o.push(e);let n=e.lineStart+t.basePos,r=e.lineStart+t.text.length;n&lt;r&amp;&amp;addCodeText(o,n,r)}}e.addNode(e.buffer.writeElements(o,-n).finish(h.FencedCode,e.prevLineEnd()-n),n);return true},Blockquote(e,t){let s=isBlockquote(t);if(s&lt;0)return false;e.startContext(h.Blockquote,t.pos);e.addNode(h.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1);t.moveBase(t.pos+s);return null},HorizontalRule(e,t){if(isHorizontalRule(t,e,false)&lt;0)return false;let s=e.lineStart+t.pos;e.nextLine();e.addNode(h.HorizontalRule,s);return true},BulletList(e,t){let s=isBulletList(t,e,false);if(s&lt;0)return false;e.block.type!=h.BulletList&amp;&amp;e.startContext(h.BulletList,t.basePos,t.next);let n=getListIndent(t,t.pos+1);e.startContext(h.ListItem,t.basePos,n-t.baseIndent);e.addNode(h.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+s);t.moveBaseColumn(n);return null},OrderedList(e,t){let s=isOrderedList(t,e,false);if(s&lt;0)return false;e.block.type!=h.OrderedList&amp;&amp;e.startContext(h.OrderedList,t.basePos,t.text.charCodeAt(t.pos+s-1));let n=getListIndent(t,t.pos+s);e.startContext(h.ListItem,t.basePos,n-t.baseIndent);e.addNode(h.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+s);t.moveBaseColumn(n);return null},ATXHeading(e,t){let s=isAtxHeading(t);if(s&lt;0)return false;let n=t.pos,r=e.lineStart+n;let i=skipSpaceBack(t.text,t.text.length,n),l=i;while(l&gt;n&amp;&amp;t.text.charCodeAt(l-1)==t.next)l--;l!=i&amp;&amp;l!=n&amp;&amp;space(t.text.charCodeAt(l-1))||(l=t.text.length);let a=e.buffer.write(h.HeaderMark,0,s).writeElements(e.parser.parseInline(t.text.slice(n+s+1,l),r+s+1),-r);l&lt;t.text.length&amp;&amp;a.write(h.HeaderMark,l-n,i-n);let o=a.finish(h.ATXHeading1-1+s,t.text.length-n);e.nextLine();e.addNode(o,r);return true},HTMLBlock(e,t){let s=isHTMLBlock(t,e,false);if(s&lt;0)return false;let n=e.lineStart+t.pos,r=u[s][1];let i=[],l=r!=d;while(!r.test(t.text)&amp;&amp;e.nextLine()){if(t.depth&lt;e.stack.length){l=false;break}for(let e of t.markers)i.push(e)}l&amp;&amp;e.nextLine();let a=r==p?h.CommentBlock:r==c?h.ProcessingInstructionBlock:h.HTMLBlock;let o=e.prevLineEnd();e.addNode(e.buffer.writeElements(i,-n).finish(a,o-n),n);return true},SetextHeading:void 0};class LinkReferenceParser{constructor(e){this.stage=0;this.elts=[];this.pos=0;this.start=e.start;this.advance(e.content)}nextLine(e,t,s){if(this.stage==-1)return false;let n=s.content+"\n"+t.scrub();let r=this.advance(n);return r&gt;-1&amp;&amp;r&lt;n.length&amp;&amp;this.complete(e,s,r)}finish(e,t){return(this.stage==2||this.stage==3)&amp;&amp;skipSpace(t.content,this.pos)==t.content.length&amp;&amp;this.complete(e,t,t.content.length)}complete(e,t,s){e.addLeafElement(t,elt(h.LinkReference,this.start,this.start+s,this.elts));return true}nextStage(e){if(e){this.pos=e.to-this.start;this.elts.push(e);this.stage++;return true}e===false&amp;&amp;(this.stage=-1);return false}advance(e){for(;;){if(this.stage==-1)return-1;if(this.stage==0){if(!this.nextStage(parseLinkLabel(e,this.pos,this.start,true)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(elt(h.LinkMark,this.pos+this.start,this.pos+this.start+1));this.pos++}else{if(this.stage!=1){if(this.stage==2){let t=skipSpace(e,this.pos),s=0;if(t&gt;this.pos){let n=parseLinkTitle(e,t,this.start);if(n){let t=lineEnd(e,n.to-this.start);if(t&gt;0){this.nextStage(n);s=t}}}s||(s=lineEnd(e,this.pos));return s&gt;0&amp;&amp;s&lt;e.length?s:-1}return lineEnd(e,this.pos)}if(!this.nextStage(parseURL(e,skipSpace(e,this.pos),this.start)))return-1}}}}function lineEnd(e,t){for(;t&lt;e.length;t++){let s=e.charCodeAt(t);if(s==10)break;if(!space(s))return-1}return t}class SetextHeadingParser{nextLine(e,t,s){let n=t.depth&lt;e.stack.length?-1:isSetextUnderline(t);let r=t.next;if(n&lt;0)return false;let i=elt(h.HeaderMark,e.lineStart+t.pos,e.lineStart+n);e.nextLine();e.addLeafElement(s,elt(r==61?h.SetextHeading1:h.SetextHeading2,s.start,e.prevLineEnd(),[...e.parser.parseInline(s.content,s.start),i]));return true}finish(){return false}}const k={LinkReference(e,t){return t.content.charCodeAt(0)==91?new LinkReferenceParser(t):null},SetextHeading(){return new SetextHeadingParser}};const g=[(e,t)=&gt;isAtxHeading(t)&gt;=0,(e,t)=&gt;isFencedCode(t)&gt;=0,(e,t)=&gt;isBlockquote(t)&gt;=0,(e,t)=&gt;isBulletList(t,e,true)&gt;=0,(e,t)=&gt;isOrderedList(t,e,true)&gt;=0,(e,t)=&gt;isHorizontalRule(t,e,true)&gt;=0,(e,t)=&gt;isHTMLBlock(t,e,true)&gt;=0];const x={text:"",end:0};class BlockContext{constructor(e,t,s,n){this.parser=e;this.input=t;this.ranges=n;this.line=new Line;this.atEnd=false;this.reusePlaceholders=new Map;this.stoppedAt=null;this.rangeI=0;this.to=n[n.length-1].to;this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=n[0].from;this.block=CompositeBlock.create(h.Document,0,this.lineStart,0,0);this.stack=[this.block];this.fragments=s.length?new FragmentCursor(s,t):null;this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&amp;&amp;this.absoluteLineStart&gt;this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(let t=0;;){let s=e.depth&lt;this.stack.length?this.stack[this.stack.length-1]:null;while(t&lt;e.markers.length&amp;&amp;(!s||e.markers[t].from&lt;s.end)){let s=e.markers[t++];this.addNode(s.type,s.from,s.to)}if(!s)break;this.finishContext()}if(e.pos&lt;e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&amp;&amp;this.reuseFragment(e.basePos))return null;e:for(;;){for(let t of this.parser.blockParsers)if(t){let s=t(this,e);if(s!=false){if(s==true)return null;e.forward();continue e}}break}let t=new LeafBlock(this.lineStart+e.pos,e.text.slice(e.pos));for(let e of this.parser.leafBlockParsers)if(e){let s=e(this,t);s&amp;&amp;t.parsers.push(s)}e:while(this.nextLine()){if(e.pos==e.text.length)break;if(e.indent&lt;e.baseIndent+4)for(let s of this.parser.endLeafBlock)if(s(this,e,t))break e;for(let s of t.parsers)if(s.nextLine(this,e,t))return null;t.content+="\n"+e.scrub();for(let s of e.markers)t.marks.push(s)}this.finishLeaf(t);return null}stopAt(e){if(this.stoppedAt!=null&amp;&amp;this.stoppedAt&lt;e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return false;let t=this.fragments.takeNodes(this);if(!t)return false;this.absoluteLineStart+=t;this.lineStart=toRelative(this.absoluteLineStart,this.ranges);this.moveRangeI();if(this.absoluteLineStart&lt;this.to){this.lineStart++;this.absoluteLineStart++;this.readLine()}else{this.atEnd=true;this.readLine()}return true}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){this.lineStart+=this.line.text.length;if(this.absoluteLineEnd&gt;=this.to){this.absoluteLineStart=this.absoluteLineEnd;this.atEnd=true;this.readLine();return false}this.lineStart++;this.absoluteLineStart=this.absoluteLineEnd+1;this.moveRangeI();this.readLine();return true}moveRangeI(){while(this.rangeI&lt;this.ranges.length-1&amp;&amp;this.absoluteLineStart&gt;=this.ranges[this.rangeI].to){this.rangeI++;this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}}scanLine(e){let t=x;t.end=e;if(e&gt;=this.to)t.text="";else{t.text=this.lineChunkAt(e);t.end+=t.text.length;if(this.ranges.length&gt;1){let e=this.absoluteLineStart,s=this.rangeI;while(this.ranges[s].to&lt;t.end){s++;let n=this.ranges[s].from;let r=this.lineChunkAt(n);t.end=n+r.length;t.text=t.text.slice(0,this.ranges[s-1].to-e)+r;e=t.end-t.text.length}}}return t}readLine(){let{line:e}=this,{text:t,end:s}=this.scanLine(this.absoluteLineStart);this.absoluteLineEnd=s;e.reset(t);for(;e.depth&lt;this.stack.length;e.depth++){let t=this.stack[e.depth],s=this.parser.skipContextMarkup[t.type];if(!s)throw new Error("Unhandled block context "+h[t.type]);if(!s(t,this,e))break;e.forward()}}lineChunkAt(e){let t,s=this.input.chunk(e);if(this.input.lineChunks)t=s=="\n"?"":s;else{let e=s.indexOf("\n");t=e&lt;0?s:s.slice(0,e)}return e+t.length&gt;this.to?t.slice(0,this.to-e):t}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,t,s=0){this.block=CompositeBlock.create(e,s,this.lineStart+t,this.block.hash,this.lineStart+this.line.text.length);this.stack.push(this.block)}startComposite(e,t,s=0){this.startContext(this.parser.getNodeType(e),t,s)}addNode(e,s,n){typeof e=="number"&amp;&amp;(e=new t(this.parser.nodeSet.types[e],b,b,(n!==null&amp;&amp;n!==void 0?n:this.prevLineEnd())-s));this.block.addChild(e,s-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,t){this.addNode(this.buffer.writeElements(injectMarks(t.children,e.marks),-t.from).finish(t.type,t.to-t.from),t.from)}finishContext(){let e=this.stack.pop();let t=this.stack[this.stack.length-1];t.addChild(e.toTree(this.parser.nodeSet),e.from-t.from);this.block=t}finish(){while(this.stack.length&gt;1)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length&gt;1?injectGaps(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let t of e.parsers)if(t.finish(this,e))return;let t=injectMarks(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(t,-e.start).finish(h.Paragraph,e.content.length),e.start)}elt(e,t,s,n){return typeof e=="string"?elt(this.parser.getNodeType(e),t,s,n):new TreeElement(e,t)}get buffer(){return new Buffer(this.parser.nodeSet)}}function injectGaps(e,s,n,r,i){let l=e[s].to;let a=[],o=[],h=n.from+r;function movePastNext(t,n){while(n?t&gt;=l:t&gt;l){let n=e[s+1].from-l;r+=n;t+=n;s++;l=e[s].to}}for(let t=n.firstChild;t;t=t.nextSibling){movePastNext(t.from+r,true);let n,f=t.from+r,d=i.get(t.tree);if(d)n=d;else if(t.to+r&gt;l){n=injectGaps(e,s,t,r,i);movePastNext(t.to+r,false)}else n=t.toTree();a.push(n);o.push(f-h)}movePastNext(n.to+r,false);return new t(n.type,a,o,n.to+r-h,n.tree?n.tree.propValues:void 0)}class MarkdownParser extends n{constructor(e,t,s,n,r,i,l,a,o){super();this.nodeSet=e;this.blockParsers=t;this.leafBlockParsers=s;this.blockNames=n;this.endLeafBlock=r;this.skipContextMarkup=i;this.inlineParsers=l;this.inlineNames=a;this.wrappers=o;this.nodeTypes=Object.create(null);for(let t of e.types)this.nodeTypes[t.name]=t.id}createParse(e,t,s){let n=new BlockContext(this,e,t,s);for(let r of this.wrappers)n=r(n,e,t,s);return n}configure(t){let n=resolveConfig(t);if(!n)return this;let{nodeSet:i,skipContextMarkup:o}=this;let f=this.blockParsers.slice(),d=this.leafBlockParsers.slice(),p=this.blockNames.slice(),c=this.inlineParsers.slice(),u=this.inlineNames.slice(),m=this.endLeafBlock.slice(),k=this.wrappers;if(nonEmpty(n.defineNodes)){o=Object.assign({},o);let t,f=i.types.slice();for(let r of n.defineNodes){let{name:n,block:i,composite:a,style:d}=typeof r=="string"?{name:r}:r;if(f.some((e=&gt;e.name==n)))continue;a&amp;&amp;(o[f.length]=(e,t,s)=&gt;a(t,s,e.value));let p=f.length;let c=a?["Block","BlockContext"]:i?p&gt;=h.ATXHeading1&amp;&amp;p&lt;=h.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;f.push(s.define({id:p,name:n,props:c&amp;&amp;[[e.group,c]]}));if(d){t||(t={});Array.isArray(d)||d instanceof l?t[n]=d:Object.assign(t,d)}}i=new r(f);t&amp;&amp;(i=i.extend(a(t)))}nonEmpty(n.props)&amp;&amp;(i=i.extend(...n.props));if(nonEmpty(n.remove))for(let e of n.remove){let t=this.blockNames.indexOf(e),s=this.inlineNames.indexOf(e);t&gt;-1&amp;&amp;(f[t]=d[t]=void 0);s&gt;-1&amp;&amp;(c[s]=void 0)}if(nonEmpty(n.parseBlock))for(let e of n.parseBlock){let t=p.indexOf(e.name);if(t&gt;-1){f[t]=e.parse;d[t]=e.leaf}else{let t=e.before?findName(p,e.before):e.after?findName(p,e.after)+1:p.length-1;f.splice(t,0,e.parse);d.splice(t,0,e.leaf);p.splice(t,0,e.name)}e.endLeaf&amp;&amp;m.push(e.endLeaf)}if(nonEmpty(n.parseInline))for(let e of n.parseInline){let t=u.indexOf(e.name);if(t&gt;-1)c[t]=e.parse;else{let t=e.before?findName(u,e.before):e.after?findName(u,e.after)+1:u.length-1;c.splice(t,0,e.parse);u.splice(t,0,e.name)}}n.wrap&amp;&amp;(k=k.concat(n.wrap));return new MarkdownParser(i,f,d,p,m,o,c,u,k)}getNodeType(e){let t=this.nodeTypes[e];if(t==null)throw new RangeError(`Unknown node type '${e}'`);return t}parseInline(e,t){let s=new InlineContext(this,e,t);e:for(let e=t;e&lt;s.end;){let t=s.char(e);for(let n of this.inlineParsers)if(n){let r=n(s,t,e);if(r&gt;=0){e=r;continue e}}e++}return s.resolveMarkers(0)}}function nonEmpty(e){return e!=null&amp;&amp;e.length&gt;0}function resolveConfig(e){if(!Array.isArray(e))return e;if(e.length==0)return null;let t=resolveConfig(e[0]);if(e.length==1)return t;let s=resolveConfig(e.slice(1));if(!s||!t)return t||s;let conc=(e,t)=&gt;(e||b).concat(t||b);let n=t.wrap,r=s.wrap;return{props:conc(t.props,s.props),defineNodes:conc(t.defineNodes,s.defineNodes),parseBlock:conc(t.parseBlock,s.parseBlock),parseInline:conc(t.parseInline,s.parseInline),remove:conc(t.remove,s.remove),wrap:n?r?(e,t,s,i)=&gt;n(r(e,t,s,i),t,s,i):n:r}}function findName(e,t){let s=e.indexOf(t);if(s&lt;0)throw new RangeError(`Position specified relative to unknown parser ${t}`);return s}let L=[s.none];for(let t,n=1;t=h[n];n++)L[n]=s.define({id:n,name:t,props:n&gt;=h.Escape?[]:[[e.group,n in f?["Block","BlockContext"]:["Block","LeafBlock"]]],top:t=="Document"});const b=[];class Buffer{constructor(e){this.nodeSet=e;this.content=[];this.nodes=[]}write(e,t,s,n=0){this.content.push(e,t,s,4+n*4);return this}writeElements(e,t=0){for(let s of e)s.writeTo(this,t);return this}finish(e,s){return t.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:e,length:s})}}class Element{constructor(e,t,s,n=b){this.type=e;this.from=t;this.to=s;this.children=n}writeTo(e,t){let s=e.content.length;e.writeElements(this.children,t);e.content.push(this.type,this.from+t,this.to+t,e.content.length+4-s)}toTree(e){return new Buffer(e).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}}class TreeElement{constructor(e,t){this.tree=e;this.from=t}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return b}writeTo(e,t){e.nodes.push(this.tree);e.content.push(e.nodes.length-1,this.from+t,this.to+t,-1)}toTree(){return this.tree}}function elt(e,t,s,n){return new Element(e,t,s,n)}const C={resolve:"Emphasis",mark:"EmphasisMark"};const S={resolve:"Emphasis",mark:"EmphasisMark"};const w={},y={};class InlineDelimiter{constructor(e,t,s,n){this.type=e;this.from=t;this.to=s;this.side=n}}const T="!\"#$%&amp;'()*+,-./:;&lt;=&gt;?@[\\]^_`{|}~";let I=/[!"#$%&amp;'()*+,\-.\/:;&lt;=&gt;?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{I=new RegExp("[\\p{Pc}|\\p{Pd}|\\p{Pe}|\\p{Pf}|\\p{Pi}|\\p{Po}|\\p{Ps}]","u")}catch(e){}const E={Escape(e,t,s){if(t!=92||s==e.end-1)return-1;let n=e.char(s+1);for(let t=0;t&lt;T.length;t++)if(T.charCodeAt(t)==n)return e.append(elt(h.Escape,s,s+2));return-1},Entity(e,t,s){if(t!=38)return-1;let n=/^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(e.slice(s+1,s+31));return n?e.append(elt(h.Entity,s,s+1+n[0].length)):-1},InlineCode(e,t,s){if(t!=96||s&amp;&amp;e.char(s-1)==96)return-1;let n=s+1;while(n&lt;e.end&amp;&amp;e.char(n)==96)n++;let r=n-s,i=0;for(;n&lt;e.end;n++)if(e.char(n)==96){i++;if(i==r&amp;&amp;e.char(n+1)!=96)return e.append(elt(h.InlineCode,s,n+1,[elt(h.CodeMark,s,s+r),elt(h.CodeMark,n+1-r,n+1)]))}else i=0;return-1},HTMLTag(e,t,s){if(t!=60||s==e.end-1)return-1;let n=e.slice(s+1,e.end);let r=/^(?:[a-z][-\w+.]+:[^\s&gt;]+|[a-z\d.!#$%&amp;'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)&gt;/i.exec(n);if(r)return e.append(elt(h.Autolink,s,s+1+r[0].length,[elt(h.LinkMark,s,s+1),elt(h.URL,s+1,s+r[0].length),elt(h.LinkMark,s+r[0].length,s+1+r[0].length)]));let i=/^!--[^&gt;](?:-[^-]|[^-])*?--&gt;/i.exec(n);if(i)return e.append(elt(h.Comment,s,s+1+i[0].length));let l=/^\?[^]*?\?&gt;/.exec(n);if(l)return e.append(elt(h.ProcessingInstruction,s,s+1+l[0].length));let a=/^(?:![A-Z][^]*?&gt;|!\[CDATA\[[^]*?\]\]&gt;|\/\s*[a-zA-Z][\w-]*\s*&gt;|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=&lt;&gt;`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?&gt;)/.exec(n);return a?e.append(elt(h.HTMLTag,s,s+1+a[0].length)):-1},Emphasis(e,t,s){if(t!=95&amp;&amp;t!=42)return-1;let n=s+1;while(e.char(n)==t)n++;let r=e.slice(s-1,s),i=e.slice(n,n+1);let l=I.test(r),a=I.test(i);let o=/\s|^$/.test(r),h=/\s|^$/.test(i);let f=!h&amp;&amp;(!a||o||l);let d=!o&amp;&amp;(!l||h||a);let p=f&amp;&amp;(t==42||!d||l);let c=d&amp;&amp;(t==42||!f||a);return e.append(new InlineDelimiter(t==95?C:S,s,n,(p?1:0)|(c?2:0)))},HardBreak(e,t,s){if(t==92&amp;&amp;e.char(s+1)==10)return e.append(elt(h.HardBreak,s,s+2));if(t==32){let t=s+1;while(e.char(t)==32)t++;if(e.char(t)==10&amp;&amp;t&gt;=s+2)return e.append(elt(h.HardBreak,s,t+1))}return-1},Link(e,t,s){return t==91?e.append(new InlineDelimiter(w,s,s+1,1)):-1},Image(e,t,s){return t==33&amp;&amp;e.char(s+1)==91?e.append(new InlineDelimiter(y,s,s+2,1)):-1},LinkEnd(e,t,s){if(t!=93)return-1;for(let t=e.parts.length-1;t&gt;=0;t--){let n=e.parts[t];if(n instanceof InlineDelimiter&amp;&amp;(n.type==w||n.type==y)){if(!n.side||e.skipSpace(n.to)==s&amp;&amp;!/[(\[]/.test(e.slice(s+1,s+2))){e.parts[t]=null;return-1}let r=e.takeContent(t);let i=e.parts[t]=finishLink(e,r,n.type==w?h.Link:h.Image,n.from,s+1);if(n.type==w)for(let s=0;s&lt;t;s++){let t=e.parts[s];t instanceof InlineDelimiter&amp;&amp;t.type==w&amp;&amp;(t.side=0)}return i.to}}return-1}};function finishLink(e,t,s,n,r){let{text:i}=e,l=e.char(r),a=r;t.unshift(elt(h.LinkMark,n,n+(s==h.Image?2:1)));t.push(elt(h.LinkMark,r-1,r));if(l==40){let s=e.skipSpace(r+1);let n,l=parseURL(i,s-e.offset,e.offset);if(l){s=e.skipSpace(l.to);if(s!=l.to){n=parseLinkTitle(i,s-e.offset,e.offset);n&amp;&amp;(s=e.skipSpace(n.to))}}if(e.char(s)==41){t.push(elt(h.LinkMark,r,r+1));a=s+1;l&amp;&amp;t.push(l);n&amp;&amp;t.push(n);t.push(elt(h.LinkMark,s,a))}}else if(l==91){let s=parseLinkLabel(i,r-e.offset,e.offset,false);if(s){t.push(s);a=s.to}}return elt(s,n,a,t)}function parseURL(e,t,s){let n=e.charCodeAt(t);if(n==60){for(let n=t+1;n&lt;e.length;n++){let r=e.charCodeAt(n);if(r==62)return elt(h.URL,t+s,n+1+s);if(r==60||r==10)return false}return null}{let n=0,r=t;for(let t=false;r&lt;e.length;r++){let s=e.charCodeAt(r);if(space(s))break;if(t)t=false;else if(s==40)n++;else if(s==41){if(!n)break;n--}else s==92&amp;&amp;(t=true)}return r&gt;t?elt(h.URL,t+s,r+s):r==e.length&amp;&amp;null}}function parseLinkTitle(e,t,s){let n=e.charCodeAt(t);if(n!=39&amp;&amp;n!=34&amp;&amp;n!=40)return false;let r=n==40?41:n;for(let n=t+1,i=false;n&lt;e.length;n++){let l=e.charCodeAt(n);if(i)i=false;else{if(l==r)return elt(h.LinkTitle,t+s,n+1+s);l==92&amp;&amp;(i=true)}}return null}function parseLinkLabel(e,t,s,n){for(let r=false,i=t+1,l=Math.min(e.length,i+999);i&lt;l;i++){let l=e.charCodeAt(i);if(r)r=false;else{if(l==93)return!n&amp;&amp;elt(h.LinkLabel,t+s,i+1+s);n&amp;&amp;!space(l)&amp;&amp;(n=false);if(l==91)return false;l==92&amp;&amp;(r=true)}}return null}class InlineContext{constructor(e,t,s){this.parser=e;this.text=t;this.offset=s;this.parts=[]}char(e){return e&gt;=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,t){return this.text.slice(e-this.offset,t-this.offset)}append(e){this.parts.push(e);return e.to}addDelimiter(e,t,s,n,r){return this.append(new InlineDelimiter(e,t,s,(n?1:0)|(r?2:0)))}addElement(e){return this.append(e)}resolveMarkers(e){for(let t=e;t&lt;this.parts.length;t++){let s=this.parts[t];if(!(s instanceof InlineDelimiter&amp;&amp;s.type.resolve&amp;&amp;s.side&amp;2))continue;let n=s.type==C||s.type==S;let r=s.to-s.from;let i,l=t-1;for(;l&gt;=e;l--){let e=this.parts[l];if(e instanceof InlineDelimiter&amp;&amp;e.side&amp;1&amp;&amp;e.type==s.type&amp;&amp;!(n&amp;&amp;(s.side&amp;1||e.side&amp;2)&amp;&amp;(e.to-e.from+r)%3==0&amp;&amp;((e.to-e.from)%3||r%3))){i=e;break}}if(!i)continue;let a=s.type.resolve,o=[];let h=i.from,f=s.to;if(n){let e=Math.min(2,i.to-i.from,r);h=i.to-e;f=s.from+e;a=e==1?"Emphasis":"StrongEmphasis"}i.type.mark&amp;&amp;o.push(this.elt(i.type.mark,h,i.to));for(let e=l+1;e&lt;t;e++){this.parts[e]instanceof Element&amp;&amp;o.push(this.parts[e]);this.parts[e]=null}s.type.mark&amp;&amp;o.push(this.elt(s.type.mark,s.from,f));let d=this.elt(a,h,f,o);this.parts[l]=n&amp;&amp;i.from!=h?new InlineDelimiter(i.type,i.from,h,i.side):null;let p=this.parts[t]=n&amp;&amp;s.to!=f?new InlineDelimiter(s.type,f,s.to,s.side):null;p?this.parts.splice(t,0,d):this.parts[t]=d}let t=[];for(let s=e;s&lt;this.parts.length;s++){let e=this.parts[s];e instanceof Element&amp;&amp;t.push(e)}return t}findOpeningDelimiter(e){for(let t=this.parts.length-1;t&gt;=0;t--){let s=this.parts[t];if(s instanceof InlineDelimiter&amp;&amp;s.type==e)return t}return null}takeContent(e){let t=this.resolveMarkers(e);this.parts.length=e;return t}skipSpace(e){return skipSpace(this.text,e-this.offset)+this.offset}elt(e,t,s,n){return typeof e=="string"?elt(this.parser.getNodeType(e),t,s,n):new TreeElement(e,t)}}function injectMarks(e,t){if(!t.length)return e;if(!e.length)return t;let s=e.slice(),n=0;for(let e of t){while(n&lt;s.length&amp;&amp;s[n].to&lt;e.to)n++;if(n&lt;s.length&amp;&amp;s[n].from&lt;e.from){let t=s[n];t instanceof Element&amp;&amp;(s[n]=new Element(t.type,t.from,t.to,injectMarks(t.children,[e])))}else s.splice(n++,0,e)}return s}const B=[h.CodeBlock,h.ListItem,h.OrderedList,h.BulletList];class FragmentCursor{constructor(e,t){this.fragments=e;this.input=t;this.i=0;this.fragment=null;this.fragmentEnd=-1;this.cursor=null;e.length&amp;&amp;(this.fragment=e[this.i++])}nextFragment(){this.fragment=this.i&lt;this.fragments.length?this.fragments[this.i++]:null;this.cursor=null;this.fragmentEnd=-1}moveTo(e,t){while(this.fragment&amp;&amp;this.fragment.to&lt;=e)this.nextFragment();if(!this.fragment||this.fragment.from&gt;(e?e-1:0))return false;if(this.fragmentEnd&lt;0){let e=this.fragment.to;while(e&gt;0&amp;&amp;this.input.read(e-1,e)!="\n")e--;this.fragmentEnd=e?e-1:0}let s=this.cursor;if(!s){s=this.cursor=this.fragment.tree.cursor();s.firstChild()}let n=e+this.fragment.offset;while(s.to&lt;=n)if(!s.parent())return false;for(;;){if(s.from&gt;=n)return this.fragment.from&lt;=t;if(!s.childAfter(n))return false}}matches(t){let s=this.cursor.tree;return s&amp;&amp;s.prop(e.contextHash)==t}takeNodes(e){let s=this.cursor,n=this.fragment.offset,r=this.fragmentEnd-(this.fragment.openEnd?1:0);let i=e.absoluteLineStart,l=i,a=e.block.children.length;let o=l,f=a;for(;;){if(s.to-n&gt;r){if(s.type.isAnonymous&amp;&amp;s.firstChild())continue;break}let i=toRelative(s.from-n,e.ranges);if(s.to-n&lt;=e.ranges[e.rangeI].to)e.addNode(s.tree,i);else{let n=new t(e.parser.nodeSet.types[h.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(n,s.tree);e.addNode(n,i)}if(s.type.is("Block"))if(B.indexOf(s.type.id)&lt;0){l=s.to-n;a=e.block.children.length}else{l=o;a=f;o=s.to-n;f=e.block.children.length}if(!s.nextSibling())break}while(e.block.children.length&gt;a){e.block.children.pop();e.block.positions.pop()}return l-i}}function toRelative(e,t){let s=e;for(let n=1;n&lt;t.length;n++){let r=t[n-1].to,i=t[n].from;r&lt;e&amp;&amp;(s-=i-r)}return s}const A=a({"Blockquote/...":o.quote,HorizontalRule:o.contentSeparator,"ATXHeading1/... SetextHeading1/...":o.heading1,"ATXHeading2/... SetextHeading2/...":o.heading2,"ATXHeading3/...":o.heading3,"ATXHeading4/...":o.heading4,"ATXHeading5/...":o.heading5,"ATXHeading6/...":o.heading6,"Comment CommentBlock":o.comment,Escape:o.escape,Entity:o.character,"Emphasis/...":o.emphasis,"StrongEmphasis/...":o.strong,"Link/... Image/...":o.link,"OrderedList/... BulletList/...":o.list,"BlockQuote/...":o.quote,"InlineCode CodeText":o.monospace,"URL Autolink":o.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":o.processingInstruction,"CodeInfo LinkLabel":o.labelName,LinkTitle:o.string,Paragraph:o.content});const H=new MarkdownParser(new r(L).extend(A),Object.keys(m).map((e=&gt;m[e])),Object.keys(m).map((e=&gt;k[e])),Object.keys(m),g,f,Object.keys(E).map((e=&gt;E[e])),Object.keys(E),[]);function leftOverSpace(e,t,s){let n=[];for(let r=e.firstChild,i=t;;r=r.nextSibling){let e=r?r.from:s;e&gt;i&amp;&amp;n.push({from:i,to:e});if(!r)break;i=r.to}return n}function parseCode(e){let{codeParser:t,htmlParser:s}=e;let n=i(((e,n)=&gt;{let r=e.type.id;if(!t||r!=h.CodeBlock&amp;&amp;r!=h.FencedCode){if(s&amp;&amp;(r==h.HTMLBlock||r==h.HTMLTag))return{parser:s,overlay:leftOverSpace(e.node,e.from,e.to)}}else{let s="";if(r==h.FencedCode){let t=e.node.getChild(h.CodeInfo);t&amp;&amp;(s=n.read(t.from,t.to))}let i=t(s);if(i)return{parser:i,overlay:e=&gt;e.type.id==h.CodeText}}return null}));return{wrap:n}}const M={resolve:"Strikethrough",mark:"StrikethroughMark"};const P={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":o.strikethrough}},{name:"StrikethroughMark",style:o.processingInstruction}],parseInline:[{name:"Strikethrough",parse(e,t,s){if(t!=126||e.char(s+1)!=126||e.char(s+2)==126)return-1;let n=e.slice(s-1,s),r=e.slice(s+2,s+3);let i=/\s|^$/.test(n),l=/\s|^$/.test(r);let a=I.test(n),o=I.test(r);return e.addDelimiter(M,s,s+2,!l&amp;&amp;(!o||i||a),!i&amp;&amp;(!a||l||o))},after:"Emphasis"}]};function parseRow(e,t,s=0,n,r=0){let i=0,l=true,a=-1,o=-1,h=false;let parseCell=()=&gt;{n.push(e.elt("TableCell",r+a,r+o,e.parser.parseInline(t.slice(a,o),r+a)))};for(let f=s;f&lt;t.length;f++){let s=t.charCodeAt(f);if(s!=124||h){if(h||s!=32&amp;&amp;s!=9){a&lt;0&amp;&amp;(a=f);o=f+1}}else{(!l||a&gt;-1)&amp;&amp;i++;l=false;if(n){a&gt;-1&amp;&amp;parseCell();n.push(e.elt("TableDelimiter",f+r,f+r+1))}a=o=-1}h=!h&amp;&amp;s==92}if(a&gt;-1){i++;n&amp;&amp;parseCell()}return i}function hasPipe(e,t){for(let s=t;s&lt;e.length;s++){let t=e.charCodeAt(s);if(t==124)return true;t==92&amp;&amp;s++}return false}const v=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class TableParser{constructor(){this.rows=null}nextLine(e,t,s){if(this.rows==null){this.rows=false;let n;if((t.next==45||t.next==58||t.next==124)&amp;&amp;v.test(n=t.text.slice(t.pos))){let r=[],i=parseRow(e,s.content,0,r,s.start);i==parseRow(e,n,t.pos)&amp;&amp;(this.rows=[e.elt("TableHeader",s.start,s.start+s.content.length,r),e.elt("TableDelimiter",e.lineStart+t.pos,e.lineStart+t.text.length)])}}else if(this.rows){let s=[];parseRow(e,t.text,t.pos,s,e.lineStart);this.rows.push(e.elt("TableRow",e.lineStart+t.pos,e.lineStart+t.text.length,s))}return false}finish(e,t){if(!this.rows)return false;e.addLeafElement(t,e.elt("Table",t.start,t.start+t.content.length,this.rows));return true}}const N={defineNodes:[{name:"Table",block:true},{name:"TableHeader",style:{"TableHeader/...":o.heading}},"TableRow",{name:"TableCell",style:o.content},{name:"TableDelimiter",style:o.processingInstruction}],parseBlock:[{name:"Table",leaf(e,t){return hasPipe(t.content,0)?new TableParser:null},endLeaf(e,t,s){if(s.parsers.some((e=&gt;e instanceof TableParser))||!hasPipe(t.text,t.basePos))return false;let n=e.scanLine(e.absoluteLineEnd+1).text;return v.test(n)&amp;&amp;parseRow(e,t.text,t.basePos)==parseRow(e,n,t.basePos)},before:"SetextHeading"}]};class TaskParser{nextLine(){return false}finish(e,t){e.addLeafElement(t,e.elt("Task",t.start,t.start+t.content.length,[e.elt("TaskMarker",t.start,t.start+3),...e.parser.parseInline(t.content.slice(3),t.start+3)]));return true}}const R={defineNodes:[{name:"Task",block:true,style:o.list},{name:"TaskMarker",style:o.atom}],parseBlock:[{name:"TaskList",leaf(e,t){return/^\[[ xX]\][ \t]/.test(t.content)&amp;&amp;e.parentType().name=="ListItem"?new TaskParser:null},after:"SetextHeading"}]};const O=/(www\.)|(https?:\/\/)|([\w.+-]+@)|(mailto:|xmpp:)/gy;const z=/[\w-]+(\.[\w-]+)+(\/[^\s&lt;]*)?/gy;const D=/[\w-]+\.[\w-]+($|\/)/;const X=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy;const j=/\/[a-zA-Z\d@.]+/gy;function count(e,t,s,n){let r=0;for(let i=t;i&lt;s;i++)e[i]==n&amp;&amp;r++;return r}function autolinkURLEnd(e,t){z.lastIndex=t;let s=z.exec(e);if(!s||D.exec(s[0])[0].indexOf("_")&gt;-1)return-1;let n=t+s[0].length;for(;;){let s,r=e[n-1];if(/[?!.,:*_~]/.test(r)||r==")"&amp;&amp;count(e,t,n,")")&gt;count(e,t,n,"("))n--;else{if(r!=";"||!(s=/&amp;(?:#\d+|#x[a-f\d]+|\w+);$/.exec(e.slice(t,n))))break;n=t+s.index}}return n}function autolinkEmailEnd(e,t){X.lastIndex=t;let s=X.exec(e);if(!s)return-1;let n=s[0][s[0].length-1];return n=="_"||n=="-"?-1:t+s[0].length-(n=="."?1:0)}const F={parseInline:[{name:"Autolink",parse(e,t,s){let n=s-e.offset;O.lastIndex=n;let r=O.exec(e.text),i=-1;if(!r)return-1;if(r[1]||r[2])i=autolinkURLEnd(e.text,n+r[0].length);else if(r[3])i=autolinkEmailEnd(e.text,n);else{i=autolinkEmailEnd(e.text,n+r[0].length);if(i&gt;-1&amp;&amp;r[0]=="xmpp:"){j.lastIndex=i;r=j.exec(e.text);r&amp;&amp;(i=r.index+r[0].length)}}if(i&lt;0)return-1;e.addElement(e.elt("URL",s,i+e.offset));return i+e.offset}}]};const U=[N,R,P,F];function parseSubSuper(e,t,s){return(n,r,i)=&gt;{if(r!=e||n.char(i+1)==e)return-1;let l=[n.elt(s,i,i+1)];for(let r=i+1;r&lt;n.end;r++){let a=n.char(r);if(a==e)return n.addElement(n.elt(t,i,r+1,l.concat(n.elt(s,r,r+1))));a==92&amp;&amp;l.push(n.elt("Escape",r,2+r++));if(space(a))break}return-1}}const $={defineNodes:[{name:"Superscript",style:o.special(o.content)},{name:"SuperscriptMark",style:o.processingInstruction}],parseInline:[{name:"Superscript",parse:parseSubSuper(94,"Superscript","SuperscriptMark")}]};const q={defineNodes:[{name:"Subscript",style:o.special(o.content)},{name:"SubscriptMark",style:o.processingInstruction}],parseInline:[{name:"Subscript",parse:parseSubSuper(126,"Subscript","SubscriptMark")}]};const _={defineNodes:[{name:"Emoji",style:o.character}],parseInline:[{name:"Emoji",parse(e,t,s){let n;return t==58&amp;&amp;(n=/^[a-zA-Z_0-9]+:/.exec(e.slice(s+1,e.end)))?e.addElement(e.elt("Emoji",s,s+1+n[0].length)):-1}}]};export{F as Autolink,BlockContext,Element,_ as Emoji,U as GFM,InlineContext,LeafBlock,Line,MarkdownParser,P as Strikethrough,q as Subscript,$ as Superscript,N as Table,R as TaskList,parseCode,H as parser};

</pre></body></html>