├── .babelrc ├── .eslintignore ├── .eslintrc ├── .gitignore ├── .npmignore ├── .travis.yml ├── CHANGELOG.md ├── LICENSE ├── README.md ├── dist └── markdown-react.min.js ├── package.json ├── src └── index.js ├── test ├── elements.spec.js ├── helpers │ └── render.js ├── mocha.opts ├── plugins-offical.js └── react-options.spec.js └── webpack.config.js /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["es2015", "react", "stage-1"] 3 | } 4 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | dist/ 3 | lib/ 4 | coverage/ 5 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "parser" : "babel-eslint", 3 | "extends" : [ 4 | "standard", 5 | "standard-react" 6 | ], 7 | "env" : { 8 | "browser" : true, 9 | "node": true 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | 5 | # Runtime data 6 | pids 7 | *.pid 8 | *.seed 9 | 10 | # Directory for instrumented libs generated by jscoverage/JSCover 11 | lib-cov 12 | 13 | # Coverage directory used by tools like istanbul 14 | coverage 15 | 16 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 17 | .grunt 18 | 19 | # node-waf configuration 20 | .lock-wscript 21 | 22 | # Compiled binary addons (http://nodejs.org/api/addons.html) 23 | build/Release 24 | 25 | # Dependency directory 26 | # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git 27 | node_modules 28 | lib 29 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | src -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | sudo: false 3 | node_js: 4 | - 4 5 | - 5 6 | 7 | matrix: 8 | fast_finish: true 9 | 10 | script: 11 | - npm run lint 12 | - npm test 13 | 14 | after_success: 15 | - npm run codecov 16 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ### Under the hood 2 | 3 | - Break up tests into files 4 | 5 | # 0.1.1 - 2016-02-07 6 | 7 | - Fixed: Remove warning about void tag with children 8 | in React 0.14 with ``, `
`, `
` 9 | 10 | ## Under the hood 11 | 12 | - Use mocha.opts file for quick mocha command 13 | 14 | # 0.1.0 - 2016-02-07 15 | 16 | :boom: 17 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Khoa Nguyen 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Markdown React [![No Maintenance Intended](http://unmaintained.tech/badge.svg)](http://unmaintained.tech/) 2 | 3 | Markdown to React Component converter. 4 | 5 | This project uses Markdown parser from 6 | [Markdown It](https://github.com/markdown-it/markdown-it) 7 | library, but loosely supports its plugins. 8 | 9 | ## Examples 10 | 11 | #### Basic example 12 | 13 | ```js 14 | import MDReactComponent from 'markdown-react-js'; 15 | 16 | ... 17 | 18 | render() { 19 | return ( 20 | 21 | ); 22 | } 23 | ``` 24 | 25 | or, using function instead of component: 26 | 27 | ```js 28 | import { mdReact } from 'markdown-react-js'; 29 | 30 | ... 31 | 32 | render() { 33 | return mdReact()('Some text **with emphasis**.'); 34 | } 35 | ``` 36 | 37 | Result: 38 | 39 | ```html 40 | 41 |

42 | Some text with emphasis. 43 |

44 |
45 | ``` 46 | 47 | #### Using custom tags 48 | 49 | ```js 50 | const TAGS = { 51 | html: 'span', // root node, replaced by default 52 | strong: 'b', 53 | em: 'i' 54 | } 55 | 56 | ... 57 | 58 | render() { 59 | return ( 60 | 61 | ); 62 | } 63 | ``` 64 | 65 | Result: 66 | 67 | ```html 68 | 69 |

70 | Some bold and italic text. 71 |

72 |
73 | 74 | ``` 75 | 76 | #### Using custom component renderer 77 | 78 | ```js 79 | function handleIterate(Tag, props, children, level) { 80 | if (level === 1) { 81 | props = { 82 | ...props, 83 | className: 'first-level-class' 84 | }; 85 | } 86 | 87 | if (Tag === 'a') { 88 | props = { 89 | ...props, 90 | className: 'link-class', 91 | href: props.href.replace('SOME_URL', 'http://example.com') 92 | }; 93 | } 94 | 95 | return {children}; 96 | } 97 | 98 | ... 99 | 100 | render() { 101 | return ( 102 | 103 | ); 104 | } 105 | ``` 106 | 107 | Result: 108 | 109 | ```html 110 | 111 |

112 | This link has it’s own style. 113 |

114 |
115 | 116 | ``` 117 | 118 | # Copyright 119 | 120 | Forked from 121 | - [markdown-react-js](https://github.com/alexkuz/markdown-react-js) 122 | Copyright 2015 Alexander Kuznetsov 123 | 124 | - Markdown-it 125 | Copyright (c) 2014 Vitaly Puzrin , Alex Kocharin 126 | 127 | # LICENSE 128 | MIT 129 | -------------------------------------------------------------------------------- /dist/markdown-react.min.js: -------------------------------------------------------------------------------- 1 | !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("React")):"function"==typeof define&&define.amd?define(["React"],e):"object"==typeof exports?exports.MarkdownReact=e(require("React")):t.MarkdownReact=e(t.React)}(this,function(t){return function(t){function e(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return t[n].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function o(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e=0||Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n]);return r}function s(t,e,r){function n(t,o){function i(){return n(t,!0)}var s=[];o||s.push("html");for(var a=t.shift();a&&-1!==a.nesting;){var u=a.attrs&&(0,q["default"])((0,x["default"])(a.attrs)),c=a.children&&n(a.children.slice(),!0),l=e[(0,w["default"])(a.type)]||e["default"];s=s.concat(l(a,u,c,r,i)),a=t.shift()}return s}return n(t,!1)}function a(){function t(t){var e=["img","hr","br"];return-1===e.indexOf(t)}function e(r){var o=arguments.length<=1||void 0===arguments[1]?0:arguments[1],i=arguments.length<=2||void 0===arguments[2]?0:arguments[2],s=r.shift(),a=C(s,i),l=r.length&&(0,d["default"])(r[0])?(0,m["default"])(r.shift(),{key:a}):{key:a};0===o&&(l=u({},l,D));var p=r.map(function(t,r){return Array.isArray(t)?e(t,o+1,r):t});return s=c[s]||s,(0,E["default"])(l.style)&&(l.style=(0,F["default"])(l.style.split(";").map(function(t){return t.split(":")}).map(function(t){return[(0,w["default"])(t[0].trim()),t[1].trim()]}))),"function"==typeof n?n(s,l,p,o):f["default"].createElement(s,l,t(s)?p:void 0)}var r=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=r.onIterate,a=r.tags,c=void 0===a?z:a,p=r.presetName,h=r.markdownOptions,g=r.enableRules,v=void 0===g?[]:g,b=r.disableRules,x=void 0===b?[]:b,y=r.plugins,k=void 0===y?[]:y,A=r.onGenerateKey,C=void 0===A?function(t,e){return"mdrct-"+t+"-"+e}:A,D=i(r,["onIterate","tags","presetName","markdownOptions","enableRules","disableRules","plugins","onGenerateKey"]),q=(0,l["default"])(h||p).enable(v).disable(x),S=(0,m["default"])({},j,r.convertRules);return q=(0,_["default"])(k,function(t,e){return e.plugin?t.use.apply(t,[e.plugin].concat(o(e.args))):t.use(e)},q),function(t){var r=s(q.parse(t,{}),S,q.options);return e(r)}}var u=Object.assign||function(t){for(var e=1;e=55296&&57343>=t?!1:t>=64976&&65007>=t?!1:65535===(65535&t)||65534===(65535&t)?!1:t>=0&&8>=t?!1:11===t?!1:t>=14&&31>=t?!1:t>=127&&159>=t?!1:t>1114111?!1:!0}function c(t){if(t>65535){t-=65536;var e=55296+(t>>10),r=56320+(1023&t);return String.fromCharCode(e,r)}return String.fromCharCode(t)}function l(t,e){var r=0;return i(E,e)?E[e]:35===e.charCodeAt(0)&&C.test(e)&&(r="x"===e[1].toLowerCase()?parseInt(e.slice(2),16):parseInt(e.slice(1),10),u(r))?c(r):t}function p(t){return t.indexOf("\\")<0?t:t.replace(k,"$1")}function f(t){return t.indexOf("\\")<0&&t.indexOf("&")<0?t:t.replace(w,function(t,e,r){return e?e:l(t,r)})}function h(t){return S[t]}function d(t){return D.test(t)?t.replace(q,h):t}function g(t){return t.replace(F,"\\$&")}function m(t){switch(t){case 9:case 32:return!0}return!1}function v(t){if(t>=8192&&8202>=t)return!0;switch(t){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function _(t){return z.test(t)}function b(t){switch(t){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function x(t){return t.trim().replace(/\s+/g," ").toUpperCase()}var y=Object.prototype.hasOwnProperty,k=/\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g,A=/&([a-z#][a-z0-9]{1,31});/gi,w=new RegExp(k.source+"|"+A.source,"gi"),C=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,E=r(49),D=/[&<>"]/,q=/[&<>"]/g,S={"&":"&","<":"<",">":">",'"':"""},F=/[.?*+^$[\]\\(){}|-]/g,z=r(27);e.lib={},e.lib.mdurl=r(53),e.lib.ucmicro=r(196),e.assign=s,e.isString=o,e.has=i,e.unescapeMd=p,e.unescapeAll=f,e.isValidEntityCode=u,e.fromCodePoint=c,e.escapeHtml=d,e.arrayReplaceAt=a,e.isSpace=m,e.isWhiteSpace=v,e.isMdAsciiPunct=b,e.isPunctChar=_,e.escapeRE=g,e.normalizeReference=x},function(t,e){var r=Array.isArray;t.exports=r},function(t,e){function r(t){return!!t&&"object"==typeof t}t.exports=r},function(t,e,r){var n=r(16),o=r(11),i=n(o,"Map");t.exports=i},function(t,e,r){function n(t){return null!=t&&!("function"==typeof t&&i(t))&&s(o(t))}var o=r(100),i=r(22),s=r(12);t.exports=n},function(t,e){function r(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}t.exports=r},function(t,e,r){function n(t){if("string"==typeof t)return t;if(null==t)return"";if(i(t))return o?u.call(t):"";var e=t+"";return"0"==e&&1/t==-s?"-0":e}var o=r(29),i=r(135),s=1/0,a=o?o.prototype:void 0,u=o?a.toString:void 0;t.exports=n},function(t,e,r){function n(t,e){for(var r=t.length;r--;)if(o(t[r][0],e))return r;return-1}var o=r(20);t.exports=n},function(t,e){function r(t){var e=typeof t;return"number"==e||"boolean"==e||"string"==e&&"__proto__"!==t||null==t}t.exports=r},function(t,e,r){var n=r(16),o=n(Object,"create");t.exports=o},function(t,e,r){(function(t,n){var o=r(86),i={"function":!0,object:!0},s=i[typeof e]&&e&&!e.nodeType?e:null,a=i[typeof t]&&t&&!t.nodeType?t:null,u=o(s&&a&&"object"==typeof n&&n),c=o(i[typeof self]&&self),l=o(i[typeof window]&&window),p=o(i[typeof this]&&this),f=u||l!==(p&&p.window)&&l||c||p||Function("return this")();t.exports=f}).call(e,r(57)(t),function(){return this}())},function(t,e){function r(t){return"number"==typeof t&&t>-1&&t%1==0&&n>=t}var n=9007199254740991;t.exports=r},function(t,e,r){function n(t){var e=c(t);if(!e&&!a(t))return i(t);var r=s(t),n=!!r,l=r||[],p=l.length;for(var f in t)!o(t,f)||n&&("length"==f||u(f,p))||e&&"constructor"==f||l.push(f);return l}var o=r(39),i=r(74),s=r(107),a=r(5),u=r(18),c=r(108);t.exports=n},function(t,e,r){"use strict";var n=r(1).unescapeAll;t.exports=function(t,e,r){var o,i,s=0,a=e,u={ok:!1,pos:0,lines:0,str:""};if(60===t.charCodeAt(e)){for(e++;r>e;){if(o=t.charCodeAt(e),10===o)return u;if(62===o)return u.pos=e+1,u.str=n(t.slice(a+1,e)),u.ok=!0,u;92===o&&r>e+1?e+=2:e++}return u}for(i=0;r>e&&(o=t.charCodeAt(e),32!==o)&&!(32>o||127===o);)if(92===o&&r>e+1)e+=2;else{if(40===o&&(i++,i>1))break;if(41===o&&(i--,0>i))break;e++}return a===e?u:(u.str=n(t.slice(a,e)),u.lines=s,u.pos=e,u.ok=!0,u)}},function(t,e,r){"use strict";var n=r(1).unescapeAll;t.exports=function(t,e,r){var o,i,s=0,a=e,u={ok:!1,pos:0,lines:0,str:""};if(e>=r)return u;if(i=t.charCodeAt(e),34!==i&&39!==i&&40!==i)return u;for(e++,40===i&&(i=41);r>e;){if(o=t.charCodeAt(e),o===i)return u.pos=e+1,u.lines=s,u.str=n(t.slice(a+1,e)),u.ok=!0,u;10===o?s++:92===o&&r>e+1&&(e++,10===t.charCodeAt(e)&&s++),e++}return u}},function(t,e,r){function n(t,e){var r=null==t?void 0:t[e];return o(r)?r:void 0}var o=r(133);t.exports=n},function(t,e){function r(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(r){}return e}t.exports=r},function(t,e){function r(t,e){return t="number"==typeof t||o.test(t)?+t:-1,e=null==e?n:e,t>-1&&t%1==0&&e>t}var n=9007199254740991,o=/^(?:0|[1-9]\d*)$/;t.exports=r},function(t,e,r){function n(t,e){return"number"==typeof t?!0:!o(t)&&(s.test(t)||!i.test(t)||null!=e&&t in Object(e))}var o=r(2),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,s=/^\w*$/;t.exports=n},function(t,e){function r(t,e){return t===e||t!==t&&e!==e}t.exports=r},function(t,e,r){function n(t){return o(t)&&a.call(t,"callee")&&(!c.call(t,"callee")||u.call(t)==i)}var o=r(47),i="[object Arguments]",s=Object.prototype,a=s.hasOwnProperty,u=s.toString,c=s.propertyIsEnumerable;t.exports=n},function(t,e,r){function n(t){var e=o(t)?u.call(t):"";return e==i||e==s}var o=r(6),i="[object Function]",s="[object GeneratorFunction]",a=Object.prototype,u=a.toString;t.exports=n},function(t,e,r){function n(t){return"string"==typeof t||!o(t)&&i(t)&&u.call(t)==s}var o=r(2),i=r(3),s="[object String]",a=Object.prototype,u=a.toString;t.exports=n},function(t,e){"use strict";t.exports=function(t,e,r){var n,o,i,s,a=-1,u=t.posMax,c=t.pos;for(t.pos=e+1,n=1;t.posn){if(e)return;throw new Error("Rules manager: invalid rule name "+t)}this.__rules__[n].enabled=!0,r.push(t)},this),this.__cache__=null,r},r.prototype.enableOnly=function(t,e){Array.isArray(t)||(t=[t]),this.__rules__.forEach(function(t){t.enabled=!1}),this.enable(t,e)},r.prototype.disable=function(t,e){Array.isArray(t)||(t=[t]);var r=[];return t.forEach(function(t){var n=this.__find__(t);if(0>n){if(e)return;throw new Error("Rules manager: invalid rule name "+t)}this.__rules__[n].enabled=!1,r.push(t)},this),this.__cache__=null,r},r.prototype.getRules=function(t){return null===this.__cache__&&this.__compile__(),this.__cache__[t]||[]},t.exports=r},function(t,e){"use strict";function r(t,e,r){this.type=t,this.tag=e,this.attrs=null,this.map=null,this.nesting=r,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}r.prototype.attrIndex=function(t){var e,r,n;if(!this.attrs)return-1;for(e=this.attrs,r=0,n=e.length;n>r;r++)if(e[r][0]===t)return r;return-1},r.prototype.attrPush=function(t){this.attrs?this.attrs.push(t):this.attrs=[t]},r.prototype.attrSet=function(t,e){var r=this.attrIndex(t),n=[t,e];0>r?this.attrPush(n):this.attrs[r]=n},r.prototype.attrJoin=function(t,e){var r=this.attrIndex(t);0>r?this.attrPush([t,e]):this.attrs[r][1]=this.attrs[r][1]+" "+e},t.exports=r},function(t,e){t.exports=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDE38-\uDE3D]|\uD805[\uDCC6\uDDC1-\uDDC9\uDE41-\uDE43]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F/},function(t,e,r){function n(t){var e=-1,r=t?t.length:0;for(this.clear();++er)return!1;var n=t.length-1;return r==n?t.pop():s.call(t,r,1),!0}var o=r(8),i=Array.prototype,s=i.splice;t.exports=n},function(t,e,r){function n(t,e){var r=o(t,e);return 0>r?void 0:t[r][1]}var o=r(8);t.exports=n},function(t,e,r){function n(t,e){return o(t,e)>-1}var o=r(8);t.exports=n},function(t,e,r){function n(t,e,r){var n=o(t,e);0>n?t.push([e,r]):t[n][1]=r}var o=r(8);t.exports=n},function(t,e,r){var n=r(70),o=r(92),i=o(n);t.exports=i},function(t,e,r){function n(t,e){e=i(e,t)?[e+""]:o(e);for(var r=0,n=e.length;null!=t&&n>r;)t=t[e[r++]];return r&&r==n?t:void 0}var o=r(43),i=r(19);t.exports=n},function(t,e){function r(t,e){return o.call(t,e)||"object"==typeof t&&e in t&&null===i(t)}var n=Object.prototype,o=n.hasOwnProperty,i=Object.getPrototypeOf;t.exports=r},function(t,e,r){function n(t,e,r,a,u){return t===e?!0:null==t||null==e||!i(t)&&!s(e)?t!==t&&e!==e:o(t,e,n,r,a,u)}var o=r(72),i=r(6),s=r(3);t.exports=n},function(t,e,r){function n(t){var e=typeof t;return"function"==e?t:null==t?s:"object"==e?a(t)?i(t[0],t[1]):o(t):u(t)}var o=r(76),i=r(77),s=r(132),a=r(2),u=r(138);t.exports=n},function(t,e){function r(t){return function(e){return null==e?void 0:e[t]}}t.exports=r},function(t,e,r){function n(t){return o(t)?t:i(t)}var o=r(2),i=r(124);t.exports=n},function(t,e,r){function n(t,e){return o?void 0!==t[e]:s.call(t,e)}var o=r(10),i=Object.prototype,s=i.hasOwnProperty;t.exports=n},function(t,e,r){function n(t,e,r){if(!a(r))return!1;var n=typeof e;return("number"==n?i(r)&&s(e,r.length):"string"==n&&e in r)?o(r[e],t):!1}var o=r(20),i=r(5),s=r(18),a=r(6);t.exports=n},function(t,e,r){function n(t,e,r){var n=null==t?void 0:o(t,e);return void 0===n?r:n}var o=r(38);t.exports=n},function(t,e,r){function n(t){return i(t)&&o(t)}var o=r(5),i=r(3);t.exports=n},function(t,e,r){function n(t,e){if("function"!=typeof t)throw new TypeError(s);return e=a(void 0===e?t.length-1:i(e),0),function(){for(var r=arguments,n=-1,i=a(r.length-e,0),s=Array(i);++n`\\x00-\\x20]+",o="'[^']*'",i='"[^"]*"',s="(?:"+n+"|"+o+"|"+i+")",a="(?:\\s+"+r+"(?:\\s*=\\s*"+s+")?)",u="<[A-Za-z][A-Za-z0-9\\-]*"+a+"*\\s*\\/?>",c="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",l="|",p="<[?].*?[?]>",f="]*>",h="",d=new RegExp("^(?:"+u+"|"+c+"|"+l+"|"+p+"|"+f+"|"+h+")"),g=new RegExp("^(?:"+u+"|"+c+")");t.exports.HTML_TAG_RE=d,t.exports.HTML_OPEN_CLOSE_TAG_RE=g},function(t,e){"use strict";t.exports.tokenize=function(t,e){var r,n,o,i=t.pos,s=t.src.charCodeAt(i);if(e)return!1;if(95!==s&&42!==s)return!1;for(n=t.scanDelims(t.pos,42===s),r=0;re;e++)r=a[e],(95===r.marker||42===r.marker)&&-1!==r.end&&(n=a[r.end],s=u>e+1&&a[e+1].end===r.end-1&&a[e+1].token===r.token+1&&a[r.end-1].token===n.token-1&&a[e+1].marker===r.marker,i=String.fromCharCode(r.marker),o=t.tokens[r.token],o.type=s?"strong_open":"em_open",o.tag=s?"strong":"em",o.nesting=1,o.markup=s?i+i:i,o.content="",o=t.tokens[n.token],o.type=s?"strong_close":"em_close",o.tag=s?"strong":"em",o.nesting=-1,o.markup=s?i+i:i,o.content="",s&&(t.tokens[a[e+1].token].content="",t.tokens[a[r.end-1].token].content="",e++))}},function(t,e){"use strict";t.exports.tokenize=function(t,e){var r,n,o,i,s,a=t.pos,u=t.src.charCodeAt(a);if(e)return!1;if(126!==u)return!1;if(n=t.scanDelims(t.pos,!0),i=n.length,s=String.fromCharCode(u),2>i)return!1;for(i%2&&(o=t.push("text","",0),o.content=s,i--),r=0;i>r;r+=2)o=t.push("text","",0),o.content=s+s,t.delimiters.push({marker:u,jump:r,token:t.tokens.length-1,level:t.level,end:-1,open:n.can_open,close:n.can_close});return t.pos+=n.length,!0},t.exports.postProcess=function(t){var e,r,n,o,i,s=[],a=t.delimiters,u=t.delimiters.length;for(e=0;u>e;e++)n=a[e],126===n.marker&&-1!==n.end&&(o=a[n.end],i=t.tokens[n.token],i.type="s_open",i.tag="s",i.nesting=1,i.markup="~~",i.content="",i=t.tokens[o.token],i.type="s_close",i.tag="s",i.nesting=-1,i.markup="~~",i.content="","text"===t.tokens[o.token-1].type&&"~"===t.tokens[o.token-1].content&&s.push(o.token-1));for(;s.length;){for(e=s.pop(),r=e+1;r",GT:">",Gt:"≫",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",harrcir:"⥈",harr:"↔",hArr:"⇔",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"𝔥",Hfr:"ℌ",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"𝕙",Hopf:"ℍ",horbar:"―",HorizontalLine:"─",hscr:"𝒽",Hscr:"ℋ",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",ifr:"𝔦",Ifr:"ℑ",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",Im:"ℑ",imof:"⊷",imped:"Ƶ",Implies:"⇒",incare:"℅","in":"∈",infin:"∞",infintie:"⧝",inodot:"ı",intcal:"⊺","int":"∫",Int:"∬",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",iscr:"𝒾",Iscr:"ℐ",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",lang:"⟨",Lang:"⟪",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",larrb:"⇤",larrbfs:"⤟",larr:"←",Larr:"↞",lArr:"⇐",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",latail:"⤙",lAtail:"⤛",lat:"⪫",late:"⪭",lates:"⪭︀",lbarr:"⤌",lBarr:"⤎",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",lE:"≦",LeftAngleBracket:"⟨",LeftArrowBar:"⇤",leftarrow:"←",LeftArrow:"←",Leftarrow:"⇐",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVectorBar:"⥙",LeftDownVector:"⇃",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTeeArrow:"↤",LeftTee:"⊣",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangleBar:"⧏",LeftTriangle:"⊲",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVectorBar:"⥘",LeftUpVector:"↿",LeftVectorBar:"⥒",LeftVector:"↼",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",lescc:"⪨",les:"⩽",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼", 2 | lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",llarr:"⇇",ll:"≪",Ll:"⋘",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoustache:"⎰",lmoust:"⎰",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lnE:"≨",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftrightarrow:"⟷",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longmapsto:"⟼",longrightarrow:"⟶",LongRightArrow:"⟶",Longrightarrow:"⟹",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",Lscr:"ℒ",lsh:"↰",Lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",ltcc:"⪦",ltcir:"⩹",lt:"<",LT:"<",Lt:"≪",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",midast:"*",midcir:"⫰",mid:"∣",middot:"·",minusb:"⊟",minus:"−",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",mscr:"𝓂",Mscr:"ℳ",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natural:"♮",naturals:"ℕ",natur:"♮",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",nearhk:"⤤",nearr:"↗",neArr:"⇗",nearrow:"↗",ne:"≠",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nharr:"↮",nhArr:"⇎",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlarr:"↚",nlArr:"⇍",nldr:"‥",nlE:"≦̸",nle:"≰",nleftarrow:"↚",nLeftarrow:"⇍",nleftrightarrow:"↮",nLeftrightarrow:"⇎",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",nopf:"𝕟",Nopf:"ℕ",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangleBar:"⧏̸",NotLeftTriangle:"⋪",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangleBar:"⧐̸",NotRightTriangle:"⋫",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",nparallel:"∦",npar:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",nprec:"⊀",npreceq:"⪯̸",npre:"⪯̸",nrarrc:"⤳̸",nrarr:"↛",nrArr:"⇏",nrarrw:"↝̸",nrightarrow:"↛",nRightarrow:"⇏",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nvdash:"⊬",nvDash:"⊭",nVdash:"⊮",nVDash:"⊯",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwarr:"↖",nwArr:"⇖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",Ocirc:"Ô",ocirc:"ô",ocir:"⊚",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",orarr:"↻",Or:"⩔",or:"∨",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",otimesas:"⨶",Otimes:"⨷",otimes:"⊗",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",para:"¶",parallel:"∥",par:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plus:"+",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",popf:"𝕡",Popf:"ℙ",pound:"£",prap:"⪷",Pr:"⪻",pr:"≺",prcue:"≼",precapprox:"⪷",prec:"≺",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",pre:"⪯",prE:"⪳",precsim:"≾",prime:"′",Prime:"″",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportional:"∝",Proportion:"∷",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",qopf:"𝕢",Qopf:"ℚ",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',QUOT:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",Rang:"⟫",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarr:"→",Rarr:"↠",rArr:"⇒",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",ratail:"⤚",rAtail:"⤜",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rBarr:"⤏",RBarr:"⤐",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",Re:"ℜ",rect:"▭",reg:"®",REG:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",rfr:"𝔯",Rfr:"ℜ",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrowBar:"⇥",rightarrow:"→",RightArrow:"→",Rightarrow:"⇒",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVectorBar:"⥕",RightDownVector:"⇂",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTeeArrow:"↦",RightTee:"⊢",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangleBar:"⧐",RightTriangle:"⊳",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVectorBar:"⥔",RightUpVector:"↾",RightVectorBar:"⥓",RightVector:"⇀",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoustache:"⎱",rmoust:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"𝕣",Ropf:"ℝ",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",rscr:"𝓇",Rscr:"ℛ",rsh:"↱",Rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",scap:"⪸",Scaron:"Š",scaron:"š",Sc:"⪼",sc:"≻",sccue:"≽",sce:"⪰",scE:"⪴",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdotb:"⊡",sdot:"⋅",sdote:"⩦",searhk:"⤥",searr:"↘",seArr:"⇘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",solbar:"⌿",solb:"⧄",sol:"/",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",square:"□",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squ:"□",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",sub:"⊂",Sub:"⋐",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",subset:"⊂",Subset:"⋐",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succapprox:"⪸",succ:"≻",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",sum:"∑",Sum:"∑",sung:"♪",sup1:"¹",sup2:"²",sup3:"³",sup:"⊃",Sup:"⋑",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",supset:"⊃",Supset:"⋑",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swarr:"↙",swArr:"⇙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:" ",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",therefore:"∴",Therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",ThinSpace:" ",thinsp:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",tilde:"˜",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",timesbar:"⨱",timesb:"⊠",times:"×",timesd:"⨰",tint:"∭",toea:"⤨",topbot:"⌶",topcir:"⫱",top:"⊤",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",TRADE:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",uarr:"↑",Uarr:"↟",uArr:"⇑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrowBar:"⤒",uparrow:"↑",UpArrow:"↑",Uparrow:"⇑",UpArrowDownArrow:"⇅",updownarrow:"↕",UpDownArrow:"↕",Updownarrow:"⇕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",upsi:"υ",Upsi:"ϒ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTeeArrow:"↥",UpTee:"⊥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",vArr:"⇕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vBar:"⫨",Vbar:"⫫",vBarv:"⫩",Vcy:"В",vcy:"в",vdash:"⊢",vDash:"⊨",Vdash:"⊩",VDash:"⊫",Vdashl:"⫦",veebar:"⊻",vee:"∨",Vee:"⋁",veeeq:"≚",vellip:"⋮",verbar:"|",Verbar:"‖",vert:"|",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",wedge:"∧",Wedge:"⋀",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xharr:"⟷",xhArr:"⟺",Xi:"Ξ",xi:"ξ",xlarr:"⟵",xlArr:"⟸",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrarr:"⟶",xrArr:"⟹",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",yuml:"ÿ",Yuml:"Ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",zfr:"𝔷",Zfr:"ℨ",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",zopf:"𝕫",Zopf:"ℤ",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}},function(t,e,r){"use strict";function n(t){var e=Array.prototype.slice.call(arguments,1);return e.forEach(function(e){e&&Object.keys(e).forEach(function(r){t[r]=e[r]})}),t}function o(t){return Object.prototype.toString.call(t)}function i(t){return"[object String]"===o(t)}function s(t){return"[object Object]"===o(t)}function a(t){return"[object RegExp]"===o(t)}function u(t){return"[object Function]"===o(t)}function c(t){return t.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function l(t){return Object.keys(t||{}).reduce(function(t,e){return t||_.hasOwnProperty(e)},!1)}function p(t){t.__index__=-1,t.__text_cache__=""}function f(t){return function(e,r){var n=e.slice(r);return t.test(n)?n.match(t)[0].length:0}}function h(){return function(t,e){e.normalize(t)}}function d(t){function e(t){return t.replace("%TLDS%",l.src_tlds)}function o(t,e){throw new Error('(LinkifyIt) Invalid schema "'+t+'": '+e)}var l=t.re=n({},r(60)),d=t.__tlds__.slice();t.__tlds_replaced__||d.push(x),d.push(l.src_xn),l.src_tlds=d.join("|"),l.email_fuzzy=RegExp(e(l.tpl_email_fuzzy),"i"),l.link_fuzzy=RegExp(e(l.tpl_link_fuzzy),"i"),l.link_no_ip_fuzzy=RegExp(e(l.tpl_link_no_ip_fuzzy),"i"),l.host_fuzzy_test=RegExp(e(l.tpl_host_fuzzy_test),"i");var g=[];t.__compiled__={},Object.keys(t.__schemas__).forEach(function(e){var r=t.__schemas__[e];if(null!==r){var n={validate:null,link:null};return t.__compiled__[e]=n,s(r)?(a(r.validate)?n.validate=f(r.validate):u(r.validate)?n.validate=r.validate:o(e,r),void(u(r.normalize)?n.normalize=r.normalize:r.normalize?o(e,r):n.normalize=h())):i(r)?void g.push(e):void o(e,r)}}),g.forEach(function(e){t.__compiled__[t.__schemas__[e]]&&(t.__compiled__[e].validate=t.__compiled__[t.__schemas__[e]].validate,t.__compiled__[e].normalize=t.__compiled__[t.__schemas__[e]].normalize)}),t.__compiled__[""]={validate:null,normalize:h()};var m=Object.keys(t.__compiled__).filter(function(e){return e.length>0&&t.__compiled__[e]}).map(c).join("|");t.re.schema_test=RegExp("(^|(?!_)(?:>|"+l.src_ZPCc+"))("+m+")","i"),t.re.schema_search=RegExp("(^|(?!_)(?:>|"+l.src_ZPCc+"))("+m+")","ig"),t.re.pretest=RegExp("("+t.re.schema_test.source+")|("+t.re.host_fuzzy_test.source+")|@","i"),p(t)}function g(t,e){var r=t.__index__,n=t.__last_index__,o=t.__text_cache__.slice(r,n);this.schema=t.__schema__.toLowerCase(),this.index=r+e,this.lastIndex=n+e,this.raw=o,this.text=o,this.url=o}function m(t,e){var r=new g(t,e);return t.__compiled__[r.schema].normalize(r,t),r}function v(t,e){return this instanceof v?(e||l(t)&&(e=t,t={}),this.__opts__=n({},_,e),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=n({},b,t),this.__compiled__={},this.__tlds__=y,this.__tlds_replaced__=!1,this.re={},void d(this)):new v(t,e)}var _={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1},b={"http:":{validate:function(t,e,r){var n=t.slice(e);return r.re.http||(r.re.http=new RegExp("^\\/\\/"+r.re.src_auth+r.re.src_host_port_strict+r.re.src_path,"i")),r.re.http.test(n)?n.match(r.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(t,e,r){var n=t.slice(e);return r.re.no_http||(r.re.no_http=new RegExp("^"+r.re.src_auth+r.re.src_host_port_strict+r.re.src_path,"i")),r.re.no_http.test(n)?e>=3&&":"===t[e-3]?0:n.match(r.re.no_http)[0].length:0}},"mailto:":{validate:function(t,e,r){var n=t.slice(e);return r.re.mailto||(r.re.mailto=new RegExp("^"+r.re.src_email_name+"@"+r.re.src_host_strict,"i")),r.re.mailto.test(n)?n.match(r.re.mailto)[0].length:0}}},x="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",y="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");v.prototype.add=function(t,e){return this.__schemas__[t]=e,d(this),this},v.prototype.set=function(t){return this.__opts__=n(this.__opts__,t),this},v.prototype.test=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return!1;var e,r,n,o,i,s,a,u,c;if(this.re.schema_test.test(t))for(a=this.re.schema_search,a.lastIndex=0;null!==(e=a.exec(t));)if(o=this.testSchemaAt(t,e[2],a.lastIndex)){this.__schema__=e[2],this.__index__=e.index+e[1].length,this.__last_index__=e.index+e[0].length+o;break}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(u=t.search(this.re.host_fuzzy_test),u>=0&&(this.__index__<0||u=0&&null!==(n=t.match(this.re.email_fuzzy))&&(i=n.index+n[1].length,s=n.index+n[0].length,(this.__index__<0||ithis.__last_index__)&&(this.__schema__="mailto:",this.__index__=i,this.__last_index__=s))),this.__index__>=0},v.prototype.pretest=function(t){return this.re.pretest.test(t)},v.prototype.testSchemaAt=function(t,e,r){return this.__compiled__[e.toLowerCase()]?this.__compiled__[e.toLowerCase()].validate(t,r,this):0},v.prototype.match=function(t){var e=0,r=[];this.__index__>=0&&this.__text_cache__===t&&(r.push(m(this,e)),e=this.__last_index__);for(var n=e?t.slice(e):t;this.test(n);)r.push(m(this,e)),n=n.slice(this.__last_index__),e+=this.__last_index__;return r.length?r:null},v.prototype.tlds=function(t,e){return t=Array.isArray(t)?t:[t],e?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(t,e,r){return t!==r[e-1]}).reverse(),d(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,d(this),this)},v.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),"mailto:"!==t.schema||/^mailto:/i.test(t.url)||(t.url="mailto:"+t.url)},t.exports=v},function(t,e,r){"use strict";var n=e.src_Any=r(56).source,o=e.src_Cc=r(54).source,i=e.src_Z=r(55).source,s=e.src_P=r(27).source,a=e.src_ZPCc=[i,s,o].join("|"),u=e.src_ZCc=[i,o].join("|"),c="(?:(?!"+a+")"+n+")",l="(?:(?![0-9]|"+a+")"+n+")",p=e.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)";e.src_auth="(?:(?:(?!"+u+").)+@)?";var f=e.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",h=e.src_host_terminator="(?=$|"+a+")(?!-|_|:\\d|\\.-|\\.(?!$|"+a+"))",d=e.src_path="(?:[/?#](?:(?!"+u+"|[()[\\]{}.,\"'?!\\-]).|\\[(?:(?!"+u+"|\\]).)*\\]|\\((?:(?!"+u+"|[)]).)*\\)|\\{(?:(?!"+u+'|[}]).)*\\}|\\"(?:(?!'+u+'|["]).)+\\"|\\\'(?:(?!'+u+"|[']).)+\\'|\\'(?="+c+").|\\.{2,3}[a-zA-Z0-9%/]|\\.(?!"+u+"|[.]).|\\-(?!--(?:[^-]|$))(?:-*)|\\,(?!"+u+").|\\!(?!"+u+"|[!]).|\\?(?!"+u+"|[?]).)+|\\/)?",g=e.src_email_name='[\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]+',m=e.src_xn="xn--[a-z0-9\\-]{1,59}",v=e.src_domain_root="(?:"+m+"|"+l+"{1,63})",_=e.src_domain="(?:"+m+"|(?:"+c+")|(?:"+c+"(?:-(?!-)|"+c+"){0,61}"+c+"))",b=e.src_host="(?:"+p+"|(?:(?:(?:"+_+")\\.)*"+v+"))",x=e.tpl_host_fuzzy="(?:"+p+"|(?:(?:(?:"+_+")\\.)+(?:%TLDS%)))",y=e.tpl_host_no_ip_fuzzy="(?:(?:(?:"+_+")\\.)+(?:%TLDS%))";e.src_host_strict=b+h;var k=e.tpl_host_fuzzy_strict=x+h;e.src_host_port_strict=b+f+h;var A=e.tpl_host_port_fuzzy_strict=x+f+h,w=e.tpl_host_port_no_ip_fuzzy_strict=y+f+h;e.tpl_host_fuzzy_test="localhost|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+a+"|$))",e.tpl_email_fuzzy="(^|>|"+u+")("+g+"@"+k+")",e.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`|]|"+a+"))((?![$+<=>^`|])"+A+d+")",e.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`|]|"+a+"))((?![$+<=>^`|])"+w+d+")"},function(t,e,r){function n(){}var o=r(10),i=Object.prototype;n.prototype=o?o(null):i,t.exports=n},function(t,e,r){function n(t){var e=-1,r=t?t.length:0;for(this.clear();++ee&&(e=-e>o?0:o+e),r=r>o?o:r,0>r&&(r+=o),o=e>r?0:r-e>>>0,e>>>=0;for(var i=Array(o);++nn?e[n]:void 0);return s}t.exports=r},function(t,e){function r(t){return t&&t.Object===Object?t:null}t.exports=r},function(t,e){function r(t,e){if(t!==e){var r=null===t,n=void 0===t,o=t===t,i=null===e,s=void 0===e,a=e===e;if(t>e&&!i||!o||r&&!s&&a||n&&a)return 1;if(e>t&&!r||!a||i&&!n&&o||s&&o)return-1}return 0}t.exports=r},function(t,e,r){function n(t,e,r){for(var n=-1,i=t.criteria,s=e.criteria,a=i.length,u=r.length;++n=u)return c;var l=r[n];return c*("desc"==l?-1:1)}}return t.index-e.index}var o=r(87);t.exports=n},function(t,e,r){function n(t,e,r){return o(t,e,r)}var o=r(90);t.exports=n},function(t,e,r){function n(t,e,r,n){r||(r={});for(var i=-1,s=e.length;++i1?r[i-1]:void 0,a=i>2?r[2]:void 0;for(s="function"==typeof s?(i--,s):void 0,a&&o(r[0],r[1],a)&&(s=3>i?void 0:s,i=1),e=Object(e);++nf))return!1;var d=u.get(t);if(d)return d==e;var g=!0;for(u.set(t,e);++c1&&i(t,e[0],e[1])?e=[]:r>2&&i(e[0],e[1],e[2])&&(e.length=1),o(t,n(e),[])});t.exports=a},function(t,e,r){function n(t){if(!t)return 0===t?t:0;if(t=o(t),t===i||t===-i){var e=0>t?-1:1;return e*s}var r=t%1;return t===t?r?t-r:t:0}var o=r(142),i=1/0,s=1.7976931348623157e308;t.exports=n},function(t,e,r){function n(t){if(i(t)){var e=o(t.valueOf)?t.valueOf():t;t=i(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(a,"");var r=c.test(t);return r||l.test(t)?p(t.slice(2),r?2:8):u.test(t)?s:+t}var o=r(22),i=r(6),s=NaN,a=/^\s+|\s+$/g,u=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,l=/^0o[0-7]+$/i,p=parseInt;t.exports=n},function(t,e,r){function n(t){return o(t,i(t))}var o=r(84),i=r(13);t.exports=n},function(t,e,r){var n=r(94),o=n("toUpperCase");t.exports=o},function(t,e,r){function n(t,e,r){return t=o(t),e=r?void 0:e,void 0===e&&(e=B.test(t)?I:M),t.match(e)||[]}var o=r(7),i="\\ud800-\\udfff",s="\\u0300-\\u036f\\ufe20-\\ufe23",a="\\u20d0-\\u20f0",u="\\u2700-\\u27bf",c="a-z\\xdf-\\xf6\\xf8-\\xff",l="\\xac\\xb1\\xd7\\xf7",p="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",f="\\u2018\\u2019\\u201c\\u201d",h=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",d="A-Z\\xc0-\\xd6\\xd8-\\xde",g="\\ufe0e\\ufe0f",m=l+p+f+h,v="["+m+"]",_="["+s+a+"]",b="\\d+",x="["+u+"]",y="["+c+"]",k="[^"+i+m+b+u+c+d+"]",A="\\ud83c[\\udffb-\\udfff]",w="(?:"+_+"|"+A+")",C="[^"+i+"]",E="(?:\\ud83c[\\udde6-\\uddff]){2}",D="[\\ud800-\\udbff][\\udc00-\\udfff]",q="["+d+"]",S="\\u200d",F="(?:"+y+"|"+k+")",z="(?:"+q+"|"+k+")",j=w+"?",L="["+g+"]?",T="(?:"+S+"(?:"+[C,E,D].join("|")+")"+L+j+")*",O=L+j+T,R="(?:"+[x,E,D].join("|")+")"+O,M=/[a-zA-Z0-9]+/g,I=RegExp([q+"?"+y+"+(?="+[v,q,"$"].join("|")+")",z+"+(?="+[v,q+F,"$"].join("|")+")",q+"?"+F+"+",q+"+",b,R].join("|"),"g"),B=/[a-z][A-Z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;t.exports=n},function(t,e,r){function n(t,e){return i(t||[],e||[],o)}var o=r(32),i=r(85);t.exports=n},function(t,e,r){"use strict";t.exports=r(151)},function(t,e){"use strict";t.exports=["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","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","meta","nav","noframes","ol","optgroup","option","p","param","pre","section","source","title","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"]},function(t,e){"use strict";t.exports=["coap","doi","javascript","aaa","aaas","about","acap","cap","cid","crid","data","dav","dict","dns","file","ftp","geo","go","gopher","h323","http","https","iax","icap","im","imap","info","ipp","iris","iris.beep","iris.xpc","iris.xpcs","iris.lwz","ldap","mailto","mid","msrp","msrps","mtqp","mupdate","news","nfs","ni","nih","nntp","opaquelocktoken","pop","pres","rtsp","service","session","shttp","sieve","sip","sips","sms","snmp","soap.beep","soap.beeps","tag","tel","telnet","tftp","thismessage","tn3270","tip","tv","urn","vemmi","ws","wss","xcon","xcon-userid","xmlrpc.beep","xmlrpc.beeps","xmpp","z39.50r","z39.50s","adiumxtra","afp","afs","aim","apt","attachment","aw","beshare","bitcoin","bolo","callto","chrome","chrome-extension","com-eventbrite-attendee","content","cvs","dlna-playsingle","dlna-playcontainer","dtn","dvb","ed2k","facetime","feed","finger","fish","gg","git","gizmoproject","gtalk","hcp","icon","ipn","irc","irc6","ircs","itms","jar","jms","keyparc","lastfm","ldaps","magnet","maps","market","message","mms","ms-help","msnim","mumble","mvn","notes","oid","palm","paparazzi","platform","proxy","psyc","query","res","resource","rmi","rsync","rtmp","secondlife","sftp","sgn","skype","smb","soldat","spotify","ssh","steam","svn","teamspeak","things","udp","unreal","ut2004","ventrilo","view-source","webcal","wtai","wyciwyg","xfire","xri","ymsgr"]},function(t,e,r){"use strict";e.parseLinkLabel=r(24),e.parseLinkDestination=r(14),e.parseLinkTitle=r(15)},function(t,e,r){"use strict";function n(t){var e=t.trim().toLowerCase();return v.test(e)?_.test(e)?!0:!1:!0}function o(t){var e=d.parse(t,!0);if(e.hostname&&(!e.protocol||b.indexOf(e.protocol)>=0))try{e.hostname=g.toASCII(e.hostname)}catch(r){}return d.encode(d.format(e))}function i(t){var e=d.parse(t,!0);if(e.hostname&&(!e.protocol||b.indexOf(e.protocol)>=0))try{e.hostname=g.toUnicode(e.hostname)}catch(r){}return d.decode(d.format(e))}function s(t,e){return this instanceof s?(e||a.isString(t)||(e=t||{},t="default"),this.inline=new f,this.block=new p,this.core=new l,this.renderer=new c,this.linkify=new h,this.validateLink=n,this.normalizeLink=o,this.normalizeLinkText=i,this.utils=a,this.helpers=u,this.options={},this.configure(t),void(e&&this.set(e))):new s(t,e)}var a=r(1),u=r(150),c=r(158),l=r(153),p=r(152),f=r(154),h=r(59),d=r(53),g=r(194),m={"default":r(156),zero:r(157),commonmark:r(155)},v=/^(vbscript|javascript|file|data):/,_=/^data:image\/(gif|png|jpeg|webp);/,b=["http:","https:","mailto:"];s.prototype.set=function(t){return a.assign(this.options,t),this},s.prototype.configure=function(t){var e,r=this;if(a.isString(t)&&(e=t,t=m[e],!t))throw new Error('Wrong `markdown-it` preset "'+e+'", check name');if(!t)throw new Error("Wrong `markdown-it` preset, can't be empty");return t.options&&r.set(t.options),t.components&&Object.keys(t.components).forEach(function(e){t.components[e].rules&&r[e].ruler.enableOnly(t.components[e].rules),t.components[e].rules2&&r[e].ruler2.enableOnly(t.components[e].rules2)}),this},s.prototype.enable=function(t,e){var r=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(e){r=r.concat(this[e].ruler.enable(t,!0))},this),r=r.concat(this.inline.ruler2.enable(t,!0));var n=t.filter(function(t){return r.indexOf(t)<0});if(n.length&&!e)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+n);return this},s.prototype.disable=function(t,e){var r=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(e){r=r.concat(this[e].ruler.disable(t,!0))},this),r=r.concat(this.inline.ruler2.disable(t,!0));var n=t.filter(function(t){return r.indexOf(t)<0});if(n.length&&!e)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+n);return this},s.prototype.use=function(t){var e=[this].concat(Array.prototype.slice.call(arguments,1));return t.apply(t,e),this},s.prototype.parse=function(t,e){var r=new this.core.State(t,this,e);return this.core.process(r),r.tokens},s.prototype.render=function(t,e){return e=e||{},this.renderer.render(this.parse(t,e),this.options,e)},s.prototype.parseInline=function(t,e){var r=new this.core.State(t,this,e);return r.inlineMode=!0,this.core.process(r),r.tokens},s.prototype.renderInline=function(t,e){return e=e||{},this.renderer.render(this.parseInline(t,e),this.options,e)},t.exports=s},function(t,e,r){"use strict";function n(){this.ruler=new o;for(var t=0;ta&&(t.line=a=t.skipEmptyLines(a),!(a>=r))&&!(t.sCount[a]=c){t.line=r;break}for(o=0;s>o&&!(n=i[o](t,a,r,!1));o++);if(t.tight=!u,t.isEmpty(t.line-1)&&(u=!0),a=t.line,r>a&&t.isEmpty(a)){if(u=!0,a++,r>a&&"list"===t.parentType&&t.isEmpty(a))break;t.line=a}}},n.prototype.parse=function(t,e,r,n){var o;return t?(o=new this.State(t,e,r,n),void this.tokenize(o,o.line,o.lineMax)):[]},n.prototype.State=r(169),t.exports=n},function(t,e,r){"use strict";function n(){this.ruler=new o;for(var t=0;te;e++)n[e](t)},n.prototype.State=r(177),t.exports=n},function(t,e,r){"use strict";function n(){var t;for(this.ruler=new o,t=0;te;e++)if(n[e](t,!0))return void(s[r]=t.pos);t.pos++,s[r]=t.pos},n.prototype.tokenize=function(t){for(var e,r,n=this.ruler.getRules(""),o=n.length,i=t.posMax,s=t.md.options.maxNesting;t.posr&&!(e=n[r](t,!1));r++);if(e){if(t.pos>=i)break}else t.pending+=t.src[t.pos++]}t.pending&&t.pushPending()},n.prototype.parse=function(t,e,r,n){var o,i,s,a=new this.State(t,e,r,n);for(this.tokenize(a),i=this.ruler2.getRules(""),s=i.length,o=0;s>o;o++)i[o](a)},n.prototype.State=r(187),t.exports=n},function(t,e){"use strict";t.exports={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","text_collapse"]}}}},function(t,e){"use strict";t.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{},block:{},inline:{}}}},function(t,e){"use strict";t.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","text_collapse"]}}}},function(t,e,r){"use strict";function n(){this.rules=o({},a)}var o=r(1).assign,i=r(1).unescapeAll,s=r(1).escapeHtml,a={};a.code_inline=function(t,e){return""+s(t[e].content)+""},a.code_block=function(t,e){return"
"+s(t[e].content)+"
\n"},a.fence=function(t,e,r,n,o){var a,u=t[e],c=u.info?i(u.info).trim():"",l="";return c&&(l=c.split(/\s+/g)[0],u.attrJoin("class",r.langPrefix+l)),a=r.highlight?r.highlight(u.content,l)||s(u.content):s(u.content),0===a.indexOf(""+a+"\n"},a.image=function(t,e,r,n,o){var i=t[e];return i.attrs[i.attrIndex("alt")][1]=o.renderInlineAsText(i.children,r,n),o.renderToken(t,e,r)},a.hardbreak=function(t,e,r){return r.xhtmlOut?"
\n":"
\n"},a.softbreak=function(t,e,r){return r.breaks?r.xhtmlOut?"
\n":"
\n":"\n"},a.text=function(t,e){return s(t[e].content)},a.html_block=function(t,e){return t[e].content},a.html_inline=function(t,e){return t[e].content},n.prototype.renderAttrs=function(t){var e,r,n;if(!t.attrs)return"";for(n="",e=0,r=t.attrs.length;r>e;e++)n+=" "+s(t.attrs[e][0])+'="'+s(t.attrs[e][1])+'"';return n},n.prototype.renderToken=function(t,e,r){var n,o="",i=!1,s=t[e];return s.hidden?"":(s.block&&-1!==s.nesting&&e&&t[e-1].hidden&&(o+="\n"),o+=(-1===s.nesting?"\n":">")},n.prototype.renderInline=function(t,e,r){for(var n,o="",i=this.rules,s=0,a=t.length;a>s;s++)n=t[s].type,o+="undefined"!=typeof i[n]?i[n](t,s,e,r,this):this.renderToken(t,s,e);return o},n.prototype.renderInlineAsText=function(t,e,r){for(var n="",o=this.rules,i=0,s=t.length;s>i;i++)"text"===t[i].type?n+=o.text(t,i,e,r,this):"image"===t[i].type&&(n+=this.renderInlineAsText(t[i].children,e,r));return n},n.prototype.render=function(t,e,r){var n,o,i,s="",a=this.rules;for(n=0,o=t.length;o>n;n++)i=t[n].type,s+="inline"===i?this.renderInline(t[n].children,e,r):"undefined"!=typeof a[i]?a[t[n].type](t,n,e,r,this):this.renderToken(t,n,e,r);return s},t.exports=n},function(t,e,r){"use strict";var n=r(1).isSpace;t.exports=function(t,e,r,o){var i,s,a,u,c,l,p,f,h,d,g,m,v,_,b,x,y=t.bMarks[e]+t.tShift[e],k=t.eMarks[e];if(62!==t.src.charCodeAt(y++))return!1;if(o)return!0;for(32===t.src.charCodeAt(y)&&y++,l=t.blkIndent,t.blkIndent=0,h=d=t.sCount[e]+y-(t.bMarks[e]+t.tShift[e]),c=[t.bMarks[e]],t.bMarks[e]=y;k>y&&(g=t.src.charCodeAt(y),n(g));)9===g?d+=4-d%4:d++,y++;for(s=y>=k,u=[t.sCount[e]],t.sCount[e]=d-h,a=[t.tShift[e]],t.tShift[e]=y-t.bMarks[e],m=t.md.block.ruler.getRules("blockquote"),i=e+1;r>i&&!(t.sCount[i]=k));i++)if(62!==t.src.charCodeAt(y++)){if(s)break;for(x=!1,_=0,b=m.length;b>_;_++)if(m[_](t,i,r,!0)){x=!0;break}if(x)break;c.push(t.bMarks[i]),a.push(t.tShift[i]),u.push(t.sCount[i]),t.sCount[i]=-1}else{for(32===t.src.charCodeAt(y)&&y++,h=d=t.sCount[i]+y-(t.bMarks[i]+t.tShift[i]),c.push(t.bMarks[i]),t.bMarks[i]=y;k>y&&(g=t.src.charCodeAt(y),n(g));)9===g?d+=4-d%4:d++,y++;s=y>=k,u.push(t.sCount[i]),t.sCount[i]=d-h,a.push(t.tShift[i]),t.tShift[i]=y-t.bMarks[i]}for(p=t.parentType,t.parentType="blockquote",v=t.push("blockquote_open","blockquote",1),v.markup=">",v.map=f=[e,0],t.md.block.tokenize(t,e,i),v=t.push("blockquote_close","blockquote",-1),v.markup=">",t.parentType=p,f[1]=t.line,_=0;_n;)if(t.isEmpty(n))n++;else{if(!(t.sCount[n]-t.blkIndent>=4))break;n++,o=n}return t.line=n,i=t.push("code_block","code",0),i.content=t.getLines(e,o,4+t.blkIndent,!0),i.map=[e,t.line],!0}},function(t,e){"use strict";t.exports=function(t,e,r,n){var o,i,s,a,u,c,l,p=!1,f=t.bMarks[e]+t.tShift[e],h=t.eMarks[e];if(f+3>h)return!1;if(o=t.src.charCodeAt(f),126!==o&&96!==o)return!1;if(u=f,f=t.skipChars(f,o),i=f-u,3>i)return!1;if(l=t.src.slice(u,f),s=t.src.slice(f,h),s.indexOf("`")>=0)return!1;if(n)return!0;for(a=e;a++,!(a>=r||(f=u=t.bMarks[a]+t.tShift[a],h=t.eMarks[a],h>f&&t.sCount[a]=4||(f=t.skipChars(f,o),i>f-u||(f=t.skipSpaces(f),h>f)))){p=!0;break}return i=t.sCount[e],t.line=a+(p?1:0),c=t.push("fence","code",0),c.info=s,c.content=t.getLines(e+1,a,i,!0),c.markup=l,c.map=[e,t.line],!0}},function(t,e,r){"use strict";var n=r(1).isSpace;t.exports=function(t,e,r,o){var i,s,a,u,c=t.bMarks[e]+t.tShift[e],l=t.eMarks[e];if(i=t.src.charCodeAt(c),35!==i||c>=l)return!1;for(s=1,i=t.src.charCodeAt(++c);35===i&&l>c&&6>=s;)s++,i=t.src.charCodeAt(++c);return s>6||l>c&&32!==i?!1:o?!0:(l=t.skipSpacesBack(l,c),a=t.skipCharsBack(l,35,c),a>c&&n(t.src.charCodeAt(a-1))&&(l=a),t.line=e+1,u=t.push("heading_open","h"+String(s),1),u.markup="########".slice(0,s),u.map=[e,t.line],u=t.push("inline","",0),u.content=t.src.slice(c,l).trim(),u.map=[e,t.line],u.children=[],u=t.push("heading_close","h"+String(s),-1),u.markup="########".slice(0,s),!0)}},function(t,e,r){"use strict";var n=r(1).isSpace;t.exports=function(t,e,r,o){var i,s,a,u,c=t.bMarks[e]+t.tShift[e],l=t.eMarks[e];if(i=t.src.charCodeAt(c++),42!==i&&45!==i&&95!==i)return!1;for(s=1;l>c;){if(a=t.src.charCodeAt(c++),a!==i&&!n(a))return!1;a===i&&s++}return 3>s?!1:o?!0:(t.line=e+1,u=t.push("hr","hr",0),u.map=[e,t.line],u.markup=Array(s+1).join(String.fromCharCode(i)),!0)}},function(t,e,r){"use strict";var n=r(148),o=r(50).HTML_OPEN_CLOSE_TAG_RE,i=[[/^<(script|pre|style)(?=(\s|>|$))/i,/<\/(script|pre|style)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^|$))","i"),/^$/,!0],[new RegExp(o.source+"\\s*$"),/^$/,!1]];t.exports=function(t,e,r,n){var o,s,a,u,c=t.bMarks[e]+t.tShift[e],l=t.eMarks[e];if(!t.md.options.html)return!1;if(60!==t.src.charCodeAt(c))return!1;for(u=t.src.slice(c,l),o=0;os&&!(t.sCount[s]=r?!1:t.sCount[u]3?!1:(o=t.bMarks[u]+t.tShift[u],i=t.eMarks[u],o>=i?!1:(n=t.src.charCodeAt(o),45!==n&&61!==n?!1:(o=t.skipChars(o,n),o=t.skipSpaces(o),i>o?!1:(o=t.bMarks[e]+t.tShift[e],t.line=u+1,a=61===n?1:2,s=t.push("heading_open","h"+String(a),1),s.markup=String.fromCharCode(n),s.map=[e,t.line],s=t.push("inline","",0),s.content=t.src.slice(o,t.eMarks[e]).trim(),s.map=[e,t.line-1],s.children=[],s=t.push("heading_close","h"+String(a),-1),s.markup=String.fromCharCode(n),!0))))}},function(t,e,r){"use strict";function n(t,e){var r,n,o,i;return n=t.bMarks[e]+t.tShift[e],o=t.eMarks[e],r=t.src.charCodeAt(n++),42!==r&&45!==r&&43!==r?-1:o>n&&(i=t.src.charCodeAt(n),!s(i))?-1:n}function o(t,e){var r,n=t.bMarks[e]+t.tShift[e],o=n,i=t.eMarks[e];if(o+1>=i)return-1;if(r=t.src.charCodeAt(o++),48>r||r>57)return-1;for(;;){if(o>=i)return-1;if(r=t.src.charCodeAt(o++),!(r>=48&&57>=r)){if(41===r||46===r)break;return-1}if(o-n>=10)return-1}return i>o&&(r=t.src.charCodeAt(o),!s(r))?-1:o}function i(t,e){var r,n,o=t.level+2;for(r=e+2,n=t.tokens.length-2;n>r;r++)t.tokens[r].level===o&&"paragraph_open"===t.tokens[r].type&&(t.tokens[r+2].hidden=!0,t.tokens[r].hidden=!0,r+=2)}var s=r(1).isSpace;t.exports=function(t,e,r,a){var u,c,l,p,f,h,d,g,m,v,_,b,x,y,k,A,w,C,E,D,q,S,F,z,j,L,T,O,R=!0;if((_=o(t,e))>=0)C=!0;else{if(!((_=n(t,e))>=0))return!1;C=!1}if(w=t.src.charCodeAt(_-1),a)return!0;for(D=t.tokens.length,C?(v=t.bMarks[e]+t.tShift[e],A=Number(t.src.substr(v,_-v-1)),j=t.push("ordered_list_open","ol",1),1!==A&&(j.attrs=[["start",A]])):j=t.push("bullet_list_open","ul",1),j.map=S=[e,0],j.markup=String.fromCharCode(w),u=e,q=!1,z=t.md.block.ruler.getRules("list");r>u;){for(x=_,y=t.eMarks[u],c=l=t.sCount[u]+_-(t.bMarks[e]+t.tShift[e]);y>x&&(b=t.src.charCodeAt(x),s(b));)9===b?l+=4-l%4:l++,x++;if(E=x,k=E>=y?1:l-c,k>4&&(k=1),p=c+k,j=t.push("list_item_open","li",1),j.markup=String.fromCharCode(w),j.map=F=[e,0],h=t.blkIndent,g=t.tight,f=t.tShift[e],d=t.sCount[e],m=t.parentType,t.blkIndent=p,t.tight=!0,t.parentType="list",t.tShift[e]=E-t.bMarks[e],t.sCount[e]=l,t.md.block.tokenize(t,e,r,!0),(!t.tight||q)&&(R=!1),q=t.line-e>1&&t.isEmpty(t.line-1),t.blkIndent=h,t.tShift[e]=f,t.sCount[e]=d,t.tight=g,t.parentType=m,j=t.push("list_item_close","li",-1),j.markup=String.fromCharCode(w),u=e=t.line,F[1]=u,E=t.bMarks[e],u>=r)break;if(t.isEmpty(u))break;if(t.sCount[u]L;L++)if(z[L](t,u,r,!0)){O=!0;break}if(O)break;if(C){if(_=o(t,u),0>_)break}else if(_=n(t,u),0>_)break;if(w!==t.src.charCodeAt(_-1))break}return j=C?t.push("ordered_list_close","ol",-1):t.push("bullet_list_close","ul",-1),j.markup=String.fromCharCode(w),S[1]=u,t.line=u,R&&i(t,D),!0}},function(t,e){"use strict";t.exports=function(t,e){for(var r,n,o,i,s,a=e+1,u=t.md.block.ruler.getRules("paragraph"),c=t.lineMax;c>a&&!t.isEmpty(a);a++)if(!(t.sCount[a]-t.blkIndent>3||t.sCount[a]<0)){for(n=!1,o=0,i=u.length;i>o;o++)if(u[o](t,a,c,!0)){n=!0;break}if(n)break}return r=t.getLines(e,a,t.blkIndent,!1).trim(),t.line=a,s=t.push("paragraph_open","p",1),s.map=[e,t.line],s=t.push("inline","",0),s.content=r,s.map=[e,t.line],s.children=[],s=t.push("paragraph_close","p",-1),!0}},function(t,e,r){"use strict";var n=r(14),o=r(15),i=r(1).normalizeReference,s=r(1).isSpace;t.exports=function(t,e,r,a){var u,c,l,p,f,h,d,g,m,v,_,b,x,y,k,A=0,w=t.bMarks[e]+t.tShift[e],C=t.eMarks[e],E=e+1;if(91!==t.src.charCodeAt(w))return!1;for(;++wE&&!t.isEmpty(E);E++)if(!(t.sCount[E]-t.blkIndent>3||t.sCount[E]<0)){for(x=!1,h=0,d=y.length;d>h;h++)if(y[h](t,E,p,!0)){x=!0;break}if(x)break}for(b=t.getLines(e,E,t.blkIndent,!1).trim(),C=b.length,w=1;C>w;w++){if(u=b.charCodeAt(w),91===u)return!1;if(93===u){m=w;break}10===u?A++:92===u&&(w++,C>w&&10===b.charCodeAt(w)&&A++)}if(0>m||58!==b.charCodeAt(m+1))return!1;for(w=m+2;C>w;w++)if(u=b.charCodeAt(w),10===u)A++;else if(!s(u))break;if(v=n(b,w,C),!v.ok)return!1;if(f=t.md.normalizeLink(v.str),!t.md.validateLink(f))return!1;for(w=v.pos,A+=v.lines,c=w,l=A,_=w;C>w;w++)if(u=b.charCodeAt(w),10===u)A++;else if(!s(u))break;for(v=o(b,w,C),C>w&&_!==w&&v.ok?(k=v.str,w=v.pos,A+=v.lines):(k="",w=c,A=l);C>w&&(u=b.charCodeAt(w),s(u));)w++;if(C>w&&10!==b.charCodeAt(w)&&k)for(k="",w=c,A=l;C>w&&(u=b.charCodeAt(w),s(u));)w++;return C>w&&10!==b.charCodeAt(w)?!1:(g=i(b.slice(1,m)))?a?!0:("undefined"==typeof t.env.references&&(t.env.references={}),"undefined"==typeof t.env.references[g]&&(t.env.references[g]={title:k,href:f}),t.line=e+A+1,!0):!1}},function(t,e,r){"use strict";function n(t,e,r,n){var o,s,a,u,c,l,p,f;for(this.src=t,this.md=e,this.env=r,this.tokens=n,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.parentType="root",this.ddIndent=-1,this.level=0,this.result="",s=this.src,f=!1,a=u=l=p=0,c=s.length;c>u;u++){if(o=s.charCodeAt(u),!f){if(i(o)){l++,9===o?p+=4-p%4:p++;continue}f=!0}(10===o||u===c-1)&&(10!==o&&u++,this.bMarks.push(a),this.eMarks.push(u),this.tShift.push(l),this.sCount.push(p),f=!1,l=0,p=0,a=u+1)}this.bMarks.push(s.length),this.eMarks.push(s.length),this.tShift.push(0),this.sCount.push(0),this.lineMax=this.bMarks.length-1}var o=r(26),i=r(1).isSpace;n.prototype.push=function(t,e,r){var n=new o(t,e,r);return n.block=!0,0>r&&this.level--,n.level=this.level,r>0&&this.level++,this.tokens.push(n),n},n.prototype.isEmpty=function(t){return this.bMarks[t]+this.tShift[t]>=this.eMarks[t]},n.prototype.skipEmptyLines=function(t){for(var e=this.lineMax;e>t&&!(this.bMarks[t]+this.tShift[t]t&&(e=this.src.charCodeAt(t),i(e));t++);return t},n.prototype.skipSpacesBack=function(t,e){if(e>=t)return t;for(;t>e;)if(!i(this.src.charCodeAt(--t)))return t+1;return t},n.prototype.skipChars=function(t,e){for(var r=this.src.length;r>t&&this.src.charCodeAt(t)===e;t++);return t},n.prototype.skipCharsBack=function(t,e,r){if(r>=t)return t;for(;t>r;)if(e!==this.src.charCodeAt(--t))return t+1;return t},n.prototype.getLines=function(t,e,r,n){var o,s,a,u,c,l,p,f=t;if(t>=e)return"";for(l=new Array(e-t),o=0;e>f;f++,o++){for(s=0,p=u=this.bMarks[f],c=e>f+1||n?this.eMarks[f]+1:this.eMarks[f];c>u&&r>s;){if(a=this.src.charCodeAt(u),i(a))9===a?s+=4-s%4:s++;else{if(!(u-pn;)96===e&&i%2===0?(a=!a,u=n):124!==e||i%2!==0||a?92===e?i++:i=0:(r.push(t.substring(s,n)),s=n+1),n++,n===o&&a&&(a=!1,n=u+1),e=t.charCodeAt(n);return r.push(t.substring(s)),r}t.exports=function(t,e,o,i){var s,a,u,c,l,p,f,h,d,g,m,v;if(e+2>o)return!1;if(l=e+1,t.sCount[l]=t.eMarks[l])return!1;if(s=t.src.charCodeAt(u),124!==s&&45!==s&&58!==s)return!1;if(a=r(t,e+1),!/^[-:| ]+$/.test(a))return!1;for(p=a.split("|"),d=[],c=0;cd.length)return!1;if(i)return!0;for(h=t.push("table_open","table",1),h.map=m=[e,0],h=t.push("thead_open","thead",1),h.map=[e,e+1],h=t.push("tr_open","tr",1),h.map=[e,e+1],c=0;cl&&!(t.sCount[l]c;c++)h=t.push("td_open","td",1),d[c]&&(h.attrs=[["style","text-align:"+d[c]]]),h=t.push("inline","",0),h.content=p[c]?p[c].trim():"",h.children=[],h=t.push("td_close","td",-1);h=t.push("tr_close","tr",-1)}return h=t.push("tbody_close","tbody",-1),h=t.push("table_close","table",-1),m[1]=v[1]=l,t.line=l,!0}},function(t,e){"use strict";t.exports=function(t){var e;t.inlineMode?(e=new t.Token("inline","",0),e.content=t.src,e.map=[0,1],e.children=[],t.tokens.push(e)):t.md.block.parse(t.src,t.md,t.env,t.tokens)}},function(t,e){"use strict";t.exports=function(t){var e,r,n,o=t.tokens;for(r=0,n=o.length;n>r;r++)e=o[r],"inline"===e.type&&t.md.inline.parse(e.content,t.md,t.env,e.children)}},function(t,e,r){"use strict";function n(t){return/^\s]/i.test(t)}function o(t){return/^<\/a\s*>/i.test(t)}var i=r(1).arrayReplaceAt;t.exports=function(t){var e,r,s,a,u,c,l,p,f,h,d,g,m,v,_,b,x,y=t.tokens;if(t.md.options.linkify)for(r=0,s=y.length;s>r;r++)if("inline"===y[r].type&&t.md.linkify.pretest(y[r].content))for(a=y[r].children,m=0,e=a.length-1;e>=0;e--)if(c=a[e],"link_close"!==c.type){if("html_inline"===c.type&&(n(c.content)&&m>0&&m--,o(c.content)&&m++),!(m>0)&&"text"===c.type&&t.md.linkify.test(c.content)){for(f=c.content,x=t.md.linkify.match(f),l=[],g=c.level,d=0,p=0;pd&&(u=new t.Token("text","",0),u.content=f.slice(d,h),u.level=g,l.push(u)),u=new t.Token("link_open","a",1),u.attrs=[["href",_]],u.level=g++,u.markup="linkify",u.info="auto",l.push(u),u=new t.Token("text","",0),u.content=b,u.level=g,l.push(u),u=new t.Token("link_close","a",-1),u.level=--g,u.markup="linkify",u.info="auto",l.push(u),d=x[p].lastIndex);d=0;e--)n=t[e],"text"===n.type&&(n.content=n.content.replace(a,r))}function o(t){var e,r;for(e=t.length-1;e>=0;e--)r=t[e],"text"===r.type&&i.test(r.content)&&(r.content=r.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---([^-]|$)/gm,"$1—$2").replace(/(^|\s)--(\s|$)/gm,"$1–$2").replace(/(^|[^-\s])--([^-\s]|$)/gm,"$1–$2"))}var i=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,s=/\((c|tm|r|p)\)/i,a=/\((c|tm|r|p)\)/gi,u={c:"©",r:"®",p:"§",tm:"™"};t.exports=function(t){var e;if(t.md.options.typographer)for(e=t.tokens.length-1;e>=0;e--)"inline"===t.tokens[e].type&&(s.test(t.tokens[e].content)&&n(t.tokens[e].children),i.test(t.tokens[e].content)&&o(t.tokens[e].children))}},function(t,e,r){"use strict";function n(t,e,r){return t.substr(0,e)+r+t.substr(e+1)}function o(t,e){var r,o,u,p,f,h,d,g,m,v,_,b,x,y,k,A,w,C,E,D,q;for(E=[],r=0;r=0&&!(E[w].level<=d);w--);if(E.length=w+1,"text"===o.type){u=o.content,f=0,h=u.length;t:for(;h>f&&(c.lastIndex=f,p=c.exec(u));){if(k=A=!0,f=p.index+1,C="'"===p[0],m=32,p.index-1>=0)m=u.charCodeAt(p.index-1);else for(w=r-1;w>=0;w--)if("text"===t[w].type){m=t[w].content.charCodeAt(t[w].content.length-1);break}if(v=32,h>f)v=u.charCodeAt(f);else for(w=r+1;w=48&&57>=m&&(A=k=!1),k&&A&&(k=!1,A=b),k||A){if(A)for(w=E.length-1;w>=0&&(g=E[w],!(E[w].level=0;e--)"inline"===t.tokens[e].type&&u.test(t.tokens[e].content)&&o(t.tokens[e].children,t)}},function(t,e,r){"use strict";function n(t,e,r){this.src=t,this.env=r,this.tokens=[],this.inlineMode=!1,this.md=e}var o=r(26);n.prototype.Token=o,t.exports=n},function(t,e,r){"use strict";var n=r(149),o=/^<([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/,i=/^<([a-zA-Z.\-]{1,25}):([^<>\x00-\x20]*)>/;t.exports=function(t,e){var r,s,a,u,c,l,p=t.pos;return 60!==t.src.charCodeAt(p)?!1:(r=t.src.slice(p),r.indexOf(">")<0?!1:i.test(r)?(s=r.match(i),n.indexOf(s[1].toLowerCase())<0?!1:(u=s[0].slice(1,-1),c=t.md.normalizeLink(u),t.md.validateLink(c)?(e||(l=t.push("link_open","a",1),l.attrs=[["href",c]],l.markup="autolink",l.info="auto",l=t.push("text","",0),l.content=t.md.normalizeLinkText(u),l=t.push("link_close","a",-1),l.markup="autolink",l.info="auto"),t.pos+=s[0].length,!0):!1)):o.test(r)?(a=r.match(o),u=a[0].slice(1,-1),c=t.md.normalizeLink("mailto:"+u),t.md.validateLink(c)?(e||(l=t.push("link_open","a",1),l.attrs=[["href",c]],l.markup="autolink",l.info="auto",l=t.push("text","",0),l.content=t.md.normalizeLinkText(u),l=t.push("link_close","a",-1),l.markup="autolink",l.info="auto"),t.pos+=a[0].length,!0):!1):!1)}},function(t,e){"use strict";t.exports=function(t,e){var r,n,o,i,s,a,u=t.pos,c=t.src.charCodeAt(u);if(96!==c)return!1;for(r=u,u++,n=t.posMax;n>u&&96===t.src.charCodeAt(u);)u++;for(o=t.src.slice(r,u),i=s=u;-1!==(i=t.src.indexOf("`",s));){for(s=i+1;n>s&&96===t.src.charCodeAt(s);)s++;if(s-i===o.length)return e||(a=t.push("code_inline","code",0),a.markup=o,a.content=t.src.slice(u,i).replace(/[ \n]+/g," ").trim()),t.pos=s,!0}return e||(t.pending+=o),t.pos+=o.length,!0}},function(t,e){"use strict";t.exports=function(t){var e,r,n,o,i=t.delimiters,s=t.delimiters.length;for(e=0;s>e;e++)if(n=i[e],n.close)for(r=e-n.jump-1;r>=0;){if(o=i[r],o.open&&o.marker===n.marker&&o.end<0&&o.level===n.level){n.jump=e-r,n.open=!1,o.end=e,o.jump=0;break}r-=o.jump+1}}},function(t,e,r){"use strict";var n=r(49),o=r(1).has,i=r(1).isValidEntityCode,s=r(1).fromCodePoint,a=/^&#((?:x[a-f0-9]{1,8}|[0-9]{1,8}));/i,u=/^&([a-z][a-z0-9]{1,31});/i;t.exports=function(t,e){var r,c,l,p=t.pos,f=t.posMax;if(38!==t.src.charCodeAt(p))return!1;if(f>p+1)if(r=t.src.charCodeAt(p+1),35===r){if(l=t.src.slice(p).match(a))return e||(c="x"===l[1][0].toLowerCase()?parseInt(l[1].slice(1),16):parseInt(l[1],10),t.pending+=s(i(c)?c:65533)),t.pos+=l[0].length,!0}else if(l=t.src.slice(p).match(u),l&&o(n,l[1]))return e||(t.pending+=n[l[1]]),t.pos+=l[0].length,!0;return e||(t.pending+="&"),t.pos++,!0}},function(t,e,r){"use strict";for(var n=r(1).isSpace,o=[],i=0;256>i;i++)o.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(t){o[t.charCodeAt(0)]=1}),t.exports=function(t,e){var r,i=t.pos,s=t.posMax;if(92!==t.src.charCodeAt(i))return!1;if(i++,s>i){if(r=t.src.charCodeAt(i),256>r&&0!==o[r])return e||(t.pending+=t.src[i]),t.pos+=2,!0;if(10===r){for(e||t.push("hardbreak","br",0),i++;s>i&&(r=t.src.charCodeAt(i),n(r));)i++;return t.pos=i,!0}}return e||(t.pending+="\\"),t.pos++,!0}},function(t,e,r){"use strict";function n(t){var e=32|t;return e>=97&&122>=e}var o=r(50).HTML_TAG_RE;t.exports=function(t,e){var r,i,s,a,u=t.pos;return t.md.options.html?(s=t.posMax,60!==t.src.charCodeAt(u)||u+2>=s?!1:(r=t.src.charCodeAt(u+1),(33===r||63===r||47===r||n(r))&&(i=t.src.slice(u).match(o))?(e||(a=t.push("html_inline","",0),a.content=t.src.slice(u,u+i[0].length)),t.pos+=i[0].length,!0):!1)):!1}},function(t,e,r){"use strict";var n=r(24),o=r(14),i=r(15),s=r(1).normalizeReference,a=r(1).isSpace;t.exports=function(t,e){var r,u,c,l,p,f,h,d,g,m,v,_,b,x="",y=t.pos,k=t.posMax;if(33!==t.src.charCodeAt(t.pos))return!1;if(91!==t.src.charCodeAt(t.pos+1))return!1;if(f=t.pos+2,p=n(t,t.pos+1,!1),0>p)return!1;if(h=p+1,k>h&&40===t.src.charCodeAt(h)){for(h++;k>h&&(u=t.src.charCodeAt(h),a(u)||10===u);h++);if(h>=k)return!1;for(b=h,g=o(t.src,h,t.posMax),g.ok&&(x=t.md.normalizeLink(g.str),t.md.validateLink(x)?h=g.pos:x=""),b=h;k>h&&(u=t.src.charCodeAt(h),a(u)||10===u);h++);if(g=i(t.src,h,t.posMax),k>h&&b!==h&&g.ok)for(m=g.str,h=g.pos;k>h&&(u=t.src.charCodeAt(h),a(u)||10===u);h++);else m="";if(h>=k||41!==t.src.charCodeAt(h))return t.pos=y,!1;h++}else{if("undefined"==typeof t.env.references)return!1;for(;k>h&&(u=t.src.charCodeAt(h),a(u)||10===u);h++);if(k>h&&91===t.src.charCodeAt(h)?(b=h+1,h=n(t,h),h>=0?l=t.src.slice(b,h++):h=p+1):h=p+1,l||(l=t.src.slice(f,p)),d=t.env.references[s(l)],!d)return t.pos=y,!1;x=d.href,m=d.title}return e||(c=t.src.slice(f,p),t.md.inline.parse(c,t.md,t.env,_=[]),v=t.push("image","img",0),v.attrs=r=[["src",x],["alt",""]],v.children=_,v.content=c,m&&r.push(["title",m])),t.pos=h,t.posMax=k,!0}},function(t,e,r){"use strict";var n=r(24),o=r(14),i=r(15),s=r(1).normalizeReference,a=r(1).isSpace;t.exports=function(t,e){var r,u,c,l,p,f,h,d,g,m,v="",_=t.pos,b=t.posMax,x=t.pos;if(91!==t.src.charCodeAt(t.pos))return!1;if(p=t.pos+1,l=n(t,t.pos,!0),0>l)return!1;if(f=l+1,b>f&&40===t.src.charCodeAt(f)){for(f++;b>f&&(u=t.src.charCodeAt(f),a(u)||10===u);f++);if(f>=b)return!1;for(x=f,h=o(t.src,f,t.posMax),h.ok&&(v=t.md.normalizeLink(h.str),t.md.validateLink(v)?f=h.pos:v=""),x=f;b>f&&(u=t.src.charCodeAt(f),a(u)||10===u);f++);if(h=i(t.src,f,t.posMax),b>f&&x!==f&&h.ok)for(g=h.str,f=h.pos;b>f&&(u=t.src.charCodeAt(f),a(u)||10===u);f++);else g="";if(f>=b||41!==t.src.charCodeAt(f))return t.pos=_,!1;f++}else{if("undefined"==typeof t.env.references)return!1;for(;b>f&&(u=t.src.charCodeAt(f),a(u)||10===u);f++);if(b>f&&91===t.src.charCodeAt(f)?(x=f+1,f=n(t,f),f>=0?c=t.src.slice(x,f++):f=l+1):f=l+1,c||(c=t.src.slice(p,l)),d=t.env.references[s(c)],!d)return t.pos=_,!1;v=d.href,g=d.title}return e||(t.pos=p,t.posMax=l,m=t.push("link_open","a",1),m.attrs=r=[["href",v]],g&&r.push(["title",g]),t.md.inline.tokenize(t),m=t.push("link_close","a",-1)),t.pos=f,t.posMax=b,!0}},function(t,e){"use strict";t.exports=function(t,e){var r,n,o=t.pos;if(10!==t.src.charCodeAt(o))return!1;for(r=t.pending.length-1,n=t.posMax,e||(r>=0&&32===t.pending.charCodeAt(r)?r>=1&&32===t.pending.charCodeAt(r-1)?(t.pending=t.pending.replace(/ +$/,""),t.push("hardbreak","br",0)):(t.pending=t.pending.slice(0,-1),t.push("softbreak","br",0)):t.push("softbreak","br",0)),o++;n>o&&32===t.src.charCodeAt(o);)o++;return t.pos=o,!0}},function(t,e,r){"use strict";function n(t,e,r,n){this.src=t,this.env=r,this.md=e,this.tokens=n,this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[]}var o=r(26),i=r(1).isWhiteSpace,s=r(1).isPunctChar,a=r(1).isMdAsciiPunct;n.prototype.pushPending=function(){var t=new o("text","",0);return t.content=this.pending,t.level=this.pendingLevel,this.tokens.push(t),this.pending="",t},n.prototype.push=function(t,e,r){this.pending&&this.pushPending();var n=new o(t,e,r);return 0>r&&this.level--,n.level=this.level,r>0&&this.level++,this.pendingLevel=this.level,this.tokens.push(n),n},n.prototype.scanDelims=function(t,e){var r,n,o,u,c,l,p,f,h,d=t,g=!0,m=!0,v=this.posMax,_=this.src.charCodeAt(t);for(r=t>0?this.src.charCodeAt(t-1):32;v>d&&this.src.charCodeAt(d)===_;)d++;return o=d-t,n=v>d?this.src.charCodeAt(d):32,p=a(r)||s(String.fromCharCode(r)),h=a(n)||s(String.fromCharCode(n)),l=i(r),f=i(n),f?g=!1:h&&(l||p||(g=!1)),l?m=!1:p&&(f||h||(m=!1)),e?(u=g,c=m):(u=g&&(!m||p),c=m&&(!g||h)),{can_open:u,can_close:c,length:o}},n.prototype.Token=o,t.exports=n},function(t,e){"use strict";function r(t){switch(t){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}t.exports=function(t,e){for(var n=t.pos;ne;e++)n+=o[e].nesting,o[e].level=n,"text"===o[e].type&&i>e+1&&"text"===o[e+1].type?o[e+1].content=o[e].content+o[e+1].content:(e!==r&&(o[r]=o[e]),r++);e!==r&&(o.length=r)}},function(t,e){"use strict";function r(t){var e,r,n=o[t];if(n)return n;for(n=o[t]=[],e=0;128>e;e++)r=String.fromCharCode(e),n.push(r);for(e=0;ee;e+=3)n=parseInt(t.slice(e+1,e+3),16),128>n?c+=o[n]:192===(224&n)&&r>e+3&&(i=parseInt(t.slice(e+4,e+6),16),128===(192&i))?(u=n<<6&1984|63&i,c+=128>u?"��":String.fromCharCode(u),e+=3):224===(240&n)&&r>e+6&&(i=parseInt(t.slice(e+4,e+6),16),s=parseInt(t.slice(e+7,e+9),16),128===(192&i)&&128===(192&s))?(u=n<<12&61440|i<<6&4032|63&s,c+=2048>u||u>=55296&&57343>=u?"���":String.fromCharCode(u),e+=6):240===(248&n)&&r>e+9&&(i=parseInt(t.slice(e+4,e+6),16),s=parseInt(t.slice(e+7,e+9),16),a=parseInt(t.slice(e+10,e+12),16),128===(192&i)&&128===(192&s)&&128===(192&a))?(u=n<<18&1835008|i<<12&258048|s<<6&4032|63&a,65536>u||u>1114111?c+="����":(u-=65536,c+=String.fromCharCode(55296+(u>>10),56320+(1023&u))),e+=9):c+="�";return c})}var o={};n.defaultChars=";/?:@&=+$,#",n.componentChars="",t.exports=n},function(t,e){"use strict";function r(t){var e,r,n=o[t];if(n)return n;for(n=o[t]=[],e=0;128>e;e++)r=String.fromCharCode(e),/^[0-9a-z]$/i.test(r)?n.push(r):n.push("%"+("0"+e.toString(16).toUpperCase()).slice(-2));for(e=0;ei;i++)if(a=t.charCodeAt(i),o&&37===a&&s>i+2&&/^[0-9a-f]{2}$/i.test(t.slice(i+1,i+3)))l+=t.slice(i,i+3),i+=2;else if(128>a)l+=c[a];else if(a>=55296&&57343>=a){if(a>=55296&&56319>=a&&s>i+1&&(u=t.charCodeAt(i+1),u>=56320&&57343>=u)){l+=encodeURIComponent(t[i]+t[i+1]),i++;continue}l+="%EF%BF%BD"}else l+=encodeURIComponent(t[i]);return l}var o={};n.defaultChars=";/?:@&=+$,-_.!~*'()#",n.componentChars="-_.!~*'()",t.exports=n},function(t,e){"use strict";t.exports=function(t){var e="";return e+=t.protocol||"",e+=t.slashes?"//":"",e+=t.auth?t.auth+"@":"",e+=t.hostname&&-1!==t.hostname.indexOf(":")?"["+t.hostname+"]":t.hostname||"",e+=t.port?":"+t.port:"",e+=t.pathname||"",e+=t.search||"",e+=t.hash||""}},function(t,e){"use strict";function r(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}function n(t,e){if(t&&t instanceof r)return t;var n=new r;return n.parse(t,e),n}var o=/^([a-z0-9.+-]+:)/i,i=/:[0-9]*$/,s=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,a=["<",">",'"',"`"," ","\r","\n"," "],u=["{","}","|","\\","^","`"].concat(a),c=["'"].concat(u),l=["%","/","?",";","#"].concat(c),p=["/","?","#"],f=255,h=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,g={javascript:!0,"javascript:":!0},m={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};r.prototype.parse=function(t,e){var r,n,i,a,u,c=t;if(c=c.trim(),!e&&1===t.split("#").length){var v=s.exec(c);if(v)return this.pathname=v[1],v[2]&&(this.search=v[2]),this}var _=o.exec(c);if(_&&(_=_[0],i=_.toLowerCase(),this.protocol=_,c=c.substr(_.length)),(e||_||c.match(/^\/\/[^@\/]+@[^@\/]+/))&&(u="//"===c.substr(0,2),!u||_&&g[_]||(c=c.substr(2),this.slashes=!0)),!g[_]&&(u||_&&!m[_])){var b=-1;for(r=0;ra)&&(b=a);var x,y;for(y=-1===b?c.lastIndexOf("@"):c.lastIndexOf("@",b),-1!==y&&(x=c.slice(0,y),c=c.slice(y+1),this.auth=x),b=-1,r=0;ra)&&(b=a);-1===b&&(b=c.length),":"===c[b-1]&&b--;var k=c.slice(0,b);c=c.slice(b),this.parseHost(k),this.hostname=this.hostname||"";var A="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!A){var w=this.hostname.split(/\./);for(r=0,n=w.length;n>r;r++){var C=w[r];if(C&&!C.match(h)){for(var E="",D=0,q=C.length;q>D;D++)E+=C.charCodeAt(D)>127?"x":C[D];if(!E.match(h)){var S=w.slice(0,r),F=w.slice(r+1),z=C.match(d);z&&(S.push(z[1]),F.unshift(z[2])),F.length&&(c=F.join(".")+c),this.hostname=S.join(".");break}}}}this.hostname.length>f&&(this.hostname=""),A&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}var j=c.indexOf("#");-1!==j&&(this.hash=c.substr(j),c=c.slice(0,j));var L=c.indexOf("?");return-1!==L&&(this.search=c.substr(L),c=c.slice(0,L)),c&&(this.pathname=c),m[i]&&this.hostname&&!this.pathname&&(this.pathname=""),this},r.prototype.parseHost=function(t){var e=i.exec(t);e&&(e=e[0],":"!==e&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)},t.exports=n},function(t,e,r){var n;(function(t,o){!function(i){function s(t){throw new RangeError(j[t])}function a(t,e){for(var r=t.length,n=[];r--;)n[r]=e(t[r]);return n}function u(t,e){var r=t.split("@"),n="";r.length>1&&(n=r[0]+"@",t=r[1]),t=t.replace(z,".");var o=t.split("."),i=a(o,e).join(".");return n+i}function c(t){for(var e,r,n=[],o=0,i=t.length;i>o;)e=t.charCodeAt(o++),e>=55296&&56319>=e&&i>o?(r=t.charCodeAt(o++),56320==(64512&r)?n.push(((1023&e)<<10)+(1023&r)+65536):(n.push(e),o--)):n.push(e);return n}function l(t){return a(t,function(t){var e="";return t>65535&&(t-=65536,e+=O(t>>>10&1023|55296),t=56320|1023&t),e+=O(t)}).join("")}function p(t){return 10>t-48?t-22:26>t-65?t-65:26>t-97?t-97:y}function f(t,e){return t+22+75*(26>t)-((0!=e)<<5)}function h(t,e,r){var n=0;for(t=r?T(t/C):t>>1,t+=T(t/e);t>L*A>>1;n+=y)t=T(t/L);return T(n+(L+1)*t/(t+w))}function d(t){var e,r,n,o,i,a,u,c,f,d,g=[],m=t.length,v=0,_=D,b=E;for(r=t.lastIndexOf(q),0>r&&(r=0),n=0;r>n;++n)t.charCodeAt(n)>=128&&s("not-basic"),g.push(t.charCodeAt(n));for(o=r>0?r+1:0;m>o;){for(i=v,a=1,u=y;o>=m&&s("invalid-input"),c=p(t.charCodeAt(o++)),(c>=y||c>T((x-v)/a))&&s("overflow"),v+=c*a,f=b>=u?k:u>=b+A?A:u-b,!(f>c);u+=y)d=y-f,a>T(x/d)&&s("overflow"),a*=d;e=g.length+1,b=h(v-i,e,0==i),T(v/e)>x-_&&s("overflow"),_+=T(v/e),v%=e,g.splice(v++,0,_)}return l(g)}function g(t){var e,r,n,o,i,a,u,l,p,d,g,m,v,_,b,w=[];for(t=c(t),m=t.length,e=D,r=0,i=E,a=0;m>a;++a)g=t[a],128>g&&w.push(O(g));for(n=o=w.length,o&&w.push(q);m>n;){for(u=x,a=0;m>a;++a)g=t[a],g>=e&&u>g&&(u=g);for(v=n+1,u-e>T((x-r)/v)&&s("overflow"),r+=(u-e)*v,e=u,a=0;m>a;++a)if(g=t[a],e>g&&++r>x&&s("overflow"),g==e){for(l=r,p=y;d=i>=p?k:p>=i+A?A:p-i,!(d>l);p+=y)b=l-d,_=y-d,w.push(O(f(d+b%_,0))),l=T(b/_);w.push(O(f(l,0))),i=h(r,v,n==o),r=0,++n}++r,++e}return w.join("")}function m(t){return u(t,function(t){return S.test(t)?d(t.slice(4).toLowerCase()):t})}function v(t){return u(t,function(t){return F.test(t)?"xn--"+g(t):t})}var _=("object"==typeof e&&e&&!e.nodeType&&e,"object"==typeof t&&t&&!t.nodeType&&t,"object"==typeof o&&o);(_.global===_||_.window===_||_.self===_)&&(i=_);var b,x=2147483647,y=36,k=1,A=26,w=38,C=700,E=72,D=128,q="-",S=/^xn--/,F=/[^\x20-\x7E]/,z=/[\x2E\u3002\uFF0E\uFF61]/g,j={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},L=y-k,T=Math.floor,O=String.fromCharCode;b={version:"1.3.2",ucs2:{decode:c,encode:l},decode:d,encode:g,toASCII:v,toUnicode:m},n=function(){return b}.call(e,r,e,t),!(void 0!==n&&(t.exports=n))}(this)}).call(e,r(57)(t),function(){return this}())},function(t,e){t.exports=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804\uDCBD|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/},function(t,e,r){t.exports.Any=r(56),t.exports.Cc=r(54),t.exports.Cf=r(195),t.exports.P=r(27),t.exports.Z=r(55)},function(e,r){e.exports=t}])}); -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "markdown-it-react-renderer", 3 | "version": "0.1.1", 4 | "description": "React renderer for Markdown-it", 5 | "main": "lib/index.js", 6 | "scripts": { 7 | "test": "NODE_ENV=test babel-node ./node_modules/.bin/isparta cover _mocha", 8 | "test:dev": "NODE_ENV=test mocha --compilers js:babel-core/register --watch", 9 | "codecov": "cat coverage/lcov.info | codecov", 10 | "dist": "NODE_ENV=production webpack -p", 11 | "build": "babel src --out-dir lib", 12 | "lint": "eslint .", 13 | "lint:fix": "npm run lint -- --fix", 14 | "prepublish": "npm run build && npm run dist", 15 | "preversion": "npm test", 16 | "version": "npm run build && npm run dist && git add -A .", 17 | "postversion": "git push && git push --tags", 18 | "release": "npmpub" 19 | }, 20 | "directories": { 21 | "example": "examples", 22 | "test": "test" 23 | }, 24 | "dependencies": { 25 | "lodash": "^4.2.1", 26 | "markdown-it": "^5.1.0" 27 | }, 28 | "devDependencies": { 29 | "babel-cli": "^6.4.5", 30 | "babel-core": "^6.4.5", 31 | "babel-eslint": "^5.0.0-beta10", 32 | "babel-loader": "^6.2.2", 33 | "babel-preset-es2015": "^6.3.13", 34 | "babel-preset-react": "^6.3.13", 35 | "babel-preset-stage-1": "^6.3.13", 36 | "chai": "^3.5.0", 37 | "codecov": "^1.0.1", 38 | "eslint": "^1.10.3", 39 | "eslint-config-standard": "^4.4.0", 40 | "eslint-config-standard-react": "^1.2.1", 41 | "eslint-plugin-react": "^4.0.0", 42 | "eslint-plugin-standard": "^1.3.1", 43 | "isparta": "^4.0.0", 44 | "json-loader": "^0.5.1", 45 | "markdown-it-abbr": "^1.0.0", 46 | "markdown-it-container": "^2.0.0", 47 | "markdown-it-deflist": "^2.0.0", 48 | "markdown-it-emoji": "^1.0.0", 49 | "markdown-it-footnote": "^2.0.0", 50 | "markdown-it-ins": "^2.0.0", 51 | "markdown-it-mark": "^2.0.0", 52 | "markdown-it-sub": "^1.0.0", 53 | "markdown-it-sup": "^1.0.0", 54 | "mocha": "^2.4.5", 55 | "npmpub": "^3.0.1", 56 | "react": "^0.14.7", 57 | "react-addons-update": "^0.14.7", 58 | "react-dom": "^0.14.7", 59 | "webpack": "^1.8.11" 60 | }, 61 | "peerDependencies": { 62 | "react": "^0.14.0" 63 | }, 64 | "repository": { 65 | "type": "git", 66 | "url": "https://github.com/thangngoc89/markdown-it-react-renderer" 67 | }, 68 | "keywords": [ 69 | "markdown", 70 | "react" 71 | ], 72 | "author": "Khoa Nguyen (http://khoanguyen.me/)", 73 | "license": "MIT", 74 | "bugs": { 75 | "url": "https://github.com/thangngoc89/markdown-it-react-renderer/issues" 76 | }, 77 | "homepage": "https://github.com/thangngoc89/markdown-it-react-renderer" 78 | } 79 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | import markdown from 'markdown-it' 4 | import React, { PropTypes } from 'react' 5 | import isPlainObject from 'lodash/isPlainObject' 6 | import assign from 'lodash/assign' 7 | import reduce from 'lodash/reduce' 8 | import sortBy from 'lodash/sortBy' 9 | import compact from 'lodash/compact' 10 | import camelCase from 'lodash/camelCase' 11 | import isString from 'lodash/isString' 12 | import fromPairs from 'lodash/fromPairs' 13 | import zipObject from 'lodash/zipObject' 14 | 15 | const DEFAULT_TAGS = { 16 | 'html': 'span' 17 | } 18 | 19 | const DEFAULT_RULES = { 20 | image (token, attrs, children) { 21 | if (children.length) { 22 | attrs = assign({}, attrs, { alt: children[0] }) 23 | } 24 | return [[token.tag, attrs]] 25 | }, 26 | 27 | codeInline (token, attrs) { 28 | return [compact([token.tag, attrs, token.content])] 29 | }, 30 | 31 | codeBlock (token, attrs) { 32 | return [['pre', compact([token.tag, attrs, token.content])]] 33 | }, 34 | 35 | fence (token, attrs) { 36 | if (token.info) { 37 | const langName = token.info.trim().split(/\s+/g)[0] 38 | attrs = assign({}, attrs, { 'data-language': langName }) 39 | } 40 | 41 | return [['pre', compact([token.tag, attrs, token.content])]] 42 | }, 43 | 44 | hardbreak () { 45 | return [['br']] 46 | }, 47 | 48 | softbreak (token, attrs, children, options) { 49 | return options.breaks ? [['br']] : '\n' 50 | }, 51 | 52 | text (token) { 53 | return token.content 54 | }, 55 | 56 | htmlBlock (token) { 57 | return token.content 58 | }, 59 | 60 | htmlInline (token) { 61 | return token.content 62 | }, 63 | 64 | inline (token, attrs, children) { 65 | return children 66 | }, 67 | 68 | default (token, attrs, children, options, getNext) { 69 | if (token.nesting === 1 && token.hidden) { 70 | return getNext() 71 | } 72 | /* plugin-related */ 73 | if (!token.tag) { 74 | return token.content 75 | } 76 | if (token.info) { 77 | attrs = assign({}, attrs, { 'data-info': token.info.trim() }) 78 | } 79 | /* plugin-related */ 80 | return [compact([token.tag, attrs].concat((token.nesting === 1) && getNext()))] 81 | } 82 | } 83 | 84 | function convertTree (tokens, convertRules, options) { 85 | function convertBranch (tkns, nested) { 86 | let branch = [] 87 | 88 | if (!nested) { 89 | branch.push('html') 90 | } 91 | 92 | function getNext () { 93 | return convertBranch(tkns, true) 94 | } 95 | 96 | let token = tkns.shift() 97 | while (token && token.nesting !== -1) { 98 | const attrs = token.attrs && fromPairs(sortBy(token.attrs)) 99 | const children = token.children && convertBranch(token.children.slice(), true) 100 | const rule = convertRules[camelCase(token.type)] || convertRules.default 101 | 102 | branch = branch.concat( 103 | rule(token, attrs, children, options, getNext) 104 | ) 105 | token = tkns.shift() 106 | } 107 | return branch 108 | } 109 | 110 | return convertBranch(tokens, false) 111 | } 112 | 113 | function mdReactFactory (options = {}) { 114 | const { 115 | onIterate, 116 | tags = DEFAULT_TAGS, 117 | presetName, markdownOptions, 118 | enableRules = [], 119 | disableRules = [], 120 | plugins = [], 121 | onGenerateKey = (tag, index) => `mdrct-${tag}-${index}`, 122 | ...rootElementProps 123 | } = options 124 | 125 | let md = markdown(markdownOptions || presetName) 126 | .enable(enableRules) 127 | .disable(disableRules) 128 | 129 | const convertRules = assign({}, DEFAULT_RULES, options.convertRules) 130 | 131 | md = reduce(plugins, (m, plugin) => 132 | plugin.plugin 133 | ? m.use(plugin.plugin, ...plugin.args) 134 | : m.use(plugin), 135 | md 136 | ) 137 | 138 | function renderChildren (tag) { 139 | const voidTags = ['img', 'hr', 'br'] 140 | return (voidTags.indexOf(tag) === -1) 141 | } 142 | 143 | function iterateTree (tree, level = 0, index = 0) { 144 | let tag = tree.shift() 145 | const key = onGenerateKey(tag, index) 146 | 147 | let props = (tree.length && isPlainObject(tree[0])) 148 | ? assign(tree.shift(), { key }) 149 | : { key } 150 | 151 | if (level === 0) { 152 | props = { ...props, ...rootElementProps } 153 | } 154 | 155 | const children = tree.map( 156 | (branch, idx) => Array.isArray(branch) 157 | ? iterateTree(branch, level + 1, idx) 158 | : branch 159 | ) 160 | 161 | tag = tags[tag] || tag 162 | 163 | if (isString(props.style)) { 164 | props.style = zipObject( 165 | props.style.split(';') 166 | .map(prop => prop.split(':')) 167 | .map(keyVal => [camelCase(keyVal[0].trim()), keyVal[1].trim()]) 168 | ) 169 | } 170 | 171 | return (typeof onIterate === 'function') 172 | ? onIterate(tag, props, children, level) 173 | : React.createElement( 174 | tag, 175 | props, 176 | renderChildren(tag) ? children : undefined 177 | ) 178 | } 179 | 180 | return function (text) { 181 | const tree = convertTree(md.parse(text, {}), convertRules, md.options) 182 | return iterateTree(tree) 183 | } 184 | } 185 | 186 | const MDReactComponent = (props) => { 187 | const { text, ...others } = props 188 | return mdReactFactory(others)(text) 189 | } 190 | 191 | MDReactComponent.propTypes = { 192 | text: PropTypes.string.isRequired, 193 | onIterate: PropTypes.func, 194 | onGenerateKey: PropTypes.func, 195 | tags: PropTypes.object, 196 | presetName: PropTypes.string, 197 | markdownOptions: PropTypes.object, 198 | enableRules: PropTypes.array, 199 | disableRules: PropTypes.array, 200 | convertRules: PropTypes.object, 201 | plugins: PropTypes.array, 202 | className: PropTypes.string 203 | } 204 | 205 | export default MDReactComponent 206 | export { mdReactFactory as mdReact } 207 | -------------------------------------------------------------------------------- /test/elements.spec.js: -------------------------------------------------------------------------------- 1 | import { assert } from 'chai' 2 | import { describe, it } from 'mocha' 3 | import render from './helpers/render' 4 | 5 | describe('Markdown tests', () => { 6 | it('should set root element class to value in className property', () => { 7 | assert.equal( 8 | render('some text', { className: 'test-class' }), 9 | '

some text

' 10 | ) 11 | }) 12 | 13 | it('should set root element inline style to styles provided in style property', () => { 14 | assert.equal( 15 | render('some text', { style: { color: 'red', fontSize: 20 } }), 16 | '

some text

' 17 | ) 18 | }) 19 | 20 | it('should not throw warning with void tags', () => { 21 | assert.equal( 22 | render('# Title\n---'), 23 | '

Title


' 24 | ) 25 | }) 26 | 27 | it('should work with headers', () => { 28 | assert.equal( 29 | render('# This is an

tag\n## This is an

tag\n###### This is an

tag'), 30 | '

This is an <h1> tag

This is an <h2> tag

This is an <h6> tag
' 31 | ) 32 | }) 33 | 34 | it('should work with emphasis', () => { 35 | assert.equal( 36 | render('*This text will be italic*\n_This will also be italic_\n\n**This text will be bold**\n__This will also be bold__\n\n*You **can** combine them*'), 37 | '

This text will be italic\nThis will also be italic

This text will be bold\nThis will also be bold

You can combine them

' 38 | ) 39 | }) 40 | 41 | it('should work with unordered lists', () => { 42 | assert.equal( 43 | render('* Item 1\n* Item 2\n * Item 2a\n * Item 2b'), 44 | '
  • Item 1
  • Item 2
    • Item 2a
    • Item 2b
' 45 | ) 46 | }) 47 | 48 | it('should work with ordered lists', () => { 49 | assert.equal( 50 | render('1. Item 1\n2. Item 2\n3. Item 3\n * Item 3a\n * Item 3b'), 51 | '
  1. Item 1
  2. Item 2
  3. Item 3
    • Item 3a
    • Item 3b
' 52 | ) 53 | }) 54 | 55 | it('should work with images', () => { 56 | assert.equal( 57 | render('![GitHub Logo](/images/logo.png)\nFormat: ![Alt Text](url)'), 58 | '

GitHub Logo\nFormat: Alt Text

' 59 | ) 60 | }) 61 | 62 | it('should work with links', () => { 63 | assert.equal( 64 | render('Here is [some link](http://some-url.com).'), 65 | '

Here is some link.

' 66 | ) 67 | }) 68 | 69 | it('should work with blockquotes', () => { 70 | assert.equal( 71 | render('As Kanye West said:\n\n> We\'re living the future so\n> the present is our past.'), 72 | '

As Kanye West said:

We're living the future so\nthe present is our past.

' 73 | ) 74 | }) 75 | 76 | it('should work with inline code', () => { 77 | assert.equal( 78 | render('I think you should use an `` element here instead.'), 79 | '

I think you should use an <addr> element here instead.

' 80 | ) 81 | }) 82 | 83 | it('should work with tables', () => { 84 | assert.equal( 85 | render('| Option | Description |\n| ------ | ----------- |\n| data | path to data files to supply the data that will be passed into templates. |\n| engine | engine to be used for processing templates. Handlebars is the default. |\n| ext | extension to be used for dest files. |\n'), 86 | '
OptionDescription
datapath to data files to supply the data that will be passed into templates.
engineengine to be used for processing templates. Handlebars is the default.
extextension to be used for dest files.
' 87 | ) 88 | }) 89 | 90 | it('should work with indented code', () => { 91 | assert.equal( 92 | render('Indented code\n\n // Some comments\n line 1 of code\n line 2 of code\n line 3 of code'), 93 | '

Indented code

// Some comments\nline 1 of code\nline 2 of code\nline 3 of code
' 94 | ) 95 | }) 96 | 97 | it('should work with block code', () => { 98 | assert.equal( 99 | render('Block code "fences"\n\n```\nSample text here...\n```\n'), 100 | '

Block code "fences"

Sample text here...\n
' 101 | ) 102 | }) 103 | 104 | it('should work with highlighted code', () => { 105 | assert.equal( 106 | render('Syntax highlighting\n\n``` js\nvar foo = function (bar) {\n return bar++;\n};\n\nconsole.log(foo(5));\n```'), 107 | '

Syntax highlighting

var foo = function (bar) {\n  return bar++;\n};\n\nconsole.log(foo(5));\n
' 108 | ) 109 | }) 110 | 111 | it('should work with enabled typographer', () => { 112 | assert.equal( 113 | render('## Typographic replacements\n\nEnable typographer option to see result.\n\n(c) (C) (r) (R) (tm) (TM) (p) (P) +-\n\ntest.. test... test..... test?..... test!....\n\n!!!!!! ???? ,, -- ---\n\n"Smartypants, double quotes" and \'single quotes\'', 114 | {markdownOptions: {typographer: true}}), 115 | '

Typographic replacements

Enable typographer option to see result.

© © ® ® ™ ™ § § ±

test… test… test… test?.. test!..

!!! ??? , – —

“Smartypants, double quotes” and ‘single quotes’

' 116 | ) 117 | }) 118 | 119 | it('should work with disabled typographer', () => { 120 | assert.equal( 121 | render('## Typographic replacements\n\nEnable typographer option to see result.\n\n(c) (C) (r) (R) (tm) (TM) (p) (P) +-\n\ntest.. test... test..... test?..... test!....\n\n!!!!!! ???? ,, -- ---\n\n"Smartypants, double quotes" and \'single quotes\'', 122 | {markdownOptions: {typographer: false}}), 123 | '

Typographic replacements

Enable typographer option to see result.

(c) (C) (r) (R) (tm) (TM) (p) (P) +-

test.. test... test..... test?..... test!....

!!!!!! ???? ,, -- ---

"Smartypants, double quotes" and 'single quotes'

' 124 | ) 125 | }) 126 | }) 127 | -------------------------------------------------------------------------------- /test/helpers/render.js: -------------------------------------------------------------------------------- 1 | import { mdReact } from '../../src/index' 2 | import { renderToStaticMarkup } from 'react-dom/server' 3 | 4 | const render = (text, options) => { 5 | return renderToStaticMarkup(mdReact(options)(text)) 6 | } 7 | 8 | export default render 9 | -------------------------------------------------------------------------------- /test/mocha.opts: -------------------------------------------------------------------------------- 1 | --reporter spec 2 | --recursive 3 | --timeout 3000 4 | -------------------------------------------------------------------------------- /test/plugins-offical.js: -------------------------------------------------------------------------------- 1 | import { assert } from 'chai' 2 | import { describe, it } from 'mocha' 3 | import render from './helpers/render' 4 | 5 | const plugins = { 6 | abbr: require('markdown-it-abbr'), 7 | container: require('markdown-it-container'), 8 | deflist: require('markdown-it-deflist'), 9 | emoji: require('markdown-it-emoji'), 10 | footnote: require('markdown-it-footnote'), 11 | ins: require('markdown-it-ins'), 12 | mark: require('markdown-it-mark'), 13 | sub: require('markdown-it-sub'), 14 | sup: require('markdown-it-sup') 15 | } 16 | 17 | describe('Markdown plugins official', () => { 18 | it('should work with emoji', () => { 19 | assert.equal( 20 | render(':) 8-)', 21 | {plugins: [plugins.emoji]}), 22 | '

