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.

3 lines
62 KiB

/* remarkable 1.0.0 https://github.com//jonschlinkert/remarkable */
10 years ago
!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(){return function e(r,t,s){function n(o,l){if(!t[o]){if(!r[o]){var a="function"==typeof require&&require;if(!l&&a)return a(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:{}};r[o][0].call(u.exports,function(e){var t=r[o][1][e];return n(t?t:e)},u,u.exports,e,r,t,s)}return t[o].exports}for(var i="function"==typeof require&&require,o=0;o<s.length;o++)n(s[o]);return n}({"./":[function(e,r){"use strict";r.exports=e("./lib/")},{"./lib/":7}],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:"⊝",CircleDot:"⊙"
for(r++,t="",40===i&&(i=41);n>r;){if(s=e.src.charCodeAt(r),s===i)return e.pos=r+1,e.link_content=t,!0;92===s&&n>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=s,r.exports.parseLinkTitle=n,r.exports.normalizeReference=i},{}],9:[function(e,r){"use strict";function t(){this._rules=[],this._rulesParagraphTerm=[],this._rulesBlockquoteTerm=[],this._rulesListTerm=[],this.ruler=new s(this.rulesUpdate.bind(this));for(var e=0;e<l.length;e++)this.ruler.after(l[e][0],l[e].slice(1))}var s=e("./ruler"),n=e("./rules_block/state_block"),i=e("./helpers").skipEmptyLines,o=e("./helpers").isEmpty,l=[];l.push([e("./rules_block/code")]),l.push([e("./rules_block/fences"),"paragraph","blockquote","list"]),l.push([e("./rules_block/blockquote"),"paragraph","blockquote","list"]),l.push([e("./rules_block/hr"),"paragraph","blockquote","list"]),l.push([e("./rules_block/list"),"paragraph","blockquote"]),l.push([e("./rules_block/heading"),"paragraph","blockquote"]),l.push([e("./rules_block/lheading")]),l.push([e("./rules_block/htmlblock"),"paragraph","blockquote"]),l.push([e("./rules_block/table"),"paragraph"]),l.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 s,n,l=this._rules,a=this._rules.length,c=r,u=!1;!(!(t>c)||(e.line=c=i(e,c,t),c>=t)||e.tShift[c]<e.blkIndent||e.bqMarks[c]<e.bqLevel);){for(n=0;a>n&&!(s=l[n](e,c,t,!1));n++);if(!s)throw new Error("No matching rules found");if(c===e.line)throw new Error("None of rules updated state.line");if(e.tight=!u,o(e,e.line-1)&&(u=!0),c=e.line,t>c&&o(e,c)){if(u=!0,c++,t>c&&e.listMode&&o(e,c))break;e.line=c}}},t.prototype.parse=function(e,r,t){var s,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 s;return 10===e.charCodeAt(t)?(i=t+1,o=0,r):(s=" ".slice((t-i-o)%4),o=t-i+1,s)})),s=new n(e,this,[],r,t),this.tokenize(s,s.line,s.lineMax),s.tokens):""},r.exports=t},{"./helpers":6,"./ruler":13,"./rules_block/blockquote":14,"./rules_block/code":15,"./rules_block/fences":16,"./rules_block/heading":17,"./rules_block/hr":18,"./rules_block/htmlblock":19,"./rules_block/lheading":20,"./rules_block/list":21,"./rules_block/paragraph":22,"./rules_block/state_block":23,"./rules_block/table":24}],10:[function(e,r){"use strict";function t(){this._rules=[],this.textMatch=/^[^\n\\`*_\[\]!&{}$%@<>"]+/,this.ruler=new s(this.rulesUpdate.bind(this));for(var e=0;e<i.length;e++)this.ruler.after(i[e])}var s=e("./ruler"),n=e("./rules_inline/state_inline"),i=[];i.push(e("./rules_inline/text")),i.push(e("./rules_inline/newline")),i.push(e("./rules_inline/escape")),i.push(e("./rules_inline/backticks")),i.push(e("./rules_inline/emphasis")),i.push(e("./rules_inline/links")),i.push(e("./rules_inline/autolink")),i.push(e("./rules_inline/htmltag")),i.push(e("./rules_inline/entity")),i.push(e("./rules_inline/escape_html_char")),t.prototype.rulesUpdate=function(){this._rules=this.ruler.getRules()},t.prototype.tokenizeSingle=function(e){var r,t,s=this._rules,n=this._rules.length;for(t=0;n>t&&!(r=s[t](e));t++);return r},t.prototype.tokenize=function(e){for(var r,t,s=this._rules,n=this._rules.length,i=e.posMax;e.pos<i;){for(t=0;n>t&&!(r=s[t](e));t++);if(r){if(e.pos>=i)break}else e.pending+=e.src[e.pos++]}return e.pending&&e.pushPending(),e.tokens},t.prototype.parse=function(e,r,t){var s=new n(e,this,r,t);return this.tokenize(s),s.tokens},r.exports=t},{"./ruler":13,"./rules_inline/autolink":25,"./rules_inline/backticks":26,"./rules_inline/emphasis":27,"./rules_inline/entity":28,"./rules_inline/escape":29,"./rules_inline/escape_html_char":30,"./rules_inline/htmltag":31,"./rules_inline/links":32,"