UNPKG

html-to-md

Version:

A JS library for convert HTML<String> to markdown<String>, gzip 10kb

1 lines 62.8 kB
!function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e():"function"===typeof define&&define.amd?define([],e):"object"===typeof exports?exports.html2md=e():t.html2md=e()}(this,function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=46)}([function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(1),o=r(12),i=r(6),a=r(7),c=r(2),u=function(){function t(t,e,r){var o=void 0===r?{}:r,i=o.keepSpace,a=void 0!==i&&i,c=o.prevTagName,u=void 0===c?"":c,s=o.nextTagName,p=void 0===s?"":s,l=o.prevTagStr,f=void 0===l?"":l,h=o.nextTagStr,d=void 0===h?"":h,_=o.parentTag,y=void 0===_?"":_,v=o.isFirstSubTag,g=void 0===v||v,b=o.calcLeading,m=void 0!==b&&b,O=o.leadingSpace,S=void 0===O?"":O,T=o.layer,x=void 0===T?1:T,j=o.noWrap,w=void 0!==j&&j,P=o.prevHasEndSpace,M=void 0!==P&&P,E=o.prevHasStartSpace,N=void 0!==E&&E,C=o.match,L=void 0===C?null:C,k=o.indentSpace,A=void 0===k?"":k,H=o.language,W=void 0===H?"":H,V=o.count,R=void 0===V?1:V,I=o.tableColumnCount,q=void 0===I?0:I,D=o.noExtraLine,U=void 0!==D&&D,B=o.inTable,F=void 0!==B&&B;if(this.tagName=e,this.rawStr=t,this.parentTag=y,this.prevTagName=u,this.nextTagName=p,this.prevTagStr=f,this.nextTagStr=d,this.isFirstSubTag=g,this.calcLeading=m,this.leadingSpace=S,this.layer=x,this.noWrap=w,this.match=L,this.indentSpace=A,this.language=W,this.count=R,this.inTable=F,this.tableColumnCount=q,this.noExtraLine=U,this.prevHasEndSpace=M,this.prevHasStartSpace=N,this.hasStartSpace=!1,this.hasEndSpace=!1,this.keepSpace=a,!this.__detectStr__(t,this.tagName))return this.attrs={},void(this.innerHTML="");var G=this.__fetchTagAttrAndInnerHTML__(t),$=G.attr,J=G.innerHTML;J.startsWith(" ")&&(0,n.isSpacePassingTag)(e)&&(this.hasStartSpace=!0),J.endsWith(" ")&&(0,n.isSpacePassingTag)(e)&&(this.hasEndSpace=!0),this.attrs=$,this.innerHTML=J}return t.prototype.__detectStr__=function(t,e){if("<"!==t[0])return"Not a valid tag, current tag name: ".concat(this.tagName,", tag content: ").concat(t),!1;for(var r="",n=!1,o=1;o<t.length&&">"!==t[o];o++)!n&&/(\s|\/)/.test(t[o])&&(n=!0),n||(r+=t[o]);return r===e},t.prototype.__fetchTagAttrAndInnerHTML__=function(t){for(var e="",r=1;r<t.length&&">"!==t[r];r++)e+=t[r];for(var o=t.slice(r+1),i="",a=-1,c=o.length-1;c>=0;c--)if((i=o[c]+i).startsWith("</")){i.startsWith("</"+this.tagName+">")&&(a=c);break}-1===a&&(0,n.isSelfClosing)(this.tagName)&&this.tagName;var u=(0,n.getTagAttributes)(e);return this.tagName&&delete u[this.tagName],{attr:u,innerHTML:o.slice(0,a)}},t.prototype.__onlyLeadingSpace__=function(t){t=t.trim();for(var e=0;e<t.length;e++)if(t[e]!==i.SINGLE)return!1;return!0},t.prototype.__isEmpty__=function(t){return!this.keepSpace&&(""===t&&"td"!==this.tagName||this.calcLeading&&this.__onlyLeadingSpace__(t))},t.prototype.getValidSubTagName=function(t){return t},t.prototype.beforeParse=function(){var t=c.default.get().tagListener;if(t){var e=t(this.tagName,{parentTag:this.parentTag,prevTagName:this.prevTagName,nextTagName:this.nextTagName,isFirstSubTag:this.isFirstSubTag,attrs:this.attrs,innerHTML:this.innerHTML,language:this.language,match:this.match,isSelfClosing:!1}),r=e.attrs,n=e.language,o=e.match;this.attrs=r,"string"===typeof n&&(this.language=n),"undefined"!==typeof o&&(this.match=o)}return""},t.prototype.parseValidSubTag=function(t,e,r){var o=new((0,n.getTagConstructor)(e))(t,e,r);return[o.exec(),o]},t.prototype.parseOnlyString=function(t,e,r){var n=new o.default(t,e,r);return[n.exec(),n]},t.prototype.afterParsed=function(t){return t},t.prototype.slim=function(t){return this.keepSpace?t:t.trim()},t.prototype.beforeMergeSpace=function(t){return t},t.prototype.mergeSpace=function(t,e,r){return this.keepSpace&&"pre"!==this.tagName?t.endsWith("\n")?t:t+r.replace(/\n+/g,"\n"):e+t+r},t.prototype.afterMergeSpace=function(t){return t},t.prototype.beforeReturn=function(t){return!((0,n.isSpacePassingTag)(this.prevTagName)&&this.prevHasEndSpace||(0,n.isSpacePassingTag)(this.tagName)&&this.hasStartSpace)||/^\s+/.test(t)||/\s+$/.test(this.prevTagStr)?t:" "+t},t.prototype.exec=function(t,e){void 0===t&&(t=""),void 0===e&&(e="");for(var r=this.beforeParse(),o=(0,n.generateGetNextValidTag)(this.innerHTML),i=o(),c=i[0],u=i[1],s=null,p=!1,l=!1;""!==u;){var f,h=o(),d=h[0],_=h[1],y={parentTag:this.tagName,nextTagName:d,nextTagStr:_,prevTagName:s,prevTagStr:r,prevHasEndSpace:l,prevHasStartSpace:p,leadingSpace:this.leadingSpace,layer:this.layer,keepSpace:this.keepSpace,inTable:this.inTable,calcLeading:("li"===this.tagName||"ol"===this.tagName||"ul"===this.tagName)&&this.calcLeading},v=void 0,g=void 0;if(null!=c)v=(f=this.parseValidSubTag(u,c,y))[0],g=f[1];else v=(f=this.parseOnlyString(u,c,y))[0],g=f[1];l=(null===g||void 0===g?void 0:g.hasEndSpace)||!1,p=(null===g||void 0===g?void 0:g.hasStartSpace)||!1;var b=this.getValidSubTagName(c);c=d,u=_,null==b&&this.__isEmpty__(v)||(!this.keepSpace&&(0,a.default)(s)&&(0,a.default)(b)&&(r=r.replace(/\n+$/,"\n"),v=v.replace(/^\n+/,"\n")),s=b,this.isFirstSubTag=!1,r+=v)}return r=this.afterParsed(r),r=this.slim(r),this.__isEmpty__(r)?"":(r=this.beforeMergeSpace(r),!this.noExtraLine&&(0,a.default)(this.tagName)&&this.prevTagName&&!r.startsWith("\n")&&!(0,a.default)(this.prevTagName)&&this.parentTag&&(t="\n\n"),r=this.mergeSpace(r,t,e),this.noWrap&&!this.keepSpace&&(r=r.replace(/\s+/g," ")),r=this.afterMergeSpace(r),r=this.beforeReturn(r))},t}();e.default=u},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isSpacePassingTag=e.isIndependentTag=e.clearComment=e.getLanguage=e.getTableAlign=e.getTagAttributes=e.isSelfClosing=e.generateGetNextValidTag=e.getTagConstructor=e.getRealTagName=e.unescapeStr=e.extraEscape=void 0;var n=r(18);Object.defineProperty(e,"extraEscape",{enumerable:!0,get:function(){return n.extraEscape}}),Object.defineProperty(e,"unescapeStr",{enumerable:!0,get:function(){return n.unescapeStr}});var o=r(47);e.generateGetNextValidTag=o.default;var i=r(48);e.getTagConstructor=i.default;var a=r(11);e.isSelfClosing=a.default;var c=r(51);e.getTagAttributes=c.default;var u=r(52);e.getLanguage=u.default;var s=r(53);e.clearComment=s.default;var p=r(13);e.getRealTagName=p.default;var l=r(7);e.isIndependentTag=l.default;var f=r(54);e.isSpacePassingTag=f.default;var h=r(55);e.getTableAlign=h.default},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){var e=void 0===t?{}:t,r=e.skipTags,n=void 0===r?[]:r,o=e.emptyTags,i=void 0===o?[]:o,a=e.ignoreTags,c=void 0===a?[]:a,u=e.aliasTags,s=void 0===u?{}:u,p=e.renderCustomTags,l=void 0===p||p,f=e.tagListener,h=void 0===f?function(t,e){return e}:f;this.options={skipTags:n,emptyTags:i,ignoreTags:c,aliasTags:s,renderCustomTags:l,tagListener:h}}return t.prototype.get=function(){return this.options},t.prototype.clear=function(){this.options={}},t.prototype.set=function(t,e){var r=this;t&&"[object Object]"===Object.prototype.toString.call(t)&&Object.keys(t).forEach(function(n){e?r.options[n]=t[n]:function(t,e,r){if(!(r in t))return void(t[r]=e[r]);var n=Array.isArray(t[r]),o="[object Object]"===Object.prototype.toString.call(t[r]);t[r]=n?t[r].concat(e[r]):o?Object.assign(t[r],e[r]):e[r]}(r.options,t,n)})},t.prototype.reset=function(){this.options=JSON.parse(JSON.stringify(o)),this.options.tagListener=function(t,e){return e}},t}();var o={ignoreTags:["","style","head","!doctype","form","svg","noscript","script","meta"],skipTags:["div","html","body","nav","section","footer","main","aside","article","header"],emptyTags:[],aliasTags:{figure:"p",dl:"p",dd:"p",dt:"p",figcaption:"p"},renderCustomTags:!0},i=new n;i.reset(),e.default=i},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!==typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=function(t){function e(e,r){void 0===r&&(r="h1");var n=t.call(this,e,r)||this;return n.match="#",n}return n(e,t),e.prototype.beforeMergeSpace=function(t){return this.match+" "+t},e.prototype.exec=function(e,r){return e||(e="\n"),r||(r="\n"),t.prototype.exec.call(this,e,r)},e}(r(0).default);e.default=o},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(1),o=r(2),i=function(){function t(t,e,r){var n=void 0===r?{}:r,o=n.parentTag,i=void 0===o?"":o,a=n.leadingSpace,c=void 0===a?"":a,u=n.layer,s=void 0===u?1:u,p=n.isFirstSubTag,l=void 0!==p&&p,f=n.inTable,h=void 0!==f&&f,d=n.match,_=void 0===d?null:d,y=n.prevTagName,v=void 0===y?"":y,g=n.nextTagName,b=void 0===g?"":g;if(this.tagName=e,this.rawStr=t,this.parentTag=i,this.isFirstSubTag=l,this.prevTagName=v,this.nextTagName=b,this.leadingSpace=c,this.layer=s,this.innerHTML="",this.match=_,this.inTable=h,this.__detectStr__(t,this.tagName)){var m=this.__fetchTagAttr__(t).attr;this.attrs=m}else this.attrs={}}return t.prototype.__detectStr__=function(t,e){if("<"!==t[0])return"Not a valid tag, current tag name: ".concat(this.tagName,", tag content: ").concat(t),!1;for(var r="",n=!1,o=1;o<t.length&&">"!==t[o];o++)!n&&/(\s|\/)/.test(t[o])&&(n=!0),n||(r+=t[o]);return r===e},t.prototype.__fetchTagAttr__=function(t){for(var e="",r=1;r<t.length&&">"!==t[r];r++)e+=t[r];return{attr:(0,n.getTagAttributes)(e)}},t.prototype.beforeParse=function(){var t=o.default.get().tagListener;if(t){var e=t(this.tagName,{parentTag:this.parentTag,prevTagName:this.prevTagName,nextTagName:this.nextTagName,isFirstSubTag:this.isFirstSubTag,attrs:this.attrs,innerHTML:this.innerHTML,match:this.match,isSelfClosing:!0}),r=e.attrs,n=e.match;this.attrs=r,this.match=n}return""},t.prototype.beforeMergeSpace=function(t){return t},t.prototype.afterMergeSpace=function(t){return t},t.prototype.beforeReturn=function(t){return t},t.prototype.exec=function(t,e){void 0===t&&(t=""),void 0===e&&(e="");var r=this.beforeParse();return r=t+(r=this.beforeMergeSpace(r))+e,r=this.afterMergeSpace(r),r=this.beforeReturn(r)},t}();e.default=i},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(){}return t.prototype.exec=function(){return""},t}();e.default=n},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TRIPLE=e.DOUBLE=e.SINGLE=void 0;e.SINGLE="\u2608";e.DOUBLE="\u2608\u2608";e.TRIPLE="\u2608\u2608\u2608"},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(13),o={html:!0,body:!0,p:!0,div:!0,pre:!0,section:!0,blockquote:!0,aside:!0,li:!0,ul:!0,ol:!0,form:!0,hr:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,dl:!0,dd:!0,dt:!0,br:!0,table:!0};e.default=function(t){if(!t)return!1;var e=(0,n.default)(t);return!!e&&!!o[e]}},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!==typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),o=this&&this.__assign||function(){return(o=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.__EmptySelfClose__=e.__Empty__=void 0;var i=r(0),a=r(4),c=function(t){function e(e,r,n){return void 0===r&&(r="__empty__"),t.call(this,e,r,n)||this}return n(e,t),e.prototype.slim=function(t){return t},e.prototype.parseValidSubTag=function(r,n,i){if("__skip__"===this.tagName)return t.prototype.parseValidSubTag.call(this,r,n,i);var a=new e(r,n,o({},i));return[a.exec(),a]},e.prototype.parseOnlyString=function(e,r,n){return"__skip__"===this.tagName?t.prototype.parseOnlyString.call(this,e,r,n):[e,null]},e.prototype.exec=function(){return t.prototype.exec.call(this,"","")},e}(i.default);e.__Empty__=c;var u=function(t){function e(e,r){void 0===r&&(r="__emptyselfclose__");var n=t.call(this,e,r)||this;return n.tagName=r,n}return n(e,t),e.prototype.exec=function(){return t.prototype.exec.call(this,"","")},e}(a.default);e.__EmptySelfClose__=u},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!==typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.__SkipSelfClose__=e.__Skip__=void 0;var o=r(0),i=r(4),a=r(1),c=function(t){function e(e,r,n){void 0===r&&(r="__skip__");var o=t.call(this,e,r,n)||this;return o.noNeedWrap=["td","th"],o}return n(e,t),e.prototype.exec=function(){var e=(0,a.isIndependentTag)((0,a.getRealTagName)(this.tagName))&&(!this.parentTag||!this.noNeedWrap.includes(this.parentTag)),r=e?"\n":"",n=e?"\n":"";return t.prototype.exec.call(this,r,n)},e}(o.default);e.__Skip__=c;var u=function(t){function e(e,r,n){return void 0===r&&(r="__skipselfclose__"),t.call(this,e,r,n)||this}return n(e,t),e.prototype.exec=function(){return""},e}(i.default);e.__SkipSelfClose__=u},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!==typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.__NoMatchSelfClose__=e.__NoMatch__=void 0;var o=r(0),i=r(4),a=function(t){function e(e,r){return void 0===r&&(r="__nomatch__"),t.call(this,e,r)||this}return n(e,t),e.prototype.beforeMergeSpace=function(t){return"<".concat(this.tagName,">").concat(t,"</").concat(this.tagName,">")},e.prototype.exec=function(){return t.prototype.exec.call(this,"","")},e}(o.default);e.__NoMatch__=a;var c=function(t){function e(e,r){return void 0===r&&(r="__nomatchselfclose__"),t.call(this,e,r)||this}return n(e,t),e.prototype.exec=function(){return"<".concat(this.tagName," />")},e}(i.default);e.__NoMatchSelfClose__=c},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n={img:!0,hr:!0,input:!0,br:!0,meta:!0,link:!0,"!doctype":!0,base:!0,col:!0,area:!0,param:!0,object:!0,embed:!0,keygen:!0,source:!0};e.default=function(t){return null!=t&&!!n[t.toLowerCase()]}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(1),o=r(7),i=function(){function t(t,e,r){void 0===e&&(e="__nomatch__");var n=void 0===r?{}:r,o=n.keepSpace,i=void 0!==o&&o,a=n.prevTagName,c=void 0===a?"":a,u=n.nextTagName,s=void 0===u?"":u,p=n.prevTagStr,l=void 0===p?"":p,f=n.prevHasEndSpace,h=void 0!==f&&f,d=n.prevHasStartSpace,_=void 0!==d&&d,y=n.parentTag,v=void 0===y?"":y,g=n.calcLeading,b=void 0!==g&&g,m=n.layer,O=void 0===m?1:m,S=n.leadingSpace,T=void 0===S?"":S,x=n.inTable,j=void 0!==x&&x;this.tagName=e,this.nextTagName=s,this.prevTagName=c,this.parentTag=v,this.prevTagStr=l,this.keepSpace=i,this.calcLeading=b,this.leadingSpace=T,this.layer=O,this.rawStr=t,this.inTable=j,this.prevHasEndSpace=h,this.prevHasStartSpace=_,this.hasEndSpace=!1,this.hasStartSpace=!1,t.startsWith(" ")&&(this.hasStartSpace=!0),t.endsWith(" ")&&(this.hasEndSpace=!0)}return t.prototype.slim=function(t){if(this.keepSpace)return t;var e=t.replace(/\s+/g," ");return(0,o.default)(this.prevTagName)&&(e=e.trimLeft()),(0,o.default)(this.nextTagName)&&(e=e.trimRight()),e},t.prototype.beforeReturn=function(t){if(this.keepSpace)return t;if(this.calcLeading)return this.leadingSpace+(0,n.extraEscape)(t);var e=(0,n.extraEscape)(t);return this.inTable&&(e=e.replace(/\|/g,"\\|")),this.prevTagName,this.prevHasEndSpace,this.prevTagStr,(0,n.isSpacePassingTag)(this.prevTagName)&&this.prevHasEndSpace&&!/^\s+/.test(t)&&!/\s+$/.test(this.prevTagStr)?" "+t:e},t.prototype.exec=function(){var t=this.rawStr;return t=this.slim(t),t=this.beforeReturn(t)},t}();e.default=i},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(2);e.default=function(t){if(!t)return t;var e=n.default.get().aliasTags;return null!=(null===e||void 0===e?void 0:e[t])?e[t]:t}},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!==typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=function(t){function e(e,r,n){void 0===r&&(r="strong");var o=t.call(this,e,r,n)||this;return o.layer=1,o.match=o.match||"**",o}return n(e,t),e.prototype.beforeMergeSpace=function(t){return this.match+t+this.match},e.prototype.exec=function(e,r){return void 0===e&&(e=""),void 0===r&&(r=""),null!=this.match&&this.prevTagStr&&!this.prevTagStr.endsWith("\\"+this.match[0])&&this.prevTagStr.endsWith(this.match[0])&&(e=" "),t.prototype.exec.call(this,e,r)},e}(r(0).default);e.default=o},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!==typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=function(t){function e(e,r){void 0===r&&(r="del");var n=t.call(this,e,r)||this;return n.match=n.match||"~~",n}return n(e,t),e.prototype.beforeMergeSpace=function(t){return this.match+t+this.match},e.prototype.exec=function(e,r){return void 0===e&&(e=""),void 0===r&&(r=""),t.prototype.exec.call(this,e,r)},e}(r(0).default);e.default=o},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!==typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=function(t){function e(e,r,n){void 0===r&&(r="em");var o=t.call(this,e,r,n)||this;return o.match=o.match||"*",o}return n(e,t),e.prototype.beforeMergeSpace=function(t){return this.match+t+this.match},e.prototype.exec=function(e,r){return void 0===e&&(e=""),void 0===r&&(r=""),"strong"===this.parentTag&&this.nextTagStr&&(r=" "),null!=this.match&&this.prevTagStr&&!this.prevTagStr.endsWith("\\"+this.match)&&this.prevTagStr.endsWith(this.match)&&(e=" "),t.prototype.exec.call(this,e,r)},e}(r(0).default);e.default=o},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!==typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=function(t){function e(e,r,n){void 0===r&&(r="th");var o=t.call(this,e,r,n)||this;return o.tagName=r,o}return n(e,t),e.prototype.beforeMergeSpace=function(t){return t+"|"},e.prototype.parseValidSubTag=function(e,r,n){return"ul"===r||"ol"===r||"table"===r||"pre"===r?[e.replace(/([\n\r])/g,""),null]:t.prototype.parseValidSubTag.call(this,e,r,n)},e.prototype.exec=function(e,r){return void 0===e&&(e=""),void 0===r&&(r=""),t.prototype.exec.call(this,e,r)},e}(r(0).default);e.default=o},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.unescapeStr=e.extraEscape=e.escapeStr=void 0;var n={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'","&apos;":"'","&#x60;":"`","&ldquo;":"\u201c","&rdquo;":"\u201d"},o={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","`":"&#x60;","\u201c":"&ldquo;","\u201d":"&rdquo;"},i=/[&<>"'`\u201c\u201d]/g,a=RegExp(i.source),c=/&(?:amp|lt|gt|quot|#39|apos|#x60|ldquo|rdquo);/g,u=RegExp(c.source),s=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];e.escapeStr=function(t){return t&&a.test(t)?t.replace(i,function(t){return o[t]}):t},e.unescapeStr=function(t){return t=t&&u.test(t)?t.replace(c,function(t){return n[t]}):t},e.extraEscape=function(t){return s.reduce(function(t,e){return t.replace(e[0],e[1])},t)}},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!==typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=function(t){function e(e,r,n){return void 0===r&&(r="a"),t.call(this,e,r,n)||this}return n(e,t),e.prototype.beforeMergeSpace=function(t){var e=this.attrs,r=e.href,n=e.title,o=r||"";return n?"[".concat(t,"](").concat(o,' "').concat(n,'")'):"[".concat(t,"](").concat(o,")")},e.prototype.parseOnlyString=function(e,r,n){return"tbody"===this.parentTag||"thead"===this.parentTag?[e,null]:t.prototype.parseOnlyString.call(this,e,r,n)},e.prototype.exec=function(e,r){return void 0===e&&(e=""),void 0===r&&(r=""),t.prototype.exec.call(this,e,r)},e}(r(0).default);e.default=o},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!==typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=function(t){function e(e,r,n){return void 0===r&&(r="b"),t.call(this,e,r,n)||this}return n(e,t),e.prototype.exec=function(e,r){return t.prototype.exec.call(this,e,r)},e}(r(14).default);e.default=o},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!==typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),o=this&&this.__assign||function(){return(o=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var i=r(7),a=r(0),c=r(1),u=function(t){function e(e,r,n){void 0===r&&(r="blockquote");var o=t.call(this,e,r,n)||this;return o.match=o.match||">",o.fillPerLine=o.fillPerLine.bind(o),o}return n(e,t),e.prototype.beforeMergeSpace=function(t){if(""===t.trim())return"";var e=this.match+" "+t;return this.calcLeading?this.leadingSpace+e:e},e.prototype.afterMergeSpace=function(t){for(var e=this,r=t.split("\n"),n=r.length-1;n>=0;n--)n<r.length-1&&">"===r[n].trim()&&">"===r[n+1].trim()&&r.splice(n,1);return(r=r.map(function(t){return""===t?"":e.fillPerLine(t)})).join("\n")},e.prototype.beforeReturn=function(t){return t.replace("\n\n","\n")},e.prototype.fillPerLine=function(t){var e=">";if(this.calcLeading&&(e=this.leadingSpace+">"),!t.startsWith(e)){var r=this.match+" "+t;return this.calcLeading?this.leadingSpace+r:r}return t},e.prototype.parseValidSubTag=function(t,e,r){var n;"blockquote"===e?n=new((0,c.getTagConstructor)(e))(t,e,o(o({},r),{calcLeading:this.calcLeading,match:this.match+">",noExtraLine:!0})):n=new((0,c.getTagConstructor)(e))(t,e,o(o({},r),{noExtraLine:!0}));var a=n.exec(),u="";this.calcLeading&&(u=this.leadingSpace);var s=(0,i.default)(r.prevTagName)&&"br"!==r.prevTagName,p=(0,i.default)(r.nextTagName)&&"br"!==r.nextTagName,l=(0,i.default)(e)&&"br"!==e;return this.isFirstSubTag?[a.trimLeft().replace(u,""),n]:l?(a=u+this.match+a,s||(a="\n"+a),!p&&r.nextTagStr&&r.nextTagStr.trim()&&(a+=this.match+"\n"),[a,n]):s?[u+this.match+"\n"+a,n]:[a,n]},e.prototype.exec=function(e,r){return void 0===e&&(e="\n"),void 0===r&&(r="\n"),t.prototype.exec.call(this,e,r)},e}(a.default);e.default=u},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!==typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=r(4),i=r(18),a=function(t){function e(e,r,n){return void 0===r&&(r="b"),t.call(this,e,r,n)||this}return n(e,t),e.prototype.exec=function(t,e){return void 0===e&&(e="\n"),this.inTable?(0,i.escapeStr)("<br />"):" "+e},e}(o.default);e.default=a},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!==typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),o=this&&this.__assign||function(){return(o=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var i=r(0),a=r(1),c=function(t){function e(e,r,n){void 0===r&&(r="code");var o=t.call(this,e,r,n)||this;return o.match=null==o.match?"`":o.match,o.noWrap="`"===o.match,o.layer=1,o}return n(e,t),e.prototype.beforeMergeSpace=function(t){var e,r;return""!==this.match&&"`"!==this.match?(e=this.match+" ",r=" "+this.match):(e=this.match,r=this.match),e+t+r},e.prototype.parseValidSubTag=function(t,e,r){var n;return"pre"===e?[(n=new((0,a.getTagConstructor)(e))(t,e,o(o({},r),{language:"",match:""}))).exec("","\n"),n]:[(n=new((0,a.getTagConstructor)(e))(t,e,o(o({},r),{keepSpace:this.keepSpace,noWrap:this.noWrap}))).exec("",""),n]},e.prototype.parseOnlyString=function(t){if(""!==this.match&&t){var e=1;(t.startsWith("`")||t.endsWith("`"))&&(e=2,(t.startsWith("``")||t.endsWith("``"))&&(e=3)),this.match="`".repeat(e)}return[(0,a.unescapeStr)(t),null]},e.prototype.slim=function(t){return this.keepSpace?t:t.trim()},e.prototype.exec=function(e,r){return void 0===e&&(e=""),void 0===r&&(r=""),t.prototype.exec.call(this,e,r)},e}(i.default);e.default=c},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!==typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=function(t){function e(e,r){void 0===r&&(r="h1");var n=t.call(this,e,r)||this;return n.match="#",n}return n(e,t),e.prototype.exec=function(e,r){return void 0===e&&(e="\n"),void 0===r&&(r="\n"),t.prototype.exec.call(this,e,r)},e}(r(3).default);e.default=o},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!==typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=function(t){function e(e,r){void 0===r&&(r="h2");var n=t.call(this,e,r)||this;return n.match="##",n}return n(e,t),e.prototype.exec=function(e,r){return void 0===e&&(e="\n"),void 0===r&&(r="\n"),t.prototype.exec.call(this,e,r)},e}(r(3).default);e.default=o},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!==typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=function(t){function e(e,r){void 0===r&&(r="h3");var n=t.call(this,e,r)||this;return n.match="###",n}return n(e,t),e.prototype.exec=function(e,r){return void 0===e&&(e="\n"),void 0===r&&(r="\n"),t.prototype.exec.call(this,e,r)},e}(r(3).default);e.default=o},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!==typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=function(t){function e(e,r){void 0===r&&(r="h4");var n=t.call(this,e,r)||this;return n.match="####",n}return n(e,t),e.prototype.exec=function(e,r){return void 0===e&&(e="\n"),void 0===r&&(r="\n"),t.prototype.exec.call(this,e,r)},e}(r(3).default);e.default=o},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!==typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=function(t){function e(e,r){void 0===r&&(r="h5");var n=t.call(this,e,r)||this;return n.match="#####",n}return n(e,t),e.prototype.exec=function(e,r){return void 0===e&&(e="\n"),void 0===r&&(r="\n"),t.prototype.exec.call(this,e,r)},e}(r(3).default);e.default=o},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!==typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=function(t){function e(e,r){void 0===r&&(r="h6");var n=t.call(this,e,r)||this;return n.match="######",n}return n(e,t),e.prototype.exec=function(e,r){return void 0===e&&(e="\n"),void 0===r&&(r="\n"),t.prototype.exec.call(this,e,r)},e}(r(3).default);e.default=o},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!==typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=function(t){function e(e,r,n){void 0===r&&(r="hr");var o=t.call(this,e,r,n)||this;return o.match="---",o}return n(e,t),e.prototype.beforeMergeSpace=function(){return this.leadingSpace+this.match},e.prototype.beforeReturn=function(t){return t.replace(/^(?:\n\s*)/,"\n\n").replace(/(?:\n\s*)$/,"\n\n"),t},e.prototype.exec=function(e,r){return void 0===e&&(e="\n"),void 0===r&&(r="\n"),t.prototype.exec.call(this,e,r)},e}(r(4).default);e.default=o},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!==typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=function(t){function e(e,r,n){return void 0===r&&(r="i"),t.call(this,e,r,n)||this}return n(e,t),e.prototype.exec=function(e,r){return t.prototype.exec.call(this,e,r)},e}(r(16).default);e.default=o},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!==typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=function(t){function e(e,r,n){return void 0===r&&(r="img"),t.call(this,e,r,n)||this}return n(e,t),e.prototype.beforeMergeSpace=function(){var t=this.attrs,e=t.src,r=t.alt;return r||(r=""),e||(e=""),"![".concat(r,"](").concat(e,")")},e.prototype.exec=function(e,r){return void 0===e&&(e=""),void 0===r&&(r=""),t.prototype.exec.call(this,e,r)},e}(r(4).default);e.default=o},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!==typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=function(t){function e(e,r,n){return void 0===r&&(r="input"),t.call(this,e,r,n)||this}return n(e,t),e.prototype.beforeMergeSpace=function(){var t=this.attrs,e=t.type,r=t.checked;return"li"===this.parentTag&&"checkbox"===e?null!=r?"[x] ":"[ ] ":""},e.prototype.exec=function(e,r){return void 0===e&&(e=""),void 0===r&&(r=""),t.prototype.exec.call(this,e,r)},e}(r(4).default);e.default=o},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!==typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),o=this&&this.__assign||function(){return(o=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var i=r(0),a=r(1),c=r(7),u=r(6),s=function(t){function e(e,r,n){void 0===r&&(r="li");var o=t.call(this,e,r,n)||this;return o.match=o.match||"*",o.extraGap="",o}return n(e,t),e.prototype.beforeMergeSpace=function(t){return this.extraGap+this.leadingSpace+this.match+" "+t},e.prototype.__calcNextLeading__=function(){var t,e,r;return 1===(null===(t=this.match)||void 0===t?void 0:t.length)?u.DOUBLE:2===(null===(e=this.match)||void 0===e?void 0:e.length)?u.TRIPLE:3===(null===(r=this.match)||void 0===r?void 0:r.length)?u.DOUBLE:u.TRIPLE+u.DOUBLE},e.prototype.parseValidSubTag=function(t,e,r){var n=(0,a.getTagConstructor)(e),i=this.__calcNextLeading__(),c=new n(t,e,o(o({},r),{calcLeading:!0,leadingSpace:this.leadingSpace+i,layer:this.layer+1})),u=c.exec();return"p"===e&&(this.extraGap="\n"),this.isFirstSubTag?[u.trimLeft().replace(this.leadingSpace+i,""),c]:[u,c]},e.prototype.parseOnlyString=function(e,r,n){var i=!1;(0,c.default)(n.prevTagName)&&(i=!0);var a=this.__calcNextLeading__(),u=t.prototype.parseOnlyString.call(this,e,r,o(o({},n),{calcLeading:i,leadingSpace:this.leadingSpace+a,layer:this.layer+1})),s=u[0],p=u[1];return this.isFirstSubTag?[s.replace(this.leadingSpace+a,""),p]:[s,p]},e.prototype.beforeReturn=function(e){return t.prototype.beforeReturn.call(this,e)},e.prototype.exec=function(e,r){return void 0===e&&(e="\n"),void 0===r&&(r="\n"),t.prototype.exec.call(this,e,r)},e}(i.default);e.default=s},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!==typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),o=this&&this.__assign||function(){return(o=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var i=r(0),a=r(5),c=r(1),u=r(2),s=function(t){function e(e,r,n){void 0===r&&(r="ol");var o,i=this;i=t.call(this,e,r,n)||this;var a=parseInt(null===(o=null===i||void 0===i?void 0:i.attrs)||void 0===o?void 0:o.start,10);return i.count=isNaN(a)?1:a,i}return n(e,t),e.prototype.__isValidSubTag__=function(t){if(!t)return!1;var e=u.default.get().aliasTags,r=(0,c.getTagConstructor)(t);return"li"===t||"li"==(null===e||void 0===e?void 0:e[t])||r===a.default},e.prototype.getValidSubTagName=function(t){return t&&this.__isValidSubTag__(t)?t:null},e.prototype.parseValidSubTag=function(t,e,r){var n=(0,c.getTagConstructor)(e);if(this.__isValidSubTag__(e)){var i=this.count+".",a=new n(t,e,o(o({},r),{calcLeading:!0,leadingSpace:this.leadingSpace,layer:this.layer,match:i}));return this.count++,[a.exec("","\n"),a]}return["",null]},e.prototype.parseOnlyString=function(){return["",null]},e.prototype.exec=function(e,r){return void 0===e&&(e="\n"),void 0===r&&(r="\n"),t.prototype.exec.call(this,e,r)},e}(i.default);e.default=s},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!==typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=function(t){function e(e,r,n){return void 0===r&&(r="p"),t.call(this,e,r,n)||this}return n(e,t),e.prototype.beforeMergeSpace=function(t){return this.calcLeading?this.leadingSpace+t:t},e.prototype.exec=function(e,r){return void 0===e&&(e="\n"),void 0===r&&(r="\n"),this.prevTagName||!this.prevTagStr||this.prevTagStr.endsWith("\n")||(e="\n\n"),this.nextTagName||!this.nextTagStr||this.nextTagStr.startsWith("\n")||(r="\n\n"),this.inTable&&(e="",r=""),t.prototype.exec.call(this,e,r)},e}(r(0).default);e.default=o},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!==typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),o=this&&this.__assign||function(){return(o=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var i=r(0),a=r(8),c=r(1),u=r(6),s=function(t){function e(e,r,n){void 0===r&&(r="pre");var o=t.call(this,e,r,n)||this;return o.indentSpace=u.DOUBLE+u.DOUBLE,o.isIndent=o.innerHTML.includes("```"),o.match=o.isIndent?"":"```",o.language=o.language||(0,c.getLanguage)(e),o.keepSpace=!0,o}return n(e,t),e.prototype.beforeMergeSpace=function(t){var e=this.isIndent||"code"===this.parentTag?"":this.match+this.language+"\n",r="";return t.endsWith("\n")||(r="\n"),e+t+(this.isIndent||"code"===this.parentTag?"":r+this.match)},e.prototype.fillPerLine=function(t){var e="";return this.calcLeading&&(e=this.leadingSpace),this.isIndent?e+this.indentSpace+t:e+t},e.prototype.afterMergeSpace=function(t){var e=this,r=t.split("\n");return(r=r.map(function(t){return""===t?"":e.fillPerLine(t)})).join("\n")},e.prototype.parseValidSubTag=function(t,e,r){if("code"===e){var n=new((0,c.getTagConstructor)(e))(t,e,o(o({},r),{match:"",language:this.language,keepSpace:!0}));return[n.exec("",""),n]}var i=void 0;return[(i=(0,c.isSelfClosing)(e)?new a.__EmptySelfClose__(t,e):new a.__Empty__(t,e,o(o({},r),{keepSpace:!0}))).exec(),i]},e.prototype.parseOnlyString=function(t){return[t,null]},e.prototype.slim=function(t){return t},e.prototype.exec=function(e,r){return void 0===e&&(e="\n"),void 0===r&&(r="\n"),t.prototype.exec.call(this,e,r)},e}(i.default);e.default=s},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!==typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=function(t){function e(e,r){return void 0===r&&(r="s"),t.call(this,e,r)||this}return n(e,t),e.prototype.exec=function(e,r){return t.prototype.exec.call(this,e,r)},e}(r(15).default);e.default=o},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!==typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=function(t){function e(e,r,n){return void 0===r&&(r="span"),t.call(this,e,r,n)||this}return n(e,t),e.prototype.exec=function(e,r){return void 0===e&&(e=""),void 0===r&&(r=""),t.prototype.exec.call(this,e,r)},e}(r(0).default);e.default=o},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!==typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),o=this&&this.__assign||function(){return(o=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var i=r(0),a=r(1);var c=function(t){function e(e,r,n){void 0===r&&(r="table");var o=t.call(this,e,r,n)||this;return o.exist_thead=!1,o.exist_tbody=!1,o.empty_tbody=!0,o.tableColumnCount=function(t){for(var e="",r=0;r<t.length&&!e.endsWith("</tr>");r++)e+=t[r];return Math.max(e.split("</td>").length-1,e.split("</th>").length-1)}(o.innerHTML),o}return n(e,t),e.prototype.parseValidSubTag=function(t,e,r){"thead"===e&&(this.exist_thead=!0),"tbody"===e&&(this.exist_tbody=!0,this.empty_tbody=!1),"tr"===e&&(this.empty_tbody=!1);var n=new((0,a.getTagConstructor)(e))(t,e,o(o({},r),{tableColumnCount:this.tableColumnCount,inTable:!0}));return[n.exec("","\n"),n]},e.prototype.parseOnlyString=function(){return["",null]},e.prototype.beforeReturn=function(t){if(!this.exist_thead&&!this.exist_tbody&&this.empty_tbody)return"";if(0===this.tableColumnCount)return"";if(!this.exist_tbody){for(var e=(0,a.getTableAlign)(this.innerHTML,this.tableColumnCount),r=this.leadingSpace+"|",n=0;n<e.length;n++)r+=e[n];t=this.empty_tbody?t+r+"\n":r+""+t}return this.exist_thead||(t="\n"+this.leadingSpace+"|".repeat(this.tableColumnCount+1)+(t.startsWith("\n")?"":"\n")+t),t},e.prototype.exec=function(e,r){return void 0===e&&(e="\n"),void 0===r&&(r="\n"),t.prototype.exec.call(this,e,r)},e}(i.default);e.default=c},function(t,e,r){"use strict";va