😃 😎

' 23 | ) 24 | }) 25 | 26 | it('should work with container', () => { 27 | assert.equal( 28 | render('::: warning\n*here be dragons*\n:::', 29 | {plugins: [{plugin: plugins.container, args: ['warning']}]}), 30 | '

here be dragons

' 31 | ) 32 | }) 33 | 34 | /* TODO: footnote and other plugins */ 35 | }) 36 | -------------------------------------------------------------------------------- /test/react-options.spec.js: -------------------------------------------------------------------------------- 1 | import { assert } from 'chai' 2 | import { describe, it } from 'mocha' 3 | import React from 'react' 4 | import update from 'react-addons-update' 5 | import render from './helpers/render' 6 | 7 | function linkCallback (tag, props, children) { 8 | if (tag === 'a') { 9 | props = update(props, { 10 | className: { $set: 'link-class' }, 11 | href: { $apply: h => h.replace('SOME_URL', 'http://real-url.com') } 12 | }) 13 | } 14 | return React.createElement(tag, props, children) 15 | } 16 | 17 | function firstLevelCallback (tag, props, children, level) { 18 | if (level === 1) { 19 | props = update(props, { 20 | className: { $set: 'first-level-class' } 21 | }) 22 | } 23 | 24 | return React.createElement(tag, props, children) 25 | } 26 | 27 | // Markdown-React 28 | 29 | describe('Markdown-React options tests', () => { 30 | it('should render tags with custom props', () => { 31 | assert.equal( 32 | render('Here is [some link with class](SOME_URL).', { onIterate: linkCallback }), 33 | '

