Markdown parser, done right. 100% CommonMark support, extensions, syntax plugins & high speed https://markdown-it.github.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

4 lines
77 KiB

/* remarkable 1.0.0 https://github.com//jonschlinkert/remarkable */
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var r;"undefined"!=typeof window?r=window:"undefined"!=typeof global?r=global:"undefined"!=typeof self&&(r=self),r.Remarkable=e()}}(function(){var e;return function r(e,t,n){function s(o,a){if(!t[o]){if(!e[o]){var l="function"==typeof require&&require;if(!a&&l)return l(o,!0);if(i)return i(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var u=t[o]={exports:{}};e[o][0].call(u.exports,function(r){var t=e[o][1][r];return s(t?t:r)},u,u.exports,r,e,t,n)}return t[o].exports}for(var i="function"==typeof require&&require,o=0;o<n.length;o++)s(n[o]);return s}({"./":[function(e,r){"use strict";r.exports=e("./lib/")},{"./lib/":10}],1:[function(e,r){"use strict";r.exports={Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDo
}return n?(o=e.pos,e.label_nest_level=0):e.label_nest_level=t-1,e.pos=l,e.tokens.length=c,e.pending=u,e.validateInsideLink=p,o}function n(e,r){var t,n,s=e.posMax,i="";if(60===e.src.charCodeAt(r)){for(r++;s>r;){if(t=e.src.charCodeAt(r),10===t)return!1;if(62===t)return e.pos=r+1,e.link_content=i,!0;92===t&&s>r+1?(r++,i+=e.src[r++]):i+=e.src[r++]}return!1}for(n=0;s>r&&(t=e.src.charCodeAt(r),32!==t)&&!(32>t||127===t);)if(92===t&&s>r+1)r++,i+=e.src[r++];else{if(40===t&&(n++,n>1))break;if(41===t&&(n--,0>n))break;i+=e.src[r++]}return i.length&&e.parser.validateLink(i)?(e.pos=r,e.link_content=i,!0):!1}function s(e,r){var t,n,s=e.posMax,i=e.src.charCodeAt(r);if(34!==i&&39!==i&&40!==i)return!1;for(r++,t="",40===i&&(i=41);s>r;){if(n=e.src.charCodeAt(r),n===i)return e.pos=r+1,e.link_content=t,!0;92===n&&s>r+1?(r++,t+=e.src[r++]):t+=e.src[r++]}return!1}function i(e){return e.trim().replace(/\s+/g," ").toLowerCase()}r.exports.parseLinkLabel=t,r.exports.parseLinkDestination=n,r.exports.parseLinkTitle=s,r.exports.normalizeReference=i},{}],12:[function(e,r){"use strict";function t(){this._rules=[],this._rulesParagraphTerm=[],this._rulesBlockquoteTerm=[],this._rulesListTerm=[],this.ruler=new n(this.rulesUpdate.bind(this));for(var e=0;e<i.length;e++)this.ruler.after(i[e][0],i[e].slice(1))}var n=e("./ruler"),s=e("./rules_block/state_block"),i=[];i.push([e("./rules_block/code")]),i.push([e("./rules_block/fences"),"paragraph","blockquote","list"]),i.push([e("./rules_block/blockquote"),"paragraph","blockquote","list"]),i.push([e("./rules_block/hr"),"paragraph","blockquote","list"]),i.push([e("./rules_block/list"),"paragraph","blockquote"]),i.push([e("./rules_block/heading"),"paragraph","blockquote"]),i.push([e("./rules_block/lheading")]),i.push([e("./rules_block/htmlblock"),"paragraph","blockquote"]),i.push([e("./rules_block/table"),"paragraph"]),i.push([e("./rules_block/paragraph")]),t.prototype.rulesUpdate=function(){this._rules=this.ruler.getRules(),this._rulesParagraphTerm=this.ruler.getRules("paragraph"),this._rulesBlockquoteTerm=this.ruler.getRules("blockquote"),this._rulesListTerm=this.ruler.getRules("list")},t.prototype.tokenize=function(e,r,t){for(var n,s,i=this._rules,o=this._rules.length,a=r,l=!1;!(!(t>a)||(e.line=a=e.skipEmptyLines(a),a>=t)||e.tShift[a]<e.blkIndent||e.bqMarks[a]<e.bqLevel);){for(s=0;o>s&&!(n=i[s](e,a,t,!1));s++);if(!n)throw new Error("No matching rules found");if(a===e.line)throw new Error("None of rules updated state.line");if(e.tight=!l,e.isEmpty(e.line-1)&&(l=!0),a=e.line,t>a&&e.isEmpty(a)){if(l=!0,a++,t>a&&e.listMode&&e.isEmpty(a))break;e.line=a}}},t.prototype.parse=function(e,r,t){var n,i=0,o=0;return e?(e.indexOf("\r")>=0&&(e=e.replace(/\r/,"")),e.indexOf(" ")>=0&&(e=e.replace(/\u00a0/g," ")),e.indexOf("␤")>=0&&(e=e.replace(/\u2424/g,"\n")),e.indexOf(" ")>=0&&(e=e.replace(/[\n\t]/g,function(r,t){var n;return 10===e.charCodeAt(t)?(i=t+1,o=0,r):(n=" ".slice((t-i-o)%4),o=t-i+1,n)})),n=new s(e,this,[],r,t),this.tokenize(n,n.line,n.lineMax),n.tokens):""},r.exports=t},{"./ruler":16,"./rules_block/blockquote":17,"./rules_block/code":18,"./rules_block/fences":19,"./rules_block/heading":20,"./rules_block/hr":21,"./rules_block/htmlblock":22,"./rules_block/lheading":23,"./rules_block/list":24,"./rules_block/paragraph":25,"./rules_block/state_block":26,"./rules_block/table":27}],13:[function(e,r){"use strict";function t(e){return 0===e.indexOf("javascript:")?!1:!0}function n(){this._rules=[],this.textMatch=/^[^\n\\`*_\[\]!&{}$%@<>"~]+/,this.validateLink=t,this.ruler=new s(this.rulesUpdate.bind(this));for(var e=0;e<o.length;e++)this.ruler.after(o[e])}var s=e("./ruler"),i=e("./rules_inline/state_inline"),o=[];o.push(e("./rules_inline/text")),o.push(e("./rules_inline/newline")),o.push(e("./rules_inline/escape")),o.push(e("./rules_inline/backticks")),o.push(e("./rules_inline/strikethrough")),o.push(e("./rules_inline/emphasis")),o.push(e("./rules_inline/links")),o.push(e("./rules_inline/autolink")),o.push(e("./rules_inline/htmltag")),o.push(e("./rules_inline/entity")),o.push(e("./rules_inline/escape_html_char")),n.prot
}},{}],42:[function(e,r){"use strict";function t(){this.options=s({},n),this.ruler=new i(this.rulesUpdate.bind(this));for(var e=0;e<o.length;e++)this.ruler.after(o[e])}var n=e("./defaults/typographer"),s=e("./common/utils").assign,i=e("./ruler"),o=[];o.push(e("./rules_typographer/replace")),t.prototype.rulesUpdate=function(){this._rules=this.ruler.getRules()},t.prototype.set=function(e){s(this.options,e)},t.prototype.process=function(e){var r,t,n;if(e.options.typographer)for(n=this._rules,r=0,t=n.length;t>r;r++)n[r](this,e)},r.exports=t},{"./common/utils":5,"./defaults/typographer":9,"./ruler":16,"./rules_typographer/replace":41}],43:[function(r,t,n){!function(r,s){"function"==typeof e&&e.amd?e(s):"undefined"!=typeof n?t.exports=s():r.Autolinker=s()}(this,function(){var e=function(r){e.Util.assign(this,r)};return e.prototype={constructor:e,urls:!0,email:!0,twitter:!0,newWindow:!0,stripPrefix:!0,className:"",htmlCharacterEntitiesRegex:/(&nbsp;|&#160;|&lt;|&#60;|&gt;|&#62;)/gi,matcherRegex:function(){var e=/(^|[^\w])@(\w{1,15})/,r=/(?:[\-;:&=\+\$,\w\.]+@)/,t=/(?:[A-Za-z]{3,9}:(?:\/\/)?)/,n=/(?:www\.)/,s=/[A-Za-z0-9\.\-]*[A-Za-z0-9\-]/,i=/\.(?:international|construction|contractors|enterprises|photography|productions|foundation|immobilien|industries|management|properties|technology|christmas|community|directory|education|equipment|institute|marketing|solutions|vacations|bargains|boutique|builders|catering|cleaning|clothing|computer|democrat|diamonds|graphics|holdings|lighting|partners|plumbing|supplies|training|ventures|academy|careers|company|cruises|domains|exposed|flights|florist|gallery|guitars|holiday|kitchen|neustar|okinawa|recipes|rentals|reviews|shiksha|singles|support|systems|agency|berlin|camera|center|coffee|condos|dating|estate|events|expert|futbol|kaufen|luxury|maison|monash|museum|nagoya|photos|repair|report|social|supply|tattoo|tienda|travel|viajes|villas|vision|voting|voyage|actor|build|cards|cheap|codes|dance|email|glass|house|mango|ninja|parts|photo|shoes|solar|today|tokyo|tools|watch|works|aero|arpa|asia|best|bike|blue|buzz|camp|club|cool|coop|farm|fish|gift|guru|info|jobs|kiwi|kred|land|limo|link|menu|mobi|moda|name|pics|pink|post|qpon|rich|ruhr|sexy|tips|vote|voto|wang|wien|wiki|zone|bar|bid|biz|cab|cat|ceo|com|edu|gov|int|kim|mil|net|onl|org|pro|pub|red|tel|uno|wed|xxx|xyz|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw)\b/,o=/(?:[\-A-Za-z0-9+&@#\/%?=~_()|!:,.;]*[\-A-Za-z0-9+&@#\/%=~_()|])?/;return new RegExp(["(",e.source,")","|","(",r.source,s.source,i.source,")","|","(","(?:","(?:",t.source,s.source,")","|","(?:","(.?//)?",n.source,s.source,")","|","(?:","(.?//)?",s.source,i.source,")",")",o.source,")"].join(""),"gi")}(),invalidProtocolRelMatchRegex:/^[\w]\/\//,charBeforeProtocolRelMatchRegex:/^(.)?\/\//,link:function(r){var t=this,n=this.getHtmlParser(),s=this.htmlCharacterEntitiesRegex,i=0,o=[];return n.parse(r,{processHtmlNode:function(e,r,t){"a"===r&&(t?i=Math.max(i-1,0):i++),o.push(e)},processTextNode:function(r){if(0===i)for(var n=e.Util.splitAndCapture(r,s),a=0,l=n.length;l>a;a++){var c=n[a],u=t.processTextNode(c);o.push(u)}else o.push(r)}}),o.join("")},getHtmlParser:function(){var r=this.htmlParser;return r||(r=this.htmlParser=new e.HtmlParser),r},getTagBuilder:function(){var r=this.tagBuilder;return r||(r=this.tagBuilder=new e.AnchorTagBuilder({newWindow:this.newWindow,truncate:this.truncate,className:th