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
60 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(){return function e(r,t,n){function s(i,a){if(!t[i]){if(!r[i]){var l="function"==typeof require&&require;if(!a&&l)return l(i,!0);if(o)return o(i,!0);var c=new Error("Cannot find module '"+i+"'");throw c.code="MODULE_NOT_FOUND",c}var u=t[i]={exports:{}};r[i][0].call(u.exports,function(e){var t=r[i][1][e];return s(t?t:e)},u,u.exports,e,r,t,n)}return t[i].exports}for(var o="function"==typeof require&&require,i=0;i<n.length;i++)s(n[i]);return s}({"./":[function(e,r){"use strict";r.exports=e("./lib/parser")},{"./lib/parser":31}],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:"⊝",Ci
e.line=c}}},s.prototype.parse=function(e,r,t){var n,s=0,i=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)?(s=t+1,i=0,r):(n=" ".slice((t-s-i)%4),i=t-s+1,n)})),n=new o(e,this,[],r,t),this.tokenize(n,n.line,n.lineMax),n.tokens):""},r.exports=s},{"./helpers":6,"./lexer_block/blockquote":8,"./lexer_block/code":9,"./lexer_block/fences":10,"./lexer_block/heading":11,"./lexer_block/hr":12,"./lexer_block/htmlblock":13,"./lexer_block/lheading":14,"./lexer_block/list":15,"./lexer_block/paragraph":16,"./lexer_block/state_block":17,"./lexer_block/table":18}],8:[function(e,r){"use strict";var t=e("../helpers").skipSpaces;r.exports=function(e,r,n,s){var o,i,a,l,c,u,p,h=e.lexer.rules_named,f=e.bMarks[r]+e.tShift[r],d=e.eMarks[r];if(f>d)return!1;if(62!==e.src.charCodeAt(f++))return!1;if(s)return!0;for(32===e.src.charCodeAt(f)&&f++,e.bqMarks[r]++,e.bqLevel++,u=e.blkIndent,e.blkIndent=0,l=[e.bMarks[r]],e.bMarks[r]=f,f=d>f?t(e,f):f,i=f>=d,a=[e.tShift[r]],e.tShift[r]=f-e.bMarks[r],o=r+1;n>o&&(f=e.bMarks[o]+e.tShift[o],d=e.eMarks[o],!(f>=d));o++)if(62!==e.src.charCodeAt(f++)){if(i)break;if(h.fences(e,o,n,!0))break;if(h.hr(e,o,n,!0))break;if(h.list(e,o,n,!0))break;if(h.heading(e,o,n,!0))break;if(h.blockquote(e,o,n,!0))break;if(h.table(e,o,n,!0))break;l.push(e.bMarks[o]),a.push(e.tShift[o])}else e.bqMarks[o]++,32===e.src.charCodeAt(f)&&f++,l.push(e.bMarks[o]),e.bMarks[o]=f,f=d>f?t(e,f):f,i=f>=d,a.push(e.tShift[o]),e.tShift[o]=f-e.bMarks[o];for(p=e.listMode,e.listMode=!1,e.tokens.push({type:"blockquote_open"}),e.lexer.tokenize(e,r,o),e.tokens.push({type:"blockquote_close"}),e.listMode=p,c=0;c<a.length;c++)e.bMarks[c+r]=l[c],e.tShift[c+r]=a[c];return e.bqLevel--,e.blkIndent=u,!0}},{"../helpers":6}],9:[function(e,r){"use strict";var t=e("../helpers").isEmpty,n=e("../helpers").getLines;r.exports=function(e,r,s,o){var i,a;if(e.tShift[r]-e.blkIndent<4)return!1;for(a=i=r+1;s>i&&!(e.bqMarks[i]<e.bqLevel);)if(t(e,i))i++,e.options.pedantic&&(a=i);else{if(!(e.tShift[i]-e.blkIndent>=4))break;i++,a=i}return o?!0:(e.tokens.push({type:"code",content:n(e,r,a,4+e.blkIndent,!0),block:!0}),e.line=i,!0)}},{"../helpers":6}],10:[function(e,r){"use strict";var t=e("../helpers").skipSpaces,n=e("../helpers").skipChars,s=e("../helpers").getLines;r.exports=function(e,r,o,i){var a,l,c,u,p,h=!1,f=e.bMarks[r]+e.tShift[r],d=e.eMarks[r];if(f+3>d)return!1;if(a=e.src.charCodeAt(f),126!==a&&96!==a)return!1;if(p=f,f=n(e,f,a),l=f-p,3>l)return!1;if(c=e.src.slice(f,d).trim(),c.indexOf("`")>=0)return!1;if(i)return!0;for(u=r;(u++,!(u>=o))&&(f=p=e.bMarks[u]+e.tShift[u],d=e.eMarks[u],!(d>f&&e.tShift[u]<e.blkIndent))&&!(d>f&&e.bqMarks[u]<e.bqLevel);)if(e.src.charCodeAt(f)===a&&(f=n(e,f,a),!(l>f-p||(f=t(e,f),d>f)))){h=!0;break}return l=e.tShift[r],e.tokens.push({type:"fence",params:c,content:s(e,r+1,u,l,!0)}),e.line=u+(h?1:0),!0}},{"../helpers":6}],11:[function(e,r){"use strict";var t=e("../helpers").isWhiteSpace,n=e("../helpers").skipSpaces,s=e("../helpers").skipCharsBack;r.exports=function(e,r,o,i){var a,l,c=e.bMarks[r]+e.tShift[r],u=e.eMarks[r];if(c>=u)return!1;if(a=e.src.charCodeAt(c),35!==a||c>=u)return!1;for(l=1,a=e.src.charCodeAt(++c);35===a&&u>c&&6>=l;)l++,a=e.src.charCodeAt(++c);return l>6||u>c&&!t(a)?!1:(c=n(e,c),u=s(e,u,32,c),u=s(e,u,35,c),u<e.eMarks[r]&&35===e.src.charCodeAt(u)&&92===e.src.charCodeAt(u-1)&&u++,u=s(e,u,32,c),i?!0:(e.tokens.push({type:"heading_open",level:l}),u>c&&e.tokens.push({type:"inline",content:e.src.slice(c,u).trim()}),e.tokens.push({type:"heading_close",level:l}),e.line=r+1,!0))}},{"../helpers":6}],12:[function(e,r){"use strict";var t=e("../helpers").isWhiteSpace;r.exports=function(e,r,n,s){var o,i,a,l=e.bMarks[r],c=e.eMarks[r];if(l+=e.tShift[r],l>c)return!1;if(o=e.src.charCodeAt(l++),42!==o&&45!==o&&95!==o)return!1;for(i=1;c>l;){if(a=e.src.charCodeAt(l++),a!==o&&!t(a))return!1;a===o&&i++}return 3>i?!1:s?!0:(e.tokens.push({type:"hr"}),e.line=r+1,!0)}},{"../