Here is some link with class.

' 34 | ) 35 | }) 36 | 37 | it('should distinct tags depending on level', () => { 38 | assert.equal( 39 | render('This node has custom class, **but not this node**.', { onIterate: firstLevelCallback }), 40 | '

This node has custom class, but not this node.

' 41 | ) 42 | }) 43 | 44 | it('should replace tags', () => { 45 | assert.equal( 46 | render('This text uses **“i” and “b” tags** instead of *“em” and “strong” tags*.', {tags: { 'html': 'span', 'em': 'i', 'strong': 'b' }}), 47 | '

This text uses “i” and “b” tags instead of “em” and “strong” tags.

' 48 | ) 49 | }) 50 | }) 51 | -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | var webpack = require('webpack') 2 | 3 | module.exports = { 4 | entry: './src/index', 5 | module: { 6 | loaders: [ 7 | { test: /\.json$/, loader: 'json' }, 8 | { test: /\.js$/, loader: 'babel', exclude: /node_modules/ } 9 | ] 10 | }, 11 | output: { 12 | filename: 'dist/markdown-react.min.js', 13 | libraryTarget: 'umd', 14 | library: 'MarkdownReact' 15 | }, 16 | plugins: [ 17 | new webpack.optimize.OccurenceOrderPlugin(), 18 | new webpack.DefinePlugin({ 19 | 'process.env': { 20 | 'NODE_ENV': JSON.stringify('production') 21 | } 22 | }), 23 | new webpack.optimize.UglifyJsPlugin({ 24 | compressor: { 25 | warnings: false 26 | } 27 | }) 28 | ], 29 | externals: { 30 | react: 'React' 31 | } 32 | } 33 | --------------------------------------------------------------------------------