├── .jshintignore ├── .gitignore ├── .travis.yml ├── .editorconfig ├── test ├── fixtures │ ├── code-snippets.md │ ├── code-snippets.html │ ├── email-example.md │ ├── email-example.html │ ├── barkup.md │ ├── barkup.html │ ├── woofmark-sample.md │ ├── woofmark-sample.html │ ├── cross-tab-communication.md │ ├── cross-tab-communication.html │ ├── stop-breaking-the-web.md │ └── stop-breaking-the-web.html └── megamark.js ├── bower.json ├── .jshintrc ├── LICENSE ├── megamark.js ├── package.json ├── changelog.markdown ├── tokenizeLinks.js ├── readme.markdown ├── markdown.js └── dist └── megamark.min.js /.jshintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.sublime-* 3 | node_modules 4 | npm-debug.log -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - '4' 4 | - '5' 5 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | 12 | [*.md] 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /test/fixtures/code-snippets.md: -------------------------------------------------------------------------------- 1 | ```js 2 | var a = 'foo'; 3 | ``` 4 | 5 | then `some` inline code. 6 | 7 | and a snippet without language 8 | 9 | ``` 10 | var a = 'bar'; 11 | ``` 12 | 13 | lastly one without fences 14 | 15 | var foo = 'bar'; 16 | 17 | haha. nice 18 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "megamark", 3 | "version": "3.2.4", 4 | "description": "Markdown with easy tokenization, a fast highlighter, and a lean HTML sanitizer", 5 | "homepage": "https://github.com/bevacqua/megamark", 6 | "main": "dist/megamark.js", 7 | "authors": [ 8 | "Nicolas Bevacqua " 9 | ], 10 | "license": "MIT" 11 | } 12 | -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "curly": true, 3 | "eqeqeq": true, 4 | "newcap": true, 5 | "noarg": true, 6 | "sub": true, 7 | "undef": true, 8 | "boss": true, 9 | "eqnull": true, 10 | "strict": true, 11 | "node": true, 12 | "immed": true, 13 | "validthis": true, 14 | "globals": { 15 | "jasmine": false, 16 | "describe": false, 17 | "xdescribe": false, 18 | "it": false, 19 | "xit": false, 20 | "expect": false, 21 | "beforeEach": false, 22 | "spyOn": false 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /test/fixtures/code-snippets.html: -------------------------------------------------------------------------------- 1 |
var a = 'foo';
 2 | 
3 |

then some inline code.

4 |

and a snippet without language

5 |
var a = 'bar';
 6 | 
7 |

lastly one without fences

8 |
var foo = 'bar';
 9 | 
10 |

haha. nice

11 | -------------------------------------------------------------------------------- /test/fixtures/email-example.md: -------------------------------------------------------------------------------- 1 | Hey there, I just wanted to let you know there's a special offer on my book today, _it's **half off**_. 2 | 3 | Get half off my **JavaScript Application Design** book today! Enter code **dotd072115au** at [bevacqua.io/bf/book][1] when checking out. If you run into any issues, let me know. 4 | 5 | Alright, back to writing about modules! *psst, don't tell anyone!* 6 | 7 | Oh, now you can reply to any emails sent from this account. That means this very email but also the ones when I publish an article or a someone submits a comment. I'll be reading the replies. So any feedback you want to send, that's another way to do that. 8 | 9 | Thanks, 10 | Nico 11 | 12 | [1]: /author/compose 13 | -------------------------------------------------------------------------------- /test/fixtures/email-example.html: -------------------------------------------------------------------------------- 1 |

Hey there, I just wanted to let you know there’s a special offer on my book today, it’s half off.

2 |

Get half off my JavaScript Application Design book today! Enter code dotd072115au at bevacqua.io/bf/book when checking out. If you run into any issues, let me know.

3 |

Alright, back to writing about modules! psst, don’t tell anyone!

4 |

Oh, now you can reply to any emails sent from this account. That means this very email but also the ones when I publish an article or a someone submits a comment. I’ll be reading the replies. So any feedback you want to send, that’s another way to do that.

5 |

Thanks, 6 | Nico

7 | -------------------------------------------------------------------------------- /test/fixtures/barkup.md: -------------------------------------------------------------------------------- 1 | # Markdown? 2 | 3 | Here's a teensie bit of [Markdown][1] to get you started. 4 | 5 | Markdown lets you produce **rich** HTML-formatted text by writing _plain text_. You can write `code`, text in _italics_ or give them **a "bolder" format**. You can create headings by prefixing them with one or more hash characters _(#)_. The less hashes they have, the more prominent your headings become. 6 | 7 | Creating links is merely a matter of [wrapping some text in brackets][2] and referencing a resource locator, like the ones you'll find at the bottom of this text. Images can be embedded just the same, except you'll have to prefix the wrapped text with an exclamation point. 8 | 9 | > Click on the HTML button to see this text come to life as HTML, the markup language of the web. 10 | > 11 | > -- Nico 12 | 13 | [1]: http://daringfireball.net/projects/markdown/ "Original introduction to Markdown" 14 | [2]: http://stompflow.com 15 | -------------------------------------------------------------------------------- /test/fixtures/barkup.html: -------------------------------------------------------------------------------- 1 |

Markdown?

2 |

Here’s a teensie bit of Markdown to get you started.

3 |

Markdown lets you produce rich HTML-formatted text by writing plain text. You can write code, text in italics or give them a “bolder” format. You can create headings by prefixing them with one or more hash characters (#). The less hashes they have, the more prominent your headings become.

4 |

Creating links is merely a matter of wrapping some text in brackets and referencing a resource locator, like the ones you’ll find at the bottom of this text. Images can be embedded just the same, except you’ll have to prefix the wrapped text with an exclamation point.

5 |
6 |

Click on the HTML button to see this text come to life as HTML, the markup language of the web.

7 |

– Nico

8 |
9 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright © 2015 Nicolas Bevacqua 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | 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, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /megamark.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var insane = require('insane'); 4 | var assign = require('assignment'); 5 | var markdown = require('./markdown'); 6 | var hightokens = require('highlight.js-tokens').map(codeclass); 7 | 8 | function codeclass (token) { 9 | return 'md-code-' + token; 10 | } 11 | 12 | function sanitize (html, o) { 13 | var headings = { h1: 'id', h2: 'id', h3: 'id', h4: 'id', h5: 'id', h6: 'id' }; 14 | var options = assign({ allowedClasses: {}, allowedAttributes: headings }, o); 15 | var ac = options.allowedClasses; 16 | 17 | add('mark', ['md-mark', 'md-code-mark']); 18 | add('pre', ['md-code-block']); 19 | add('code', markdown.languages); 20 | add('span', hightokens); 21 | 22 | return insane(html, options); 23 | 24 | function add (type, more) { 25 | ac[type] = (ac[type] || []).concat(more); 26 | } 27 | } 28 | 29 | function megamark (md, options) { 30 | var o = options || {}; 31 | var html = markdown(md, o); 32 | var sane = sanitize(html, o.sanitizer); 33 | return sane; 34 | } 35 | 36 | markdown.languages.push('md-code', 'md-code-inline'); // only sanitizing purposes 37 | megamark.parser = markdown.parser; 38 | module.exports = megamark; 39 | -------------------------------------------------------------------------------- /test/fixtures/woofmark-sample.md: -------------------------------------------------------------------------------- 1 | # Markdown? 2 | 3 | Here's a teensie bit of [Markdown](http://daringfireball.net/projects/markdown\)/ "Original introduction )to Markdown") to get you started. 4 | 5 | Markdown lets you produce **rich** HTML-formatted text by writing _plain text_. You can write `code`, text in _italics_ or give them **a "bolder" format**. You can create headings by prefixing them with one or more hash characters _(#)_. The _less hashes_ they have, the _more prominent_ your headings become. 6 | 7 | Creating **links** is merely a matter of [wrapping some text in brackets][2] and referencing a resource locator, like the ones you'll find at the bottom of this text. Images can be embedded just the same, except you'll have to prefix the wrapped text with _an exclamation mark_. 8 | 9 | > Click on the HTML button to see this text come to life as HTML, the markup language of the web. 10 | > 11 | > -- Nico 12 | 13 | Note that, 14 | 15 | ```javascript 16 | var markTags = 'still work'; 17 | var within = true; 18 | 19 | function code (here, are, some, args) { 20 | // do wonderful things! 21 | return here * are - some + args; 22 | } 23 | ``` 24 | 25 | [1]: http://daringfireball.net/projects/markdown/ "Original introduction to Markdown" 26 | [2]: http://ponyfoo.com 27 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "megamark", 3 | "description": "Markdown with easy tokenization, a fast highlighter, and a lean HTML sanitizer", 4 | "homepage": "https://github.com/bevacqua/megamark", 5 | "author": { 6 | "name": "Nicolas Bevacqua", 7 | "email": "nicolasbevacqua@gmail.com", 8 | "url": "http://ponyfoo.com" 9 | }, 10 | "version": "3.3.0", 11 | "repository": { 12 | "type": "git", 13 | "url": "git://github.com/bevacqua/megamark.git" 14 | }, 15 | "bugs": { 16 | "url": "https://github.com/bevacqua/megamark/issues" 17 | }, 18 | "scripts": { 19 | "build": "jshint . && browserify -s megamark -do dist/megamark.js megamark.js && uglifyjs -m -c -o dist/megamark.min.js dist/megamark.js", 20 | "deployment": "git add dist && npm version ${BUMP:-\"patch\"} --no-git-tag-version && git add package.json && git commit -m \"Autogenerated pre-deployment commit\" && bower version ${BUMP:-\"patch\"} && git reset HEAD~2 && git add . && git commit -am \"Release $(cat package.json | jq -r .version)\" && git push --tags && npm publish && git push", 21 | "deploy": "npm run build && npm run deployment", 22 | "test": "tape test/**/*.js" 23 | }, 24 | "main": "./megamark", 25 | "browser": { 26 | "highlight.js": "highlight-redux" 27 | }, 28 | "dependencies": { 29 | "assignment": "2.1.0", 30 | "highlight-redux": "1.0.1", 31 | "highlight.js": "8.4.0", 32 | "highlight.js-tokens": "1.0.0", 33 | "insane": "2.6.0", 34 | "linkify-it": "0.1.2", 35 | "markdown-it": "5.1.0", 36 | "sluggish": "1.0.1" 37 | }, 38 | "devDependencies": { 39 | "browserify": "10.2.6", 40 | "jshint": "2.8.0", 41 | "tape": "3.5.0", 42 | "uglify-js": "2.4.23" 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /test/fixtures/woofmark-sample.html: -------------------------------------------------------------------------------- 1 |

Markdown?

2 |

Here’s a teensie bit of Markdown[START] to get you started.

3 |

Markdown lets you [END]produce rich HTML-formatted text by writing plain text. You can write code, text in italics or give them a “bolder” format. You can create headings by prefixing them with one or more hash characters (#). The less hashes they have, the more prominent your headings become.

4 |

Creating links is merely a matter of wrapping some text in brackets and referencing a resource locator, like the ones you’ll find at the bottom of this text. Images can be embedded just the same, except you’ll have to prefix the wrapped text with an exclamation mark.

5 |
6 |

Click on the HTML button to see this text come to life as HTML, the markup language of the web.

7 |

– Nico

8 |
9 |

Note that,

10 |
var markTags = 'still work';
11 | var within = true;
12 | 
13 | function code (here, are, some, args) {
14 |   // do wonderful things!
15 |   return here * are - some + args;
16 | }
17 | 
18 | -------------------------------------------------------------------------------- /changelog.markdown: -------------------------------------------------------------------------------- 1 | # 3.2.4 Cyrillic 2 | 3 | - Added `sh`, `shell` and `zsh` aliases for `bash` language 4 | 5 | # 3.2.2 Mark Zuckerberg 6 | 7 | - Fixed a number of issues with `markers` option, added tons of tests 8 | 9 | # 3.2.1 Mark Twain 10 | 11 | - Introduced for `markers` option, that can help preserve selection across parsing 12 | 13 | # 3.1.0 Sluggish 14 | 15 | - Allows `id` attribute on any headings 16 | - Adds an `id` to all headings 17 | 18 | # 3.0.7 Insane Asylum 19 | 20 | - Updated `insane@2.4.3` 21 | 22 | # 3.0.6 Princess Zelda 23 | 24 | - Fixed a bug where links would break a paragraph beyond repair 25 | 26 | # 3.0.4 Murky 27 | 28 | - Upgraded `markdown-it` to `4.4.0` 29 | 30 | # 3.0.1 Mark 31 | 32 | - `` elements can be used to highlight code, text 33 | - Updated `insane@2.4.2` 34 | - Upgraded `markdown-it` to `4.3.1` 35 | 36 | # 2.1.7 Sanity Vanity 37 | 38 | - Updated `insane@2.4.0` 39 | 40 | # 2.1.5 Sanity Squatter 41 | 42 | - Fixed a bug where you couldn't customize the allowed ``, ``, and `
` class names on the sanitizer level
43 | - Updated `insane@2.2.0`
44 | 
45 | # 2.1.4 Tie Down
46 | 
47 | - Updated `assignment` to play nice with IE < 9
48 | 
49 | # 2.1.3 Bow Tie
50 | 
51 | - Added to Bower registry
52 | 
53 | # 2.1.2 Mega Consistent
54 | 
55 | - Freezing `markdown-it@3.0.7` for the time being
56 | 
57 | # 2.1.0 Linked Data
58 | 
59 | - Introduced `linkifiers` as another easy tokenizer option
60 | 
61 | # 2.0.0 Token Nation
62 | 
63 | - Simplified tokenization process
64 | 
65 | # 1.3.0 Insane Asylum
66 | 
67 | - Removed unused `marked` dependency
68 | 
69 | # 1.2.2 Insanity
70 | 
71 | - Updated `insane` to `2.1.1`
72 | 
73 | # 1.2.1 Assignments
74 | 
75 | - Moved `assign()` into `assignment` npm module
76 | 
77 | # 1.2.0 Lexingtown
78 | 
79 | - Replaced `marked` with `markdown-it`, improvements in compliance, parser speed, and code structure
80 | - Exposed `markdown-it` parser instance for extensibility
81 | 
82 | # 1.1.0 IPO
83 | 
84 | - Initial Public Release
85 | 


--------------------------------------------------------------------------------
/tokenizeLinks.js:
--------------------------------------------------------------------------------
  1 | 'use strict';
  2 | 
  3 | function arrayReplaceAt (a, i, middle) {
  4 |   var left = a.slice(0, i);
  5 |   var right = a.slice(i + 1);
  6 |   return left.concat(middle, right);
  7 | }
  8 | 
  9 | function isLinkOpen (str) {
 10 |   return /^\s]/i.test(str);
 11 | }
 12 | 
 13 | function isLinkClose (str) {
 14 |   return /^<\/a\s*>/i.test(str);
 15 | }
 16 | 
 17 | // the majority of the code below was taken from markdown-it's linkify method
 18 | // https://github.com/markdown-it/markdown-it/blob/7075e8881f4f717e2f2932ea156bb8aff649c89d/lib/rules_core/linkify.js
 19 | 
 20 | function tokenizeLinks (state, context) {
 21 |   var i, j, l, tokens, token, currentToken, nodes, ln, text, pos, lastPos,
 22 |       level, htmlLinkLevel, url, fullUrl, urlText,
 23 |       blockTokens = state.tokens,
 24 |       links;
 25 | 
 26 |   if (!state.md.options.linkify) { return; }
 27 | 
 28 |   for (j = 0, l = blockTokens.length; j < l; j++) {
 29 |     if (blockTokens[j].type !== 'inline' ||
 30 |         !state.md.linkify.pretest(blockTokens[j].content)) {
 31 |       continue;
 32 |     }
 33 | 
 34 |     tokens = blockTokens[j].children;
 35 | 
 36 |     htmlLinkLevel = 0;
 37 | 
 38 |     // We scan from the end, to keep position when new tags added.
 39 |     // Use reversed logic in links start/end match
 40 |     for (i = tokens.length - 1; i >= 0; i--) {
 41 |       currentToken = tokens[i];
 42 | 
 43 |       // Skip content of markdown links
 44 |       if (currentToken.type === 'link_close') {
 45 |         i--;
 46 |         while (tokens[i].level !== currentToken.level && tokens[i].type !== 'link_open') {
 47 |           i--;
 48 |         }
 49 |         continue;
 50 |       }
 51 | 
 52 |       // Skip content of html tag links
 53 |       if (currentToken.type === 'html_inline') {
 54 |         if (isLinkOpen(currentToken.content) && htmlLinkLevel > 0) {
 55 |           htmlLinkLevel--;
 56 |         }
 57 |         if (isLinkClose(currentToken.content)) {
 58 |           htmlLinkLevel++;
 59 |         }
 60 |       }
 61 |       if (htmlLinkLevel > 0) { continue; }
 62 | 
 63 |       if (currentToken.type === 'text' && state.md.linkify.test(currentToken.content)) {
 64 | 
 65 |         text = currentToken.content;
 66 |         links = state.md.linkify.match(text);
 67 | 
 68 |         // Now split string to nodes
 69 |         nodes = [];
 70 |         level = currentToken.level;
 71 |         lastPos = 0;
 72 | 
 73 |         for (ln = 0; ln < links.length; ln++) {
 74 | 
 75 |           url = links[ln].url;
 76 |           fullUrl = state.md.normalizeLink(url);
 77 |           if (!state.md.validateLink(fullUrl)) { continue; }
 78 | 
 79 |           urlText = links[ln].text;
 80 | 
 81 |           // Linkifier might send raw hostnames like "example.com", where url
 82 |           // starts with domain name. So we prepend http:// in those cases,
 83 |           // and remove it afterwards.
 84 |           //
 85 |           if (!links[ln].schema) {
 86 |             urlText = state.md.normalizeLinkText('http://' + urlText).replace(/^http:\/\//, '');
 87 |           } else if (links[ln].schema === 'mailto:' && !/^mailto:/i.test(urlText)) {
 88 |             urlText = state.md.normalizeLinkText('mailto:' + urlText).replace(/^mailto:/, '');
 89 |           } else {
 90 |             urlText = state.md.normalizeLinkText(urlText);
 91 |           }
 92 | 
 93 |           pos = links[ln].index;
 94 | 
 95 |           if (pos > lastPos) {
 96 |             token         = new state.Token('text', '', 0);
 97 |             token.content = text.slice(lastPos, pos);
 98 |             token.level   = level;
 99 |             nodes.push(token);
100 |           }
101 | 
102 |           //// 
103 |           html = null;
104 |           context.linkifiers.some(runUserLinkifier);
105 | 
106 |           if (typeof html === 'string') {
107 |             nodes.push({
108 |               type: 'html_block',
109 |               content: html,
110 |               level: level
111 |             });
112 |           } else {
113 |           //// 
114 | 
115 |             token         = new state.Token('link_open', 'a', 1);
116 |             token.attrs   = [ [ 'href', fullUrl ] ];
117 |             token.level   = level++;
118 |             token.markup  = 'linkify';
119 |             token.info    = 'auto';
120 |             nodes.push(token);
121 | 
122 |             token         = new state.Token('text', '', 0);
123 |             token.content = urlText;
124 |             token.level   = level;
125 |             nodes.push(token);
126 | 
127 |             token         = new state.Token('link_close', 'a', -1);
128 |             token.level   = --level;
129 |             token.markup  = 'linkify';
130 |             token.info    = 'auto';
131 |             nodes.push(token);
132 | 
133 |           //// 
134 |           }
135 |           //// 
136 | 
137 |           lastPos = links[ln].lastIndex;
138 |         }
139 | 
140 |         if (lastPos < text.length) {
141 |           token         = new state.Token('text', '', 0);
142 |           token.content = text.slice(lastPos);
143 |           token.level   = level;
144 |           nodes.push(token);
145 |         }
146 | 
147 |         // replace current node
148 |         blockTokens[j].children = tokens = arrayReplaceAt(tokens, i, nodes);
149 |       }
150 |     }
151 |   }
152 | 
153 |   //// 
154 |   var html;
155 | 
156 |   function runUserLinkifier (linkifier) {
157 |     html = linkifier(links[ln].url, links[ln].text);
158 |     return typeof html === 'string';
159 |   }
160 |   //// 
161 | }
162 | 
163 | module.exports = tokenizeLinks;
164 | 


--------------------------------------------------------------------------------
/test/fixtures/cross-tab-communication.md:
--------------------------------------------------------------------------------
 1 | # Cross-tab Communication
 2 | 
 3 | The upcoming [SharedWorker][1] API allows to transmit data across iframes and even browser tabs or windows. It landed in Chrome years ago, and not so long ago in Firefox, but it's [nowhere to be seen][2] in IE or Safari. A wildly supported alternative exists that can be used today, but it's largely unknown. Let's explore it!
 4 | 
 5 | I wanted an elegant solution to the following scenario: suppose a human walks into your website, logs in, **opens a second tab**, and logs out in that tab. He's still _"logged in"_ on the first tab, except anything he touches will either redirect them to the login page or straight blow up in their face. A more inviting alternative would be to figure out that they're logged out and do something about it, such as display a dialog asking them to re-authenticate, or maybe the login view itself.
 6 | 
 7 | You could use the WebSocket API for this, but that'd be overkill. I wanted a lower-level technology flyswatter, so I started looking for cross-tab communication options. The first option that popped up was using cookies or `localStorage`, and then periodically checking whether they were logged in or not via `setInterval`. I wasn't satisfied with that answer because it would waste too many CPU cycles checking for something that might not ever come up. At that point I would've rather used a _["comet"][3] (also known as long-polling)_, Server-Sent Events, or WebSockets.
 8 | 
 9 | I was surprised to see that the answer was lying in front of my nose, it was `localStorage` all along!
10 | 
11 | Did you know that `localStorage` fires an event? More specifically, it fires an event whenever an item is added, modified, or removed _in another browsing context_. Effectively, this means that whenever you touch `localStorage` in any given tab, all other tabs can learn about it by listening for the `storage` event on the `window` object, like so:
12 | 
13 | ```
14 | window.addEventListener('storage', function (event) {
15 |   console.log(event.key, event.newValue);
16 | });
17 | ```
18 | 
19 | The `event` object contains a few relevant properties.
20 | 
21 | Property   | Description
22 | -----------|---------------------
23 | `key`      | The affected key in `localStorage`
24 | `newValue` | The value that is currently assigned to that key
25 | `oldValue` | The value before modification
26 | `url`      | The URL of the page where the change occurred
27 | 
28 | Whenever a tab modifies something in `localStorage`, an event fires in every other tab. This means we're able to _communicate across browser tabs_ simply by setting values on `localStorage`. Consider the following pseudo_ish_-code example:
29 | 
30 | ```js
31 | var loggedOn;
32 | 
33 | // TODO: call when logged-in user changes or logs out
34 | logonChanged();
35 | 
36 | window.addEventListener('storage', updateLogon);
37 | window.addEventListener('focus', checkLogon);
38 | 
39 | function getUsernameOrNull () {
40 |   // TODO: return whether the user is logged on
41 | }
42 | 
43 | function logonChanged () {
44 |   var uname = getUsernameOrNull();
45 |   loggedOn = uname;
46 |   localStorage.setItem('logged-on', uname);
47 | }
48 | 
49 | function updateLogon (event) {
50 |   if (event.key === 'logged-on') {
51 |     loggedOn = event.newValue;
52 |   }
53 | }
54 | 
55 | function checkLogon () {
56 |   var uname = getUsernameOrNull();
57 |   if (uname !== loggedOn) {
58 |     location.reload();
59 |   }
60 | }
61 | ```
62 | 
63 | The basic idea is that when a user has two open tabs, logs out from one of them, and goes back to the other tab, the page is reloaded and _(hopefully)_ the server-side logic redirects them to somewhere else. The check is being done only when the tab is focused as a nod to the fact that maybe they log out and they log back in immediately, and in those cases we wouldn't want to log them out of every other tab.
64 | 
65 | We could certainly improve that piece of code, but it serves its purpose pretty well.  A better implementation would probably ask them to log in on the spot, but note that this also works the other way around: when they log in and go to another tab that was also logged out, the snippet detects that change reloading the page, and then the server would redirect them to the logged-in fountain-of-youth blessing of an experience you call your website _(again, hopefully)_.
66 | 
67 | # A simpler API
68 | 
69 | The `localStorage` API is arguably one of the easiest to use APIs there are, when it comes to web browsers, and it also enjoys quite thorough cross-browser support. There are, however, some quirks such as incognito Safari throwing on sets with a `QuotaExceededError`, no support for JSON out the box, or older browsers bumming you out.
70 | 
71 | For those reasons, I put together [local-storage][4] which is a module that provides a simplified API to `localStorage`, gets rid of those quirks, falls back to an in-memory store when the `localStorage` API is missing, and also makes it easier to consume `storage` events, by letting you register and unregister listeners for specific keys.
72 | 
73 | API endpoints in `local-storage@1.3.1` _(**latest**, at the time of this writing)_ are listed below.
74 | 
75 | - `ls(key, value?)` gets or sets `key`
76 | - `ls.get(key)` gets the value in `key`
77 | - `ls.set(key, value)` sets `key` to `value`
78 | - `ls.remove(key)` removes `key`
79 | - `ls.on(key, fn(value, old, url))` listens for changes to `key` in other tabs, triggers `fn`
80 | - `ls.off(key, fn)` unregisters listener previously added with `ls.on`
81 | 
82 | It's also worth mentioning that [local-storage][4] registers a single `storage` event handler and keeps track of every key you want to observe, rather than register multiple `storage` events.
83 | 
84 | I'd be interested to learn about other use cases for low-tech communication across tabs! Certainly sounds useful for _offline-first_ development, particularly if we keep in mind that `SharedWorker` might take a while to become widely supported, and WebSockets are unreliable in offline-first scenarios.
85 | 
86 | [1]: https://developer.mozilla.org/en-US/docs/Web/API/SharedWorker "SharedWorker Web API on MDN"
87 | [2]: http://caniuse.com/#feat=sharedworkers "Can I Use SharedWorkers?"
88 | [3]: http://stackoverflow.com/a/12855533/389745 "What are Long-Polling, Websockets, Server-Sent Events (SSE) and Comet?"
89 | [4]: https://github.com/bevacqua/local-storage "bevacqua/local-storage on GitHub"
90 | 


--------------------------------------------------------------------------------
/readme.markdown:
--------------------------------------------------------------------------------
  1 | # megamark
  2 | 
  3 | > [markdown-it][1] with easy tokenization, a fast highlighter, and a lean HTML sanitizer
  4 | 
  5 | Megamark is [markdown-it][1] plus a few reasonable factory defaults.
  6 | 
  7 | - Markdown parsing via [markdown-it][1]
  8 | - HTML is sanitized via [insane][2], and _that's configurable_
  9 | - Code is highlighted with [highlight.js][3] _(on a [diet in the client-side][4]!)_
 10 | - Tokenization made easy: **turn those `@` mentions into links in no-time!**
 11 | - Text gets prettified just like you're used to from [marked's `smartypants`][5]
 12 | - You can highlight interesting content using `` tags, _even inside code blocks_
 13 | - Headings get unique `id`, helping you implement navigation in your Markdown documents
 14 | - Still manages to produce a small footprint
 15 | 
 16 | # Install
 17 | 
 18 | ```shell
 19 | npm install megamark --save
 20 | ```
 21 | 
 22 | ```shell
 23 | bower install megamark --save
 24 | ```
 25 | 
 26 | # `megamark(markdown, options?)`
 27 | 
 28 | The `markdown` input will be parsed via `markdown-it`. Megamark configures `markdown-it` for syntax highlighting, prefixing classes with `md-`. Output is sanitized via [insane][2], and you can configure the whitelisting process too.
 29 | 
 30 | ### `options.tokenizers`
 31 | 
 32 | Tokenizers can help you transform bits of text like `@bevacqua` into links. This is often a very useful feature for your users, but hardly ever implemented by developers because how convoluted it is. With `megamark`, it becomes a pretty easy thing to do.
 33 | 
 34 | ```js
 35 | megamark('Who is this @bevacqua person?', {
 36 |   tokenizers: [{
 37 |     token: /(^|\s)@([A-z]+)\b/g,
 38 |     transform: function (all, separator, username) {
 39 |       return separator + '' + all + '';
 40 |     }
 41 |   }]
 42 | });
 43 | // <- '

Who is this @bevacqua person?

\n' 44 | ``` 45 | 46 | The `transform` method will get all of the arguments of `text.match(token)`, so the first argument will be `text`, followed by any capturing groups. In our case, the `/(^|\s)@([A-z]+)\b/` can be decomposed as follows. 47 | 48 | - First off we have `(?:^|\s)` 49 | - The parenthesis delimit a capturing group 50 | - It'll be passed to transform as the second argument 51 | - `^|\s` means that we are looking to match either the start of input or a space character 52 | - We can't use `\b` instead of this expression because `@` is not a word character 53 | - Then there's the `@` literal 54 | - Another capturing group, `([A-z]+)` 55 | - It'll be passed to transform as the third argument 56 | - Matches one or more alphabet characters 57 | - Finally, `\b` means that we want to match everything up to a word boundary 58 | 59 | You can use any regular expression you want, but make sure to use the `g` modifier if you want to match multiples of any given token. 60 | 61 | ### `options.linkifiers` 62 | 63 | Linkifiers are a simpler kind of tokenizer, but they're also more limited. Instead of asking you for a token expression, linkifiers will run on every single user-provided link _(that's in plain text, such as `ponyfoo.com`, note that actual links such as `[ponyfoo](http://ponyfoo.com)` won't be affected by this)_. If an HTML string is returned from your linkifier, then that'll be used. If none of your linkifiers return an HTML string, then the original functionality of converting the link text into an HTML link will be used. 64 | 65 | Linkifiers are run one by one. The first linkifier to return a string will stop the rest of the linkifiers from ever running. Each linkifier receives an `href` argument and a `text` argument, containing the actual link and the text that should go in the link. These are just hints, you can return arbitrary HTML from your linkifier method, even something other than anchor links. 66 | 67 | ###### Example 68 | 69 | Return `''` when you want to completely ignore a link. Maybe use a condition where you whitelist links from origins you're happy with. 70 | 71 | ```js 72 | megamark('ponyfoo.com', { 73 | linkifiers: [function (href, text) { 74 | return ''; 75 | }] 76 | }); 77 | // <- '

\n' 78 | ``` 79 | 80 | ###### Example 81 | 82 | A real use case for this type of tokenizer is prettifying the text on the link. This is particularly useful for links on your own domain. The example below converts links that would be turned into `http://localhost:9000/bevacqua/stompflow/issues/28` into `#28` instead. 83 | 84 | ```js 85 | megamark('http://localhost:9000/bevacqua/stompflow/issues/28', { 86 | linkifiers: [function (href, text) { 87 | return "#" + href.split('/').pop() + ""; 88 | }] 89 | }); 90 | // <- '

#28

\n' 91 | ``` 92 | 93 | ### `options.sanitizer` 94 | 95 | These configuration options will be passed to [insane][2]. The defaults from [insane][2] are used by default. 96 | 97 | ### `options.markers` 98 | 99 | _Advanced option._ Setting markers to an array such as `[[0, 'START'], [10, 'END']]` will place each of those markers in the output, based on the input index you want to track. This feature is necessary because there is no other reliable way of tracking a text cursor position before and after a piece of Markdown is converted to HTML. 100 | 101 | The following example shows how markers could be used to preserve a text selection across Markdown-into-HTML parsing, by providing markers for each cursor. When the output from `megamark` comes back, all you need to do is find your markers, remove them, and place the text selection at their indices. The [`woofmark`][6] Markdown/HTML/WYSIWYG editor module leverages this functionality to do exactly that. 102 | 103 | ```js 104 | megamark('**foo**', { 105 | markers: [[1, '[START]'], [4, '[END]']] 106 | }); 107 | // <- '[START]fo[END]o' 108 | ``` 109 | 110 | Also note that, as shown in the example above, when a marker can't be placed in the output exactly where you asked for, it'll be cleanly placed nearby. In the above example, the `[START]` marker would've been placed _"somewhere inside"_ the opening `` tag, but right after the opening tag finishes was preferred. 111 | 112 | # License 113 | 114 | MIT 115 | 116 | [1]: https://github.com/markdown-it/markdown-it 117 | [2]: https://github.com/bevacqua/insane 118 | [3]: https://github.com/isagalaev/highlight.js 119 | [4]: https://github.com/bevacqua/highlight-redux 120 | [5]: https://github.com/chjj/marked#smartypants 121 | [6]: https://github.com/bevacqua/woofmark 122 | -------------------------------------------------------------------------------- /test/fixtures/cross-tab-communication.html: -------------------------------------------------------------------------------- 1 |

Cross-tab Communication

2 |

The upcoming SharedWorker API allows to transmit data across iframes and even browser tabs or windows. It landed in Chrome years ago, and not so long ago in Firefox, but it’s nowhere to be seen in IE or Safari. A wildly supported alternative exists that can be used today, but it’s largely unknown. Let’s explore it!

3 |

I wanted an elegant solution to the following scenario: suppose a human walks into your website, logs in, opens a second tab, and logs out in that tab. He’s still “logged in” on the first tab, except anything he touches will either redirect them to the login page or straight blow up in their face. A more inviting alternative would be to figure out that they’re logged out and do something about it, such as display a dialog asking them to re-authenticate, or maybe the login view itself.

4 |

You could use the WebSocket API for this, but that’d be overkill. I wanted a lower-level technology flyswatter, so I started looking for cross-tab communication options. The first option that popped up was using cookies or localStorage, and then periodically checking whether they were logged in or not via setInterval. I wasn’t satisfied with that answer because it would waste too many CPU cycles checking for something that might not ever come up. At that point I would’ve rather used a “comet” (also known as long-polling), Server-Sent Events, or WebSockets.

5 |

I was surprised to see that the answer was lying in front of my nose, it was localStorage all along!

6 |

Did you know that localStorage fires an event? More specifically, it fires an event whenever an item is added, modified, or removed in another browsing context. Effectively, this means that whenever you touch localStorage in any given tab, all other tabs can learn about it by listening for the storage event on the window object, like so:

7 |
window.addEventListener('storage', function (event) {
 8 |   console.log(event.key, event.newValue);
 9 | });
10 | 
11 |

The event object contains a few relevant properties.

12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 |
PropertyDescription
keyThe affected key in localStorage
newValueThe value that is currently assigned to that key
oldValueThe value before modification
urlThe URL of the page where the change occurred
38 |

Whenever a tab modifies something in localStorage, an event fires in every other tab. This means we’re able to communicate across browser tabs simply by setting values on localStorage. Consider the following pseudo_ish_-code example:

39 |
var loggedOn;
40 | 
41 | // TODO: call when logged-in user changes or logs out
42 | logonChanged();
43 | 
44 | window.addEventListener('storage', updateLogon);
45 | window.addEventListener('focus', checkLogon);
46 | 
47 | function getUsernameOrNull () {
48 |   // TODO: return whether the user is logged on
49 | }
50 | 
51 | function logonChanged () {
52 |   var uname = getUsernameOrNull();
53 |   loggedOn = uname;
54 |   localStorage.setItem('logged-on', uname);
55 | }
56 | 
57 | function updateLogon (event) {
58 |   if (event.key === 'logged-on') {
59 |     loggedOn = event.newValue;
60 |   }
61 | }
62 | 
63 | function checkLogon () {
64 |   var uname = getUsernameOrNull();
65 |   if (uname !== loggedOn) {
66 |     location.reload();
67 |   }
68 | }
69 | 
70 |

The basic idea is that when a user has two open tabs, logs out from one of them, and goes back to the other tab, the page is reloaded and (hopefully) the server-side logic redirects them to somewhere else. The check is being done only when the tab is focused as a nod to the fact that maybe they log out and they log back in immediately, and in those cases we wouldn’t want to log them out of every other tab.

71 |

We could certainly improve that piece of code, but it serves its purpose pretty well. A better implementation would probably ask them to log in on the spot, but note that this also works the other way around: when they log in and go to another tab that was also logged out, the snippet detects that change reloading the page, and then the server would redirect them to the logged-in fountain-of-youth blessing of an experience you call your website (again, hopefully).

72 |

A simpler API

73 |

The localStorage API is arguably one of the easiest to use APIs there are, when it comes to web browsers, and it also enjoys quite thorough cross-browser support. There are, however, some quirks such as incognito Safari throwing on sets with a QuotaExceededError, no support for JSON out the box, or older browsers bumming you out.

74 |

For those reasons, I put together local-storage which is a module that provides a simplified API to localStorage, gets rid of those quirks, falls back to an in-memory store when the localStorage API is missing, and also makes it easier to consume storage events, by letting you register and unregister listeners for specific keys.

75 |

API endpoints in local-storage@1.3.1 (latest, at the time of this writing) are listed below.

76 |
    77 |
  • ls(key, value?) gets or sets key
  • 78 |
  • ls.get(key) gets the value in key
  • 79 |
  • ls.set(key, value) sets key to value
  • 80 |
  • ls.remove(key) removes key
  • 81 |
  • ls.on(key, fn(value, old, url)) listens for changes to key in other tabs, triggers fn
  • 82 |
  • ls.off(key, fn) unregisters listener previously added with ls.on
  • 83 |
84 |

It’s also worth mentioning that local-storage registers a single storage event handler and keeps track of every key you want to observe, rather than register multiple storage events.

85 |

I’d be interested to learn about other use cases for low-tech communication across tabs! Certainly sounds useful for offline-first development, particularly if we keep in mind that SharedWorker might take a while to become widely supported, and WebSockets are unreliable in offline-first scenarios.

86 | -------------------------------------------------------------------------------- /markdown.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var MarkdownIt = require('markdown-it'); 4 | var hljs = require('highlight.js'); 5 | var sluggish = require('sluggish'); 6 | var tokenizeLinks = require('./tokenizeLinks'); 7 | var md = new MarkdownIt({ 8 | html: true, 9 | xhtmlOut: true, 10 | linkify: true, 11 | typographer: true, 12 | langPrefix: 'md-lang-alias-', 13 | highlight: highlight.bind(null, false) 14 | }); 15 | var ralias = / class="md-lang-alias-([^"]+)"/; 16 | var aliases = { 17 | js: 'javascript', 18 | md: 'markdown', 19 | html: 'xml', // next best thing 20 | jade: 'css', // next best thing 21 | zsh: 'bash', // next best thing 22 | shell: 'bash', // next best thing 23 | sh: 'bash' // next best thing 24 | }; 25 | 26 | md.core.ruler.after('linkify', 'pos_counter', function posCounter (state) { 27 | var partial = state.src; 28 | var cursor = 0; 29 | state.tokens.forEach(function crawl (token, i) { 30 | token.cursorStart = cursor; 31 | if (token.markup) { 32 | moveCursor(token.markup); 33 | } 34 | if (token.type === 'link_open') { 35 | moveCursor('['); 36 | } 37 | if (token.type === 'link_close') { 38 | moveCursorAfterLinkClose(); 39 | } 40 | if (token.type === 'image') { 41 | moveCursor('!['); 42 | } 43 | if (token.children) { 44 | token.children.forEach(crawl); 45 | } else if (token.content) { 46 | token.src = token.content; 47 | moveCursor(token.src); 48 | } 49 | if (token.type === 'code_inline') { // closing mark 50 | moveCursor(token.markup); 51 | } 52 | if (token.type === 'heading_open') { 53 | moveCursor(''); 54 | } 55 | if (token.map) { 56 | moveCursor(''); 57 | } 58 | token.cursorEnd = cursor; 59 | }); 60 | 61 | function moveCursor (needle) { 62 | var regex = needle instanceof RegExp; 63 | var re = regex ? needle : new RegExp('^\\s*' + escapeForRegExp(needle), 'ig'); 64 | var match = re.exec(partial); 65 | if (!match) { 66 | return false; 67 | } 68 | var diff = re.lastIndex; 69 | cursor += diff; 70 | partial = partial.slice(diff); 71 | return true; 72 | } 73 | 74 | function moveCursorAfterLinkClose () { 75 | moveCursor(']'); 76 | if (!moveCursor(/^\s*\[[^\]]+\]/g)) { 77 | moveCursor('('); 78 | moveCursorAfterParenthesis(); 79 | } 80 | } 81 | 82 | function moveCursorAfterParenthesis () { 83 | var prev; 84 | var char; 85 | var i; 86 | var inQuotes = false; 87 | for (i = 0; i < partial.length; i++) { 88 | prev = partial[i - 1] || ''; 89 | if (prev === '\\') { continue; } 90 | char = partial[i]; 91 | if (!inQuotes && char === ')') { break; } 92 | if (char === '"' || char === '\'') { inQuotes = !inQuotes; } 93 | } 94 | cursor += i + 1; 95 | partial = partial.slice(i + 1); 96 | } 97 | }); 98 | 99 | function repeat (text, times) { 100 | var result = '', n; 101 | while (n) { 102 | if (n % 2 === 1) { 103 | result += text; 104 | } 105 | if (n > 1) { 106 | text += text; 107 | } 108 | n >>= 1; 109 | } 110 | return result; 111 | } 112 | 113 | function escapeForRegExp (text) { return text.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&'); } 114 | 115 | var baseblock = md.renderer.rules.code_block; 116 | var baseinline = md.renderer.rules.code_inline; 117 | var basefence = md.renderer.rules.fence; 118 | var basetext = md.renderer.rules.text; 119 | var baserenderInline = md.renderer.renderInline; 120 | var languages = []; 121 | 122 | md.core.ruler.before('linkify', 'linkify-tokenizer', linkifyTokenizer, {}); 123 | md.renderer.rules.heading_open = heading; 124 | md.renderer.rules.code_block = block; 125 | md.renderer.rules.code_inline = inline; 126 | md.renderer.rules.fence = fence; 127 | md.renderer.renderInline = renderInline; 128 | 129 | hljs.configure({ tabReplace: 2, classPrefix: 'md-code-' }); 130 | 131 | function highlight (encoded, code, detected) { 132 | var lower = String(detected).toLowerCase(); 133 | var lang = aliases[detected] || detected; 134 | var escaped = encodeHtmlMarks(code, encoded); 135 | try { 136 | var result = hljs.highlight(lang, escaped); 137 | var unescaped = decodeHtmlMarks(result.value, true, encoded); 138 | return unescaped; 139 | } catch (e) { 140 | return decodeHtmlMarks(encodeHtmlMarks(code, encoded), true, encoded); 141 | } 142 | } 143 | 144 | function encode (tag) { 145 | return tag.replace('<', '<').replace('>', '>'); 146 | } 147 | 148 | function encodeHtmlMarks (code, encoded) { 149 | var opentag = ''; 150 | var closetag = ''; 151 | if (encoded) { 152 | opentag = encode(opentag); 153 | closetag = encode(closetag); 154 | } 155 | var ropen = new RegExp(opentag, 'g'); 156 | var rclose = new RegExp(closetag, 'g'); 157 | var open = 'highlightmarkisveryliteral'; 158 | var close = 'highlightmarkwasveryliteral'; 159 | return code.replace(ropen, open).replace(rclose, close); 160 | } 161 | 162 | function decodeHtmlMarks (value, inCode) { 163 | var ropen = /highlightmarkisveryliteral/g; 164 | var rclose = /highlightmarkwasveryliteral/g; 165 | var classes = 'md-mark' + (inCode ? ' md-code-mark' : ''); 166 | var open = ''; 167 | var close = ''; 168 | return value.replace(ropen, open).replace(rclose, close); 169 | } 170 | 171 | function heading (tokens, i, options, env, renderer) { 172 | var token = tokens[i]; 173 | var open = '<' + token.tag; 174 | var close = '>'; 175 | var contents = read(); 176 | var slug = sluggish(contents); 177 | if (slug.length) { 178 | return open + ' id="' + slug + '"' + close; 179 | } 180 | return open + close; 181 | 182 | function read () { 183 | var index = i++; 184 | var next = tokens[index]; 185 | var contents = ''; 186 | while (next && next.type !== 'heading_close') { 187 | contents += next.content; 188 | next = tokens[index++ + 1]; 189 | } 190 | return contents; 191 | } 192 | } 193 | 194 | function block (tokens, idx, options, env) { 195 | var base = baseblock.apply(this, arguments).substr(11); // starts with '
'
196 |   var untagged = base.substr(0, base.length - 14);
197 |   var upmarked = upmark(tokens[idx], untagged, 0, env);
198 |   var marked = highlight(true, upmarked);
199 |   var classed = '
' + marked + '
\n'; 200 | return classed; 201 | } 202 | 203 | function inline (tokens, idx, options, env) { 204 | var base = baseinline.apply(this, arguments).substr(6); // starts with '' 205 | var untagged = base.substr(0, base.length - 7); // ends with '' 206 | var upmarked = upmark(tokens[idx], untagged, 1, env); 207 | var marked = highlight(true, upmarked); 208 | var classed = '' + marked + ''; 209 | return classed; 210 | } 211 | 212 | function renderInline (tokens, options, env) { 213 | var result = baserenderInline.apply(this, arguments); 214 | if (!tokens.length) { 215 | return result; 216 | } 217 | env.flush = true; 218 | result += upmark(tokens[tokens.length - 1], '', 0, env); 219 | env.flush = false; 220 | return result; 221 | } 222 | 223 | function upmark (token, content, offset, env) { 224 | return env.markers 225 | .filter(pastOrPresent) 226 | .reverse() 227 | .reduce(considerUpmarking, content); 228 | 229 | function considerUpmarking (content, marker) { 230 | var startOffset = env.flush ? 0 : marker[0] - token.cursorStart; 231 | var start = Math.max(0, startOffset - offset); 232 | var markerCode = consumeMarker(marker, env); 233 | return ( 234 | content.slice(0, start) + 235 | markerCode + 236 | content.slice(start) 237 | ); 238 | } 239 | 240 | function pastOrPresent (marker) { 241 | return marker[0] <= token.cursorEnd; 242 | } 243 | } 244 | 245 | function consumeMarker (marker, env) { 246 | var code = randomCode() + randomCode() + randomCode(); 247 | env.markers.splice(env.markers.indexOf(marker), 1); 248 | env.markerCodes.push([code, marker[1]]); 249 | return code; 250 | } 251 | 252 | function randomCode () { 253 | return Math.random().toString(18).substr(2).replace(/\d+/g, ''); 254 | } 255 | 256 | function fence (tokens, idx, options, env) { 257 | var base = basefence.apply(this, arguments).substr(5); // starts with '
'
258 |   var lang = base.substr(0, 6) !== ''; // when the fence has a language class
259 |   var untaggedStart = lang ? base.indexOf('>') + 1 : 6;
260 |   var untagged = base.substr(untaggedStart);
261 |   var upmarked = upmark(tokens[idx], untagged, 0, env);
262 |   var codeTag = lang ? base.substr(0, untaggedStart) : '';
263 |   var classed = '
' + codeTag + upmarked;
264 |   var aliased = classed.replace(ralias, aliasing);
265 |   return aliased;
266 | }
267 | 
268 | function aliasing (all, language) {
269 |   var name = aliases[language] || language || 'unknown';
270 |   var lang = 'md-lang-' + name;
271 |   if (languages.indexOf(lang) === -1) {
272 |     languages.push(lang);
273 |   }
274 |   return ' class="md-code ' + lang + '"';
275 | }
276 | 
277 | function textParser (tokens, idx, options, env) {
278 |   var token = tokens[idx];
279 |   token.content = upmark(token, token.content, 0, env);
280 |   var base = basetext.apply(this, arguments);
281 |   var tokenized = tokenize(base, env.tokenizers);
282 |   return tokenized;
283 | }
284 | 
285 | function linkifyTokenizer (state) {
286 |   tokenizeLinks(state, state.env);
287 | }
288 | 
289 | function tokenize (text, tokenizers) {
290 |   return tokenizers.reduce(use, text);
291 |   function use (result, tok) {
292 |     return result.replace(tok.token, tok.transform);
293 |   }
294 | }
295 | 
296 | function decodeMarkers (html, env) {
297 |   return env.markerCodes.reduce(reducer, html);
298 |   function reducer (html, mcp) {
299 |     return html.replace(mcp[0], mcp[1]);
300 |   }
301 | }
302 | 
303 | function markdown (input, options) {
304 |   var tok = options.tokenizers || [];
305 |   var lin = options.linkifiers || [];
306 |   var valid = input === null || input === void 0 ? '' : String(input);
307 |   var env = {
308 |     tokenizers: tok,
309 |     linkifiers: lin,
310 |     markers: options.markers ? options.markers.sort(asc) : [],
311 |     markerCodes: []
312 |   };
313 |   md.renderer.rules.text = textParser;
314 |   var leftMark = upmark({ cursorStart: 0, cursorEnd: 0 }, '', 0, env);
315 |   var htmlMd = md.render(valid, env);
316 |   env.flush = true;
317 |   var rightMark = upmark({ cursorStart: 0, cursorEnd: Infinity }, '', 0, env);
318 |   var html = leftMark + htmlMd + rightMark;
319 |   return decodeMarkers(decodeHtmlMarks(encodeHtmlMarks(html)), env);
320 | }
321 | 
322 | function asc (a, b) { return a[0] - b[0]; }
323 | 
324 | markdown.parser = md;
325 | markdown.languages = languages;
326 | module.exports = markdown;
327 | 


--------------------------------------------------------------------------------
/test/megamark.js:
--------------------------------------------------------------------------------
  1 | 'use strict';
  2 | 
  3 | var fs = require('fs');
  4 | var test = require('tape');
  5 | var megamark = require('..');
  6 | 
  7 | function read (name) {
  8 |   return fs.readFileSync('./test/fixtures/' + name, 'utf8');
  9 | }
 10 | 
 11 | function write (name, data) {
 12 |   return fs.writeFileSync('./test/fixtures/' + name, data);
 13 | }
 14 | 
 15 | test('empty doesn\'t blow up', function (t) {
 16 |   t.equal(megamark(), '');
 17 |   t.end();
 18 | });
 19 | 
 20 | test('code snippets work as expected', function (t) {
 21 |   t.equal(megamark(read('code-snippets.md')), read('code-snippets.html'));
 22 |   t.end();
 23 | });
 24 | 
 25 | test('email link works as expected', function (t) {
 26 |   t.equal(megamark(read('email-example.md')), read('email-example.html'));
 27 |   t.end();
 28 | });
 29 | 
 30 | test('emphasis works as expected', function (t) {
 31 |   t.equal(megamark(read('barkup.md')), read('barkup.html'));
 32 |   t.end();
 33 | });
 34 | 
 35 | test('parsing of ponyfoo articles works as expected', function (t) {
 36 |   t.equal(megamark(read('stop-breaking-the-web.md')), read('stop-breaking-the-web.html'));
 37 |   t.equal(megamark(read('cross-tab-communication.md')), read('cross-tab-communication.html'));
 38 |   t.end();
 39 | });
 40 | 
 41 | test('tokenizing works as expected', function (t) {
 42 |   t.equal(megamark('_@bevacqua_', { tokenizers: [{ token: /(?:^|\s)@([A-z]+)\b/, transform: transform }] }), '

BEVACQUA

\n'); 43 | t.end(); 44 | function transform (text, username) { 45 | return username.toUpperCase(); 46 | } 47 | }); 48 | 49 | test('tokenizer ignores encoding by default', function (t) { 50 | t.equal(megamark('_@bevacqua_', { tokenizers: [{ token: /(?:^|\s)@([A-z]+)\b/, transform: transform }] }), '

BEVACQUA

\n'); 51 | t.end(); 52 | function transform (text, username) { 53 | return '' + username.toUpperCase() + ''; 54 | } 55 | }); 56 | 57 | test('markdown defaults to ignoring hazardous elements, but that can be overridden', function (t) { 58 | t.equal(megamark(''), ''); 59 | t.equal(megamark(''), ''); 60 | t.equal(megamark(''), ''); 61 | t.equal(megamark('', { sanitizer: { allowedTags: ['p', 'iframe'] } }), ''); 62 | t.end(); 63 | function transform (text, username) { 64 | return username.toUpperCase(); 65 | } 66 | }); 67 | 68 | test('tokenizing links allows me to return no content', function (t) { 69 | t.equal(megamark('ponyfoo.com', { linkifiers: [linkify] }), '

\n'); 70 | t.end(); 71 | function linkify (href, text) { 72 | return ''; 73 | } 74 | }); 75 | 76 | test('tokenizing links allows me to return plain text content', function (t) { 77 | t.equal(megamark('ponyfoo.com', { linkifiers: [linkify] }), '

@ponyfoo

\n'); 78 | t.end(); 79 | function linkify (href, text) { 80 | return '@' + text.split('.').shift(); 81 | } 82 | }); 83 | 84 | test('tokenizing links allows me to return any tags I want', function (t) { 85 | t.equal(megamark('ponyfoo.com', { linkifiers: [linkify] }), '

http://ponyfoo.com

\n'); 86 | t.end(); 87 | function linkify (href, text) { 88 | return '' + href + ''; 89 | } 90 | }); 91 | 92 | test('tokenizing links allows me to ignore _some_ things', function (t) { 93 | t.equal(megamark('ponyfoo.com google.com', { linkifiers: [linkify] }), '

http://ponyfoo.com

\n'); 94 | t.end(); 95 | function linkify (href, text) { 96 | if (/\/\/google\.com/.test(href)) { 97 | return ''; 98 | } 99 | return '' + href + ''; 100 | } 101 | }); 102 | 103 | test('tokenizing links allows me to return any tags I want', function (t) { 104 | t.equal(megamark('http://localhost:9000/bevacqua/stompflow/issues/28', { linkifiers: [linkify] }), '

#28

\n'); 105 | t.end(); 106 | function linkify (href, text) { 107 | return '#' + href.split('/').pop() + ''; 108 | } 109 | }); 110 | 111 | test('tokenizing links doesn\'t break protocol', function (t) { 112 | t.equal(megamark('//localhost:9000/bevacqua/stompflow/issues/28', { linkifiers: [linkify] }), '

#28

\n'); 113 | t.end(); 114 | function linkify (href, text) { 115 | return '#' + href.split('/').pop() + ''; 116 | } 117 | }); 118 | 119 | test('tokenizing links doesn\'t break protocol', function (t) { 120 | t.equal(megamark('www.stompflow.com/bevacqua/stompflow/issues/28', { linkifiers: [linkify] }), '

#28

\n'); 121 | t.end(); 122 | function linkify (href, text) { 123 | return '#' + href.split('/').pop() + ''; 124 | } 125 | }); 126 | 127 | test('tokenizing links doesn\'t break protocol', function (t) { 128 | t.equal(megamark('https://localhost:9000/bevacqua/stompflow/issues/28', { linkifiers: [linkify] }), '

#28

\n'); 129 | t.end(); 130 | function linkify (href, text) { 131 | return '#' + href.split('/').pop() + ''; 132 | } 133 | }); 134 | 135 | test('links work as expected', function (t) { 136 | t.equal( 137 | megamark('ponyfoo.com and them something else'), 138 | '

ponyfoo.com and them something else

\n' 139 | ); 140 | t.equal( 141 | megamark('[asd](http://localhost:3000/author/compose)'), 142 | '

asd

\n' 143 | ); 144 | t.equal( 145 | megamark('[asd](/author/compose)'), 146 | '

asd

\n' 147 | ); 148 | t.equal( 149 | megamark('[asd][1]\n\n[1]: /author/compose'), 150 | '

asd

\n' 151 | ); 152 | t.equal( 153 | megamark('Get half off my **JavaScript Application Design** book today! Enter code **dotd072115au** at [bevacqua.io/bf/book](http://localhost:3000/author/compose) when checking out. If you run into any issues, let me know.'), 154 | '

Get half off my JavaScript Application Design book today! Enter code dotd072115au at bevacqua.io/bf/book when checking out. If you run into any issues, let me know.

\n' 155 | ); 156 | t.end(); 157 | }); 158 | 159 | test('italics work as expected', function (t) { 160 | t.equal(megamark('_some_'), '

some

\n'); 161 | t.equal(megamark('_(some)_'), '

(some)

\n'); 162 | t.equal(megamark('_(#)_'), '

(#)

\n'); 163 | t.equal(megamark('_(#)_.'), '

(#).

\n'); 164 | t.equal(megamark('_(#)_.', {}), '

(#).

\n'); 165 | t.end(); 166 | }); 167 | 168 | test('headings work as expected', function (t) { 169 | t.equal(megamark('# foo'), '

foo

\n'); 170 | t.equal(megamark('## foo'), '

foo

\n'); 171 | t.equal(megamark('## **foo**'), '

foo

\n'); 172 | t.equal(megamark('## **f _o_ o**'), '

f o o

\n'); 173 | t.equal(megamark('

'), '

'); 174 | t.equal(megamark('

a

'), '

a

'); 175 | t.equal(megamark('

bar

'), '

bar

'); 176 | t.end(); 177 | }); 178 | 179 | test('mark highlights nodes, even within code', function (t) { 180 | t.equal( 181 | megamark('foo is marked..\n\n```html\nfoo;\n```'), 182 | '

foo is marked…

\n
<span>foo</span>;\n
\n' 183 | ); 184 | t.equal( 185 | megamark('foo is marked..\n\n```js\nfoo;\n```'), 186 | '

foo is marked…

\n
<span>foo</span>;\n
\n' 187 | ); 188 | t.equal( 189 | megamark('foo is marked..\n\n```\nfoo;\n```'), 190 | '

foo is marked…

\n
foo;\n
\n' 191 | ); 192 | t.equal( 193 | megamark('asd\n\n`var foo = 1; foo = -10;`\n'), 194 | '

asd

\n

var foo = 1; foo = -10;

\n' 195 | ); 196 | t.equal( 197 | megamark('asd\n\n foo'), 198 | '

asd

\n
<span>foo</span>
\n' 199 | ); 200 | t.end(); 201 | }); 202 | 203 | test('megamark understands markers', function (t) { 204 | t.equal(megamark('_foo_', { markers: [[0, '[START]'], [0, '[END]']] }), '[START][END]

foo

\n'); 205 | t.equal(megamark('_foo_', { markers: [[5, '[START]'], [5, '[END]']] }), '

foo[START][END]

\n'); 206 | t.equal(megamark('_foo_', { markers: [[1, '[START]'], [5, '[END]']] }), '

[START]foo[END]

\n'); 207 | t.equal(megamark('foo', { markers: [[1, '[START]'], [2, '[END]']] }), '

f[START]o[END]o

\n'); 208 | t.equal(megamark('**foo**', { markers: [[1, '[START]'], [5, '[END]']] }), '

[START]foo[END]

\n'); 209 | t.equal(megamark('**foo**', { markers: [[2, '[START]'], [4, '[END]']] }), '

[START]fo[END]o

\n'); 210 | t.equal(megamark('`foo`\n\n> *bar*\n\n**baz**', { markers: [[2, '[START]'], [5, '[END]']] }), '

f[START]oo[END]

\n
\n

bar

\n
\n

baz

\n'); 211 | t.equal(megamark('# markdown', { markers: [[3, '[START]'], [6, '[END]']] }), '

m[START]ark[END]down

\n'); 212 | t.equal(megamark('### markdown', { markers: [[5, '[START]'], [8, '[END]']] }), '

m[START]ark[END]down

\n'); 213 | t.equal(megamark('### markdown\n\n\n\n\n\n\n\n\nfoo bar baz', { markers: [[20, '[START]'], [23, '[END]']] }), '

markdown

\n

[START]fo[END]o bar baz

\n'); 214 | t.equal(megamark('bar', { markers: [[16, '[START]'], [18, '[END]']] }), '

b[START]ar[END]

\n'); 215 | t.equal(megamark('[bar](/foo)', { markers: [[2, '[START]'], [4, '[END]']] }), '

b[START]ar[END]

\n'); 216 | t.equal(megamark('[bar][a]\n\n[a]: /foo', { markers: [[2, '[START]'], [4, '[END]']] }), '

b[START]ar[END]

\n'); 217 | t.equal(megamark('![alt](/foo)', { markers: [[2, '[START]'], [4, '[END]']] }), '

[START]al[END]t

\n'); 218 | t.equal(megamark('![alt][a]\n\n[a]: /foo', { markers: [[2, '[START]'], [4, '[END]']] }), '

[START]al[END]t

\n'); 219 | t.equal(megamark('', { markers: [[2, '[START]'], [4, '[END]']] }), '[START][END]'); 220 | t.end(); 221 | }); 222 | 223 | test('megamark understands markers in complex markdown', function (t) { 224 | t.equal(megamark(read('woofmark-sample.md'), { markers: [[103, '[START]'], [172, '[END]']] }), read('woofmark-sample.html')); 225 | t.end(); 226 | }); 227 | 228 | test('megamark ignores html in code', function (t) { 229 | t.equal(megamark('`bar`'), 230 | '

<strong>bar</strong>

\n'); 231 | 232 | t.equal(megamark('`foo asd asd bar`'), 233 | '

foo asd asd <strong>bar</strong>

\n'); 234 | t.equal(megamark(' foo asd asd bar'), 235 | '
foo asd asd  <strong>bar</strong>
\n'); 236 | 237 | t.equal(megamark(' \n
foo
'), 238 | '
<!doctype html>\n<html><div>foo</div></html>
\n'); 239 | t.end(); 240 | }); 241 | -------------------------------------------------------------------------------- /test/fixtures/stop-breaking-the-web.md: -------------------------------------------------------------------------------- 1 | # Stop Breaking the Web 2 | 3 | The year is 2014, a ninja rockstar band goes up against the now long-forgotten [progressive enhancement][1] technique, forsaking the origins of the web and everything they once stood for. This article is where I rant about how **we are breaking the web**, the not-immediately-obvious reasons why we should stop doing this, and how _not breaking the web would be a great thing_. 4 | 5 | **TL;DR** _We are crushing the web. Dedicated client-side rendering sucks. Polyfills are used for all the wrong reasons. Those hideous-looking hash routers are bad and we should feel bad. We have been telling each other for years that progressive enhancement is great, and yet we're doing very little about it!_ 6 | 7 | Here's hoping the screenshot below corresponds merely to a publicity stunt, attempting to grab the tech media world by surprise. That being said, the fact that _we're not certain_ about whether this is a ruse or a permanent decision makes me cringe for the future of the web. 8 | 9 | ![tacobell.png][19] 10 | 11 | Taco Bell _#onlyintheapp_ — is it a **clever publicity stunt to drive app downloads or a symptom of the profusely bleeding web?** 12 | 13 | _Disclaimer: This article is **not a rant about Angular 2.0**. I started forming these thoughts a while ago, before the Angular 2.0 revelations. The roadmap for Angular merely happened to coincide with the posting of this article. If anything, those news reinforce the [points others have made against it][5], but the statement behind this article goes far beyond the myriad of breaking changes in Angular's public API._ 14 | 15 | It makes me sad to point out that **we as a community have failed the web**. Whatever happened to [progressive enhancement][1]? You know, that simple rule where you are supposed to **put content at the forefront**. Everything else is secondary to content, right? People want to see your content first. Once the content is in place, maybe they'll want to be able to interact with it. However, if content isn't there first, because [your page is too slow][2], or because you load fonts synchronously before humans can read anything, or because you decide to use client-side rendering exclusively, then **humans are pretty much screwed**. _Right?_ 16 | 17 | > Sure, humans have faster Internet connections now. Or do they? A lot of humans access the web on **mobile connections such as 2G and 3G**, and they expect your site to be _just as fast as on desktop_. That'll hardly be the case if you're blocking content on a JavaScript download. 18 | 19 | Increasingly, this is becoming the norm. Fuck humans, we need all these awesome frameworks to make the web great. Wait, we do need humans. They have money, metadata, and stuff. Oh I know, let's give them client-side routing even if they're on IE6. That's bound to make them happy, right? Oh, stupid IE6 doesn't support the history API. Well, screw IE6. What? [IE9 doesn't support the history API][9] either? Well, I'll just support IE10. Wait, that's bad, **I'll use a hash router** and support IE all the way down to IE6! Yes, what a wonderful world, let's make our site accessible through routes like `/#/products/nintendo-game-cube` and then require JavaScript to be enabled for our view router to work, and let's also render the views in the client-side alone. Yes, _that_ will do it! 20 | 21 | Meanwhile, we add tons of weight to our pages, levelling the field and making the experience in modern browsers worse as a result of attempting to make the experience in older browsers better. There's a problem with this fallacy, though. People using older browsers **are not expecting the newest features**. They're content with what they have. That's the whole reason why they're using an older browser in the first place. Instead of attempting to give those users a better experience (and usually failing miserably), you should enable features only if they're currently available on the target browser, instead of creating hacks around those limitations. 22 | 23 | Humans using older browsers would be more than fine with your site if you only kept the server-side rendering part, so they don't really need your fancy-and-terribly-complex [maintainability-nightmare][3] of a hash router. But no, wait! Hash routing is [so-and-so awesome][4], right? Who needs server-side rendering! 24 | 25 | Okay fine let's assume you agree with me. Hash routing sucks. It does nothing to help modern browsers _(except slowing down the experience, [it does do that!][6])_ and everything to complicate development and confuse humans who are using older browsers. 26 | 27 | ## Do we even care about the web as much as we say we do? 28 | 29 | Recently, someone published an article on Medium titled ["What's wrong with Angular.js"][5]. It infuriates me that we don't seem to care _at all_ about server-side rendering, as long as we are able to develop applications using our favorite framework. While every single other point was refuted in some way or another, the point about server-side rendering went almost unnoticed. As if nobody even cared or even understood the implications. 30 | 31 | > 6\. No server side rendering without obscure hacks. Never. You can’t fix broken design. Bye bye [isomorphic web apps][7]. 32 | 33 | The only place where I would conceive using a framework that relies solely on client-side rendering is for developing prototypes or internal backend apps _(just like how we use Bootstrap mostly for internal stuff)_. In these cases, these negligent frameworks are great because they boost productivity at virtually no cost, since no humans get harmed in the process. Besides the few use cases where neglecting server-side rendering isn't going to affect any human beings, doing so is undisputably **slow, unacceptable, backwards, and negligent**. 34 | 35 | It is slow because the human now has to download all of your markup, your CSS, and your JavaScript before the JavaScript is able to render the view the user expected you to deliver in the first place. When did we agree to trade performance for frameworks? 36 | 37 | It is backwards because you should be **delivering the content in human-viewable form first**, and not after every single render blocking request out there finishes loading. This means that a human-ready HTML view should be rendered in the server-side and served to the human, then you can add your fancy JavaScript magic on top of that, while the user is busy making sense of the information you've presented them with. 38 | 39 | > Always keep humans busy, or they'll get uneasy. 40 | 41 | It is negligent because we have been telling each other to avoid this same situation for years, but using other words. We've been telling ourselves about the importance of deferring script loading by pushing `",returnEnd:!0,subLanguage:"javascript"}},{begin:"<%",end:"%>",subLanguage:"vbscript"},r,{className:"pi",begin:/<\?\w+/,end:/\?>/,relevance:10},{className:"tag",begin:"",contains:[{className:"title",begin:"[^ /><]+",relevance:0},n]}]}}},{}],15:[function(e,t,r){t.exports=["addition","annotaion","annotation","argument","array","at_rule","attr_selector","attribute","begin-block","blockquote","body","built_in","bullet","cbracket","cdata","cell","change","char","chunk","class","code","collection","command","commands","commen","comment","constant","container","dartdoc","date","decorator","default","deletion","doctype","emphasis","end-block","envvar","expression","filename","filter","flow","foreign","formula","func","function","function_name","generics","header","hexcolor","horizontal_rule","id","import","important","infix","inheritance","input","javadoc","javadoctag","keyword","keywords","label","link_label","link_reference","link_url","list","literal","localvars","long_brackets","matrix","module","number","operator","output","package","param","parameter","params","parent","phpdoc","pi","pod","pp","pragma","preprocessor","prompt","property","pseudo","quoted","record_name","regex","regexp","request","reserved","rest_arg","rules","shader","shading","shebang","special","sqbracket","status","stl_container","stream","string","strong","sub","subst","summary","symbol","tag","template_comment","template_tag","title","type","typedef","typename","value","var_expand","variable","winutils","xmlDocTag","yardoctag"]},{}],16:[function(e,t,r){"use strict";var n=e("./toMap"),s=["background","base","cite","href","longdesc","src","usemap"];t.exports={uris:n(s)}},{"./toMap":24}],17:[function(e,t,r){"use strict";var n={allowedAttributes:{a:["href","name","target","title","aria-label"],iframe:["allowfullscreen","frameborder","src"],img:["src","alt","title","aria-label"]},allowedClasses:{},allowedSchemes:["http","https","mailto"],allowedTags:["a","abbr","article","b","blockquote","br","caption","code","del","details","div","em","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","li","main","mark","ol","p","pre","section","span","strike","strong","sub","summary","sup","table","tbody","td","th","thead","tr","ul"],filter:null};t.exports=n},{}],18:[function(e,t,r){"use strict";var n=e("./toMap"),s=["area","br","col","hr","img","wbr","input","base","basefont","link","meta"];t.exports={voids:n(s)}},{"./toMap":24}],19:[function(e,t,r){"use strict";function n(e,t,r){var n=[],l=r===!0?t:s({},a,t),c=o(n,l);return i(e,c),n.join("")}var s=(e("he"),e("assignment")),i=e("./parser"),o=e("./sanitizer"),a=e("./defaults");n.defaults=a,t.exports=n},{"./defaults":17,"./parser":21,"./sanitizer":22,assignment:3,he:23}],20:[function(e,t,r){"use strict";t.exports=function(e){return"string"==typeof e?e.toLowerCase():e}},{}],21:[function(e,t,r){"use strict";function n(){var e=[];return e.lastItem=function(){return e[e.length-1]},e}function s(e,t){function r(){b=!0,s();var t=e===v;v=e,t&&(e="")}function s(){"");r>=0&&(t.comment&&t.comment(e.substring(4,r)),e=e.substring(r+3),b=!1)}function g(){if(b){var r,n=e.indexOf("<");n>=0?(r=e.substring(0,n),e=e.substring(n)):(r=e,e=""),t.chars&&t.chars(r)}}function m(e,r,n,s){function l(e,t,r,n,s){void 0===r&&void 0===n&&void 0===s?c[t]=void 0:c[t]=i.decode(r||n||s||"")}var c={},p=o(r),h=a.voids[p]||!!s;n.replace(u,l),h||k.push(p),t.start&&t.start(p,c,h)}function _(e,r){var n,s=0,i=o(r);if(i)for(s=k.length-1;s>=0&&k[s]!==i;s--);if(s>=0){for(n=k.length-1;n>=s;n--)t.end&&t.end(k[n]);k.length=s}}for(var b,k=n(),v=e;e;)r();_()}var i=e("he"),o=e("./lowercase"),a=(e("./attributes"),e("./elements")),l=/^<\s*([\w:-]+)((?:\s+[\w:-]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)\s*>/,c=/^<\s*\/\s*([\w:-]+)[^>]*>/,u=/([\w:-]+)(?:\s*=\s*(?:(?:"((?:[^"])*)")|(?:'((?:[^'])*)')|([^>\s]+)))?/g,p=/^":">"))}function a(e){var t=i(e),n=-1!==(d.allowedTags||[]).indexOf(t);n&&f.ignoring===!1?(r("")):p(t)}function l(e){function t(t){return 0===e.indexOf(t+":")}var r=e[0];if("#"===r||"/"===r)return!0;var n=e.indexOf(":");if(-1===n)return!0;var s=e.indexOf("?");if(-1!==s&&n>s)return!0;var i=e.indexOf("#");return-1!==i&&n>i?!0:d.allowedSchemes.some(t)}function c(e){f.ignoring===!1&&r(e)}function u(e){f.ignoring===!1?f={ignoring:e,depth:1}:f.ignoring===e&&f.depth++}function p(e){f.ignoring===e&&--f.depth<=0&&h()}function h(){f={ignoring:!1,depth:0}}var f,d=t||{};return h(),{start:n,end:a,chars:c}}var s=e("he"),i=e("./lowercase"),o=e("./attributes");t.exports=n},{"./attributes":16,"./lowercase":20,he:23}],23:[function(e,t,r){"use strict";function n(e){return a[e]}function s(e){return l[e]}function i(e){return null==e?"":String(e).replace(u,n)}function o(e){return null==e?"":String(e).replace(c,s)}var a={"&":"&","<":"<",">":">",'"':""","'":"'"},l={"&":"&","<":"<",">":">",""":'"',"'":"'"},c=/(&|<|>|"|')/g,u=/[&<>"']/g;i.options=o.options={},t.exports={encode:i,escape:i,decode:o,unescape:o,version:"1.0.0-browser"}},{}],24:[function(e,t,r){"use strict";function n(e){return e.reduce(s,{})}function s(e,t){return e[t]=!0,e}t.exports=n},{}],25:[function(e,t,r){"use strict";t.exports=e("./lib/")},{"./lib/":35}],26:[function(e,t,r){"use strict";t.exports=e("entities/maps/entities.json")},{"entities/maps/entities.json":78}],27:[function(e,t,r){"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"]},{}],28:[function(e,t,r){"use strict";var n="[a-zA-Z_:][a-zA-Z0-9:._-]*",s="[^\"'=<>`\\x00-\\x20]+",i="'[^']*'",o='"[^"]*"',a="(?:"+s+"|"+i+"|"+o+")",l="(?:\\s+"+n+"(?:\\s*=\\s*"+a+")?)",c="<[A-Za-z][A-Za-z0-9\\-]*"+l+"*\\s*\\/?>",u="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",p="|",h="<[?].*?[?]>",f="]*>",d="",g=new RegExp("^(?:"+c+"|"+u+"|"+p+"|"+h+"|"+f+"|"+d+")"),m=new RegExp("^(?:"+c+"|"+u+")"); 2 | t.exports.HTML_TAG_RE=g,t.exports.HTML_OPEN_CLOSE_TAG_RE=m},{}],29:[function(e,t,r){"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"]},{}],30:[function(e,t,r){"use strict";function n(e){return Object.prototype.toString.call(e)}function s(e){return"[object String]"===n(e)}function i(e,t){return x.call(e,t)}function o(e){var t=Array.prototype.slice.call(arguments,1);return t.forEach(function(t){if(t){if("object"!=typeof t)throw new TypeError(t+"must be object");Object.keys(t).forEach(function(r){e[r]=t[r]})}}),e}function a(e,t,r){return[].concat(e.slice(0,t),r,e.slice(t+1))}function l(e){return e>=55296&&57343>=e?!1:e>=64976&&65007>=e?!1:65535===(65535&e)||65534===(65535&e)?!1:e>=0&&8>=e?!1:11===e?!1:e>=14&&31>=e?!1:e>=127&&159>=e?!1:e>1114111?!1:!0}function c(e){if(e>65535){e-=65536;var t=55296+(e>>10),r=56320+(1023&e);return String.fromCharCode(t,r)}return String.fromCharCode(e)}function u(e,t){var r=0;return i(A,t)?A[t]:35===t.charCodeAt(0)&&C.test(t)&&(r="x"===t[1].toLowerCase()?parseInt(t.slice(2),16):parseInt(t.slice(1),10),l(r))?c(r):e}function p(e){return e.indexOf("\\")<0?e:e.replace(y,"$1")}function h(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(w,function(e,t,r){return t?t:u(e,r)})}function f(e){return q[e]}function d(e){return D.test(e)?e.replace(S,f):e}function g(e){return e.replace(N,"\\$&")}function m(e){switch(e){case 9:case 32:return!0}return!1}function _(e){if(e>=8192&&8202>=e)return!0;switch(e){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 b(e){return L.test(e)}function k(e){switch(e){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 v(e){return e.trim().replace(/\s+/g," ").toUpperCase()}var x=Object.prototype.hasOwnProperty,y=/\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g,E=/&([a-z#][a-z0-9]{1,31});/gi,w=new RegExp(y.source+"|"+E.source,"gi"),C=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,A=e("./entities"),D=/[&<>"]/,S=/[&<>"]/g,q={"&":"&","<":"<",">":">",'"':"""},N=/[.?*+^$[\]\\(){}|-]/g,L=e("uc.micro/categories/P/regex");r.lib={},r.lib.mdurl=e("mdurl"),r.lib.ucmicro=e("uc.micro"),r.assign=o,r.isString=s,r.has=i,r.unescapeMd=p,r.unescapeAll=h,r.isValidEntityCode=l,r.fromCodePoint=c,r.escapeHtml=d,r.arrayReplaceAt=a,r.isSpace=m,r.isWhiteSpace=_,r.isMdAsciiPunct=k,r.isPunctChar=b,r.escapeRE=g,r.normalizeReference=v},{"./entities":26,mdurl:84,"uc.micro":90,"uc.micro/categories/P/regex":88}],31:[function(e,t,r){"use strict";r.parseLinkLabel=e("./parse_link_label"),r.parseLinkDestination=e("./parse_link_destination"),r.parseLinkTitle=e("./parse_link_title")},{"./parse_link_destination":32,"./parse_link_label":33,"./parse_link_title":34}],32:[function(e,t,r){"use strict";var n=e("../common/utils").unescapeAll;t.exports=function(e,t,r){var s,i,o=0,a=t,l={ok:!1,pos:0,lines:0,str:""};if(60===e.charCodeAt(t)){for(t++;r>t;){if(s=e.charCodeAt(t),10===s)return l;if(62===s)return l.pos=t+1,l.str=n(e.slice(a+1,t)),l.ok=!0,l;92===s&&r>t+1?t+=2:t++}return l}for(i=0;r>t&&(s=e.charCodeAt(t),32!==s)&&!(32>s||127===s);)if(92===s&&r>t+1)t+=2;else{if(40===s&&(i++,i>1))break;if(41===s&&(i--,0>i))break;t++}return a===t?l:(l.str=n(e.slice(a,t)),l.lines=o,l.pos=t,l.ok=!0,l)}},{"../common/utils":30}],33:[function(e,t,r){"use strict";t.exports=function(e,t,r){var n,s,i,o,a=-1,l=e.posMax,c=e.pos;for(e.pos=t+1,n=1;e.pos=r)return l;if(i=e.charCodeAt(t),34!==i&&39!==i&&40!==i)return l;for(t++,40===i&&(i=41);r>t;){if(s=e.charCodeAt(t),s===i)return l.pos=t+1,l.lines=o,l.str=n(e.slice(a+1,t)),l.ok=!0,l;10===s?o++:92===s&&r>t+1&&(t++,10===e.charCodeAt(t)&&o++),t++}return l}},{"../common/utils":30}],35:[function(e,t,r){"use strict";function n(e){var t=e.trim().toLowerCase();return _.test(t)?b.test(t)?!0:!1:!0}function s(e){var t=d.parse(e,!0);if(t.hostname&&(!t.protocol||k.indexOf(t.protocol)>=0))try{t.hostname=g.toASCII(t.hostname)}catch(r){}return d.encode(d.format(t))}function i(e){var t=d.parse(e,!0);if(t.hostname&&(!t.protocol||k.indexOf(t.protocol)>=0))try{t.hostname=g.toUnicode(t.hostname)}catch(r){}return d.decode(d.format(t))}function o(e,t){return this instanceof o?(t||a.isString(e)||(t=e||{},e="default"),this.inline=new h,this.block=new p,this.core=new u,this.renderer=new c,this.linkify=new f,this.validateLink=n,this.normalizeLink=s,this.normalizeLinkText=i,this.utils=a,this.helpers=l,this.options={},this.configure(e),void(t&&this.set(t))):new o(e,t)}var a=e("./common/utils"),l=e("./helpers"),c=e("./renderer"),u=e("./parser_core"),p=e("./parser_block"),h=e("./parser_inline"),f=e("linkify-it"),d=e("mdurl"),g=e("punycode"),m={"default":e("./presets/default"),zero:e("./presets/zero"),commonmark:e("./presets/commonmark")},_=/^(vbscript|javascript|file|data):/,b=/^data:image\/(gif|png|jpeg|webp);/,k=["http:","https:","mailto:"];o.prototype.set=function(e){return a.assign(this.options,e),this},o.prototype.configure=function(e){var t,r=this;if(a.isString(e)&&(t=e,e=m[t],!e))throw new Error('Wrong `markdown-it` preset "'+t+'", check name');if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&r.set(e.options),e.components&&Object.keys(e.components).forEach(function(t){e.components[t].rules&&r[t].ruler.enableOnly(e.components[t].rules),e.components[t].rules2&&r[t].ruler2.enableOnly(e.components[t].rules2)}),this},o.prototype.enable=function(e,t){var r=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(t){r=r.concat(this[t].ruler.enable(e,!0))},this),r=r.concat(this.inline.ruler2.enable(e,!0));var n=e.filter(function(e){return r.indexOf(e)<0});if(n.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+n);return this},o.prototype.disable=function(e,t){var r=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(t){r=r.concat(this[t].ruler.disable(e,!0))},this),r=r.concat(this.inline.ruler2.disable(e,!0));var n=e.filter(function(e){return r.indexOf(e)<0});if(n.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+n);return this},o.prototype.use=function(e){var t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this},o.prototype.parse=function(e,t){var r=new this.core.State(e,this,t);return this.core.process(r),r.tokens},o.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)},o.prototype.parseInline=function(e,t){var r=new this.core.State(e,this,t);return r.inlineMode=!0,this.core.process(r),r.tokens},o.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)},t.exports=o},{"./common/utils":30,"./helpers":31,"./parser_block":36,"./parser_core":37,"./parser_inline":38,"./presets/commonmark":39,"./presets/default":40,"./presets/zero":41,"./renderer":42,"linkify-it":79,mdurl:84,punycode:4}],36:[function(e,t,r){"use strict";function n(){this.ruler=new s;for(var e=0;ea&&(e.line=a=e.skipEmptyLines(a),!(a>=r))&&!(e.sCount[a]=c){e.line=r;break}for(s=0;o>s&&!(n=i[s](e,a,r,!1));s++);if(e.tight=!l,e.isEmpty(e.line-1)&&(l=!0),a=e.line,r>a&&e.isEmpty(a)){if(l=!0,a++,r>a&&"list"===e.parentType&&e.isEmpty(a))break;e.line=a}}},n.prototype.parse=function(e,t,r,n){var s;return e?(s=new this.State(e,t,r,n),void this.tokenize(s,s.line,s.lineMax)):[]},n.prototype.State=e("./rules_block/state_block"),t.exports=n},{"./ruler":43,"./rules_block/blockquote":44,"./rules_block/code":45,"./rules_block/fence":46,"./rules_block/heading":47,"./rules_block/hr":48,"./rules_block/html_block":49,"./rules_block/lheading":50,"./rules_block/list":51,"./rules_block/paragraph":52,"./rules_block/reference":53,"./rules_block/state_block":54,"./rules_block/table":55}],37:[function(e,t,r){"use strict";function n(){this.ruler=new s;for(var e=0;et;t++)n[t](e)},n.prototype.State=e("./rules_core/state_core"),t.exports=n},{"./ruler":43,"./rules_core/block":56,"./rules_core/inline":57,"./rules_core/linkify":58,"./rules_core/normalize":59,"./rules_core/replacements":60,"./rules_core/smartquotes":61,"./rules_core/state_core":62}],38:[function(e,t,r){"use strict";function n(){var e;for(this.ruler=new s,e=0;et;t++)if(n[t](e,!0))return void(o[r]=e.pos);e.pos++,o[r]=e.pos},n.prototype.tokenize=function(e){for(var t,r,n=this.ruler.getRules(""),s=n.length,i=e.posMax,o=e.md.options.maxNesting;e.posr&&!(t=n[r](e,!1));r++);if(t){if(e.pos>=i)break}else e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},n.prototype.parse=function(e,t,r,n){var s,i,o,a=new this.State(e,t,r,n);for(this.tokenize(a),i=this.ruler2.getRules(""),o=i.length,s=0;o>s;s++)i[s](a)},n.prototype.State=e("./rules_inline/state_inline"),t.exports=n},{"./ruler":43,"./rules_inline/autolink":63,"./rules_inline/backticks":64,"./rules_inline/balance_pairs":65,"./rules_inline/emphasis":66,"./rules_inline/entity":67,"./rules_inline/escape":68,"./rules_inline/html_inline":69,"./rules_inline/image":70,"./rules_inline/link":71,"./rules_inline/newline":72,"./rules_inline/state_inline":73,"./rules_inline/strikethrough":74,"./rules_inline/text":75,"./rules_inline/text_collapse":76}],39:[function(e,t,r){"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"]}}}},{}],40:[function(e,t,r){"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:{}}}},{}],41:[function(e,t,r){"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"]}}}},{}],42:[function(e,t,r){"use strict";function n(){this.rules=s({},a)}var s=e("./common/utils").assign,i=e("./common/utils").unescapeAll,o=e("./common/utils").escapeHtml,a={};a.code_inline=function(e,t){return""+o(e[t].content)+""},a.code_block=function(e,t){return"
"+o(e[t].content)+"
\n"},a.fence=function(e,t,r,n,s){var a,l=e[t],c=l.info?i(l.info).trim():"",u="";return c&&(u=c.split(/\s+/g)[0],l.attrJoin("class",r.langPrefix+u)),a=r.highlight?r.highlight(l.content,u)||o(l.content):o(l.content),0===a.indexOf(""+a+"
\n"},a.image=function(e,t,r,n,s){var i=e[t];return i.attrs[i.attrIndex("alt")][1]=s.renderInlineAsText(i.children,r,n),s.renderToken(e,t,r)},a.hardbreak=function(e,t,r){return r.xhtmlOut?"
\n":"
\n"},a.softbreak=function(e,t,r){return r.breaks?r.xhtmlOut?"
\n":"
\n":"\n"},a.text=function(e,t){return o(e[t].content)},a.html_block=function(e,t){return e[t].content},a.html_inline=function(e,t){return e[t].content},n.prototype.renderAttrs=function(e){var t,r,n;if(!e.attrs)return"";for(n="",t=0,r=e.attrs.length;r>t;t++)n+=" "+o(e.attrs[t][0])+'="'+o(e.attrs[t][1])+'"';return n},n.prototype.renderToken=function(e,t,r){var n,s="",i=!1,o=e[t];return o.hidden?"":(o.block&&-1!==o.nesting&&t&&e[t-1].hidden&&(s+="\n"),s+=(-1===o.nesting?"\n":">")},n.prototype.renderInline=function(e,t,r){for(var n,s="",i=this.rules,o=0,a=e.length;a>o;o++)n=e[o].type,s+="undefined"!=typeof i[n]?i[n](e,o,t,r,this):this.renderToken(e,o,t);return s},n.prototype.renderInlineAsText=function(e,t,r){for(var n="",s=this.rules,i=0,o=e.length;o>i;i++)"text"===e[i].type?n+=s.text(e,i,t,r,this):"image"===e[i].type&&(n+=this.renderInlineAsText(e[i].children,t,r));return n},n.prototype.render=function(e,t,r){var n,s,i,o="",a=this.rules;for(n=0,s=e.length;s>n;n++)i=e[n].type,o+="inline"===i?this.renderInline(e[n].children,t,r):"undefined"!=typeof a[i]?a[e[n].type](e,n,t,r,this):this.renderToken(e,n,t,r);return o},t.exports=n},{"./common/utils":30}],43:[function(e,t,r){"use strict";function n(){this.__rules__=[],this.__cache__=null}n.prototype.__find__=function(e){for(var t=0;tn){if(t)return;throw new Error("Rules manager: invalid rule name "+e)}this.__rules__[n].enabled=!0,r.push(e)},this),this.__cache__=null,r},n.prototype.enableOnly=function(e,t){Array.isArray(e)||(e=[e]),this.__rules__.forEach(function(e){e.enabled=!1}),this.enable(e,t)},n.prototype.disable=function(e,t){Array.isArray(e)||(e=[e]);var r=[];return e.forEach(function(e){var n=this.__find__(e);if(0>n){if(t)return;throw new Error("Rules manager: invalid rule name "+e)}this.__rules__[n].enabled=!1,r.push(e)},this),this.__cache__=null,r},n.prototype.getRules=function(e){return null===this.__cache__&&this.__compile__(),this.__cache__[e]||[]},t.exports=n},{}],44:[function(e,t,r){"use strict";var n=e("../common/utils").isSpace;t.exports=function(e,t,r,s){var i,o,a,l,c,u,p,h,f,d,g,m,_,b,k,v,x=e.bMarks[t]+e.tShift[t],y=e.eMarks[t];if(62!==e.src.charCodeAt(x++))return!1;if(s)return!0;for(32===e.src.charCodeAt(x)&&x++,u=e.blkIndent,e.blkIndent=0,f=d=e.sCount[t]+x-(e.bMarks[t]+e.tShift[t]),c=[e.bMarks[t]],e.bMarks[t]=x;y>x&&(g=e.src.charCodeAt(x),n(g));)9===g?d+=4-d%4:d++,x++;for(o=x>=y,l=[e.sCount[t]],e.sCount[t]=d-f,a=[e.tShift[t]],e.tShift[t]=x-e.bMarks[t],m=e.md.block.ruler.getRules("blockquote"),i=t+1;r>i&&!(e.sCount[i]=y));i++)if(62!==e.src.charCodeAt(x++)){if(o)break;for(v=!1,b=0,k=m.length;k>b;b++)if(m[b](e,i,r,!0)){v=!0;break}if(v)break;c.push(e.bMarks[i]),a.push(e.tShift[i]),l.push(e.sCount[i]),e.sCount[i]=-1}else{for(32===e.src.charCodeAt(x)&&x++,f=d=e.sCount[i]+x-(e.bMarks[i]+e.tShift[i]),c.push(e.bMarks[i]),e.bMarks[i]=x;y>x&&(g=e.src.charCodeAt(x),n(g));)9===g?d+=4-d%4:d++,x++;o=x>=y,l.push(e.sCount[i]),e.sCount[i]=d-f,a.push(e.tShift[i]),e.tShift[i]=x-e.bMarks[i]}for(p=e.parentType,e.parentType="blockquote",_=e.push("blockquote_open","blockquote",1),_.markup=">",_.map=h=[t,0],e.md.block.tokenize(e,t,i),_=e.push("blockquote_close","blockquote",-1),_.markup=">",e.parentType=p,h[1]=e.line,b=0;bn;)if(e.isEmpty(n))n++;else{if(!(e.sCount[n]-e.blkIndent>=4))break;n++,s=n}return e.line=n,i=e.push("code_block","code",0),i.content=e.getLines(t,s,4+e.blkIndent,!0),i.map=[t,e.line],!0}},{}],46:[function(e,t,r){"use strict";t.exports=function(e,t,r,n){var s,i,o,a,l,c,u,p=!1,h=e.bMarks[t]+e.tShift[t],f=e.eMarks[t];if(h+3>f)return!1;if(s=e.src.charCodeAt(h),126!==s&&96!==s)return!1;if(l=h,h=e.skipChars(h,s),i=h-l,3>i)return!1;if(u=e.src.slice(l,h),o=e.src.slice(h,f),o.indexOf("`")>=0)return!1;if(n)return!0;for(a=t;(a++,!(a>=r))&&(h=l=e.bMarks[a]+e.tShift[a],f=e.eMarks[a],!(f>h&&e.sCount[a]=4||(h=e.skipChars(h,s),i>h-l||(h=e.skipSpaces(h),f>h)))){p=!0;break}return i=e.sCount[t],e.line=a+(p?1:0),c=e.push("fence","code",0),c.info=o,c.content=e.getLines(t+1,a,i,!0),c.markup=u,c.map=[t,e.line],!0}},{}],47:[function(e,t,r){"use strict";var n=e("../common/utils").isSpace;t.exports=function(e,t,r,s){var i,o,a,l,c=e.bMarks[t]+e.tShift[t],u=e.eMarks[t];if(i=e.src.charCodeAt(c),35!==i||c>=u)return!1;for(o=1,i=e.src.charCodeAt(++c);35===i&&u>c&&6>=o;)o++,i=e.src.charCodeAt(++c);return o>6||u>c&&32!==i?!1:s?!0:(u=e.skipSpacesBack(u,c),a=e.skipCharsBack(u,35,c),a>c&&n(e.src.charCodeAt(a-1))&&(u=a),e.line=t+1,l=e.push("heading_open","h"+String(o),1),l.markup="########".slice(0,o),l.map=[t,e.line],l=e.push("inline","",0),l.content=e.src.slice(c,u).trim(),l.map=[t,e.line],l.children=[],l=e.push("heading_close","h"+String(o),-1),l.markup="########".slice(0,o),!0)}},{"../common/utils":30}],48:[function(e,t,r){"use strict";var n=e("../common/utils").isSpace;t.exports=function(e,t,r,s){var i,o,a,l,c=e.bMarks[t]+e.tShift[t],u=e.eMarks[t];if(i=e.src.charCodeAt(c++),42!==i&&45!==i&&95!==i)return!1;for(o=1;u>c;){if(a=e.src.charCodeAt(c++),a!==i&&!n(a))return!1;a===i&&o++}return 3>o?!1:s?!0:(e.line=t+1,l=e.push("hr","hr",0),l.map=[t,e.line],l.markup=Array(o+1).join(String.fromCharCode(i)),!0)}},{"../common/utils":30}],49:[function(e,t,r){"use strict";var n=e("../common/html_blocks"),s=e("../common/html_re").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(s.source+"\\s*$"),/^$/,!1]];t.exports=function(e,t,r,n){var s,o,a,l,c=e.bMarks[t]+e.tShift[t],u=e.eMarks[t];if(!e.md.options.html)return!1;if(60!==e.src.charCodeAt(c))return!1;for(l=e.src.slice(c,u),s=0;so&&!(e.sCount[o]=r?!1:e.sCount[l]3?!1:(s=e.bMarks[l]+e.tShift[l],i=e.eMarks[l],s>=i?!1:(n=e.src.charCodeAt(s),45!==n&&61!==n?!1:(s=e.skipChars(s,n),s=e.skipSpaces(s),i>s?!1:(s=e.bMarks[t]+e.tShift[t],e.line=l+1,a=61===n?1:2,o=e.push("heading_open","h"+String(a),1),o.markup=String.fromCharCode(n),o.map=[t,e.line],o=e.push("inline","",0),o.content=e.src.slice(s,e.eMarks[t]).trim(),o.map=[t,e.line-1],o.children=[],o=e.push("heading_close","h"+String(a),-1),o.markup=String.fromCharCode(n),!0))))}},{}],51:[function(e,t,r){"use strict";function n(e,t){var r,n,s,i;return n=e.bMarks[t]+e.tShift[t],s=e.eMarks[t],r=e.src.charCodeAt(n++),42!==r&&45!==r&&43!==r?-1:s>n&&(i=e.src.charCodeAt(n),!o(i))?-1:n}function s(e,t){var r,n=e.bMarks[t]+e.tShift[t],s=n,i=e.eMarks[t];if(s+1>=i)return-1;if(r=e.src.charCodeAt(s++),48>r||r>57)return-1;for(;;){if(s>=i)return-1;r=e.src.charCodeAt(s++);{if(!(r>=48&&57>=r)){if(41===r||46===r)break;return-1}if(s-n>=10)return-1}}return i>s&&(r=e.src.charCodeAt(s),!o(r))?-1:s}function i(e,t){var r,n,s=e.level+2;for(r=t+2,n=e.tokens.length-2;n>r;r++)e.tokens[r].level===s&&"paragraph_open"===e.tokens[r].type&&(e.tokens[r+2].hidden=!0,e.tokens[r].hidden=!0,r+=2)}var o=e("../common/utils").isSpace;t.exports=function(e,t,r,a){var l,c,u,p,h,f,d,g,m,_,b,k,v,x,y,E,w,C,A,D,S,q,N,L,F,M,R,T,z=!0;if((b=s(e,t))>=0)C=!0;else{if(!((b=n(e,t))>=0))return!1;C=!1}if(w=e.src.charCodeAt(b-1),a)return!0;for(D=e.tokens.length,C?(_=e.bMarks[t]+e.tShift[t],E=Number(e.src.substr(_,b-_-1)),F=e.push("ordered_list_open","ol",1),1!==E&&(F.attrs=[["start",E]])):F=e.push("bullet_list_open","ul",1),F.map=q=[t,0],F.markup=String.fromCharCode(w),l=t,S=!1,L=e.md.block.ruler.getRules("list");r>l;){for(v=b,x=e.eMarks[l],c=u=e.sCount[l]+b-(e.bMarks[t]+e.tShift[t]);x>v&&(k=e.src.charCodeAt(v),o(k));)9===k?u+=4-u%4:u++,v++;if(A=v,y=A>=x?1:u-c,y>4&&(y=1),p=c+y,F=e.push("list_item_open","li",1),F.markup=String.fromCharCode(w),F.map=N=[t,0],f=e.blkIndent,g=e.tight,h=e.tShift[t],d=e.sCount[t],m=e.parentType,e.blkIndent=p,e.tight=!0,e.parentType="list",e.tShift[t]=A-e.bMarks[t],e.sCount[t]=u,e.md.block.tokenize(e,t,r,!0),(!e.tight||S)&&(z=!1),S=e.line-t>1&&e.isEmpty(e.line-1),e.blkIndent=f,e.tShift[t]=h,e.sCount[t]=d,e.tight=g,e.parentType=m,F=e.push("list_item_close","li",-1),F.markup=String.fromCharCode(w),l=t=e.line,N[1]=l,A=e.bMarks[t],l>=r)break;if(e.isEmpty(l))break;if(e.sCount[l]M;M++)if(L[M](e,l,r,!0)){T=!0;break}if(T)break;if(C){if(b=s(e,l),0>b)break}else if(b=n(e,l),0>b)break;if(w!==e.src.charCodeAt(b-1))break}return F=C?e.push("ordered_list_close","ol",-1):e.push("bullet_list_close","ul",-1),F.markup=String.fromCharCode(w),q[1]=l,e.line=l,z&&i(e,D),!0}},{"../common/utils":30}],52:[function(e,t,r){"use strict";t.exports=function(e,t){for(var r,n,s,i,o,a=t+1,l=e.md.block.ruler.getRules("paragraph"),c=e.lineMax;c>a&&!e.isEmpty(a);a++)if(!(e.sCount[a]-e.blkIndent>3||e.sCount[a]<0)){for(n=!1,s=0,i=l.length;i>s;s++)if(l[s](e,a,c,!0)){n=!0;break}if(n)break}return r=e.getLines(t,a,e.blkIndent,!1).trim(),e.line=a,o=e.push("paragraph_open","p",1),o.map=[t,e.line],o=e.push("inline","",0),o.content=r,o.map=[t,e.line],o.children=[],o=e.push("paragraph_close","p",-1),!0}},{}],53:[function(e,t,r){"use strict";var n=e("../helpers/parse_link_destination"),s=e("../helpers/parse_link_title"),i=e("../common/utils").normalizeReference,o=e("../common/utils").isSpace;t.exports=function(e,t,r,a){var l,c,u,p,h,f,d,g,m,_,b,k,v,x,y,E=0,w=e.bMarks[t]+e.tShift[t],C=e.eMarks[t],A=t+1;if(91!==e.src.charCodeAt(w))return!1;for(;++wA&&!e.isEmpty(A);A++)if(!(e.sCount[A]-e.blkIndent>3||e.sCount[A]<0)){for(v=!1,f=0,d=x.length;d>f;f++)if(x[f](e,A,p,!0)){v=!0;break}if(v)break}for(k=e.getLines(t,A,e.blkIndent,!1).trim(),C=k.length,w=1;C>w;w++){if(l=k.charCodeAt(w),91===l)return!1;if(93===l){m=w;break}10===l?E++:92===l&&(w++,C>w&&10===k.charCodeAt(w)&&E++)}if(0>m||58!==k.charCodeAt(m+1))return!1;for(w=m+2;C>w;w++)if(l=k.charCodeAt(w),10===l)E++;else if(!o(l))break;if(_=n(k,w,C),!_.ok)return!1;if(h=e.md.normalizeLink(_.str),!e.md.validateLink(h))return!1;for(w=_.pos,E+=_.lines,c=w,u=E,b=w;C>w;w++)if(l=k.charCodeAt(w),10===l)E++;else if(!o(l))break;for(_=s(k,w,C),C>w&&b!==w&&_.ok?(y=_.str,w=_.pos,E+=_.lines):(y="",w=c,E=u);C>w&&(l=k.charCodeAt(w),o(l));)w++;if(C>w&&10!==k.charCodeAt(w)&&y)for(y="",w=c,E=u;C>w&&(l=k.charCodeAt(w),o(l));)w++;return C>w&&10!==k.charCodeAt(w)?!1:(g=i(k.slice(1,m)))?a?!0:("undefined"==typeof e.env.references&&(e.env.references={}),"undefined"==typeof e.env.references[g]&&(e.env.references[g]={title:y,href:h}),e.line=t+E+1,!0):!1}},{"../common/utils":30,"../helpers/parse_link_destination":32,"../helpers/parse_link_title":34}],54:[function(e,t,r){"use strict";function n(e,t,r,n){var s,o,a,l,c,u,p,h;for(this.src=e,this.md=t,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="",o=this.src,h=!1,a=l=u=p=0,c=o.length;c>l;l++){if(s=o.charCodeAt(l),!h){if(i(s)){u++,9===s?p+=4-p%4:p++;continue}h=!0}(10===s||l===c-1)&&(10!==s&&l++,this.bMarks.push(a),this.eMarks.push(l),this.tShift.push(u),this.sCount.push(p),h=!1,u=0,p=0,a=l+1)}this.bMarks.push(o.length),this.eMarks.push(o.length),this.tShift.push(0),this.sCount.push(0),this.lineMax=this.bMarks.length-1}var s=e("../token"),i=e("../common/utils").isSpace;n.prototype.push=function(e,t,r){var n=new s(e,t,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(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},n.prototype.skipEmptyLines=function(e){for(var t=this.lineMax;t>e&&!(this.bMarks[e]+this.tShift[e]e&&(t=this.src.charCodeAt(e),i(t));e++);return e},n.prototype.skipSpacesBack=function(e,t){if(t>=e)return e;for(;e>t;)if(!i(this.src.charCodeAt(--e)))return e+1;return e},n.prototype.skipChars=function(e,t){for(var r=this.src.length;r>e&&this.src.charCodeAt(e)===t;e++);return e},n.prototype.skipCharsBack=function(e,t,r){if(r>=e)return e;for(;e>r;)if(t!==this.src.charCodeAt(--e))return e+1;return e},n.prototype.getLines=function(e,t,r,n){var s,o,a,l,c,u,p,h=e;if(e>=t)return"";for(u=new Array(t-e),s=0;t>h;h++,s++){for(o=0,p=l=this.bMarks[h],c=t>h+1||n?this.eMarks[h]+1:this.eMarks[h];c>l&&r>o;){if(a=this.src.charCodeAt(l),i(a))9===a?o+=4-o%4:o++;else{if(!(l-pn;)96===t&&i%2===0?(a=!a,l=n):124!==t||i%2!==0||a?92===t?i++:i=0:(r.push(e.substring(o,n)),o=n+1),n++,n===s&&a&&(a=!1,n=l+1),t=e.charCodeAt(n);return r.push(e.substring(o)),r}t.exports=function(e,t,r,i){var o,a,l,c,u,p,h,f,d,g,m,_;if(t+2>r)return!1;if(u=t+1,e.sCount[u]=e.eMarks[u])return!1;if(o=e.src.charCodeAt(l),124!==o&&45!==o&&58!==o)return!1;if(a=n(e,t+1),!/^[-:| ]+$/.test(a))return!1;for(p=a.split("|"),d=[],c=0;cd.length)return!1;if(i)return!0;for(f=e.push("table_open","table",1),f.map=m=[t,0],f=e.push("thead_open","thead",1),f.map=[t,t+1],f=e.push("tr_open","tr",1),f.map=[t,t+1],c=0;cu&&!(e.sCount[u]c;c++)f=e.push("td_open","td",1),d[c]&&(f.attrs=[["style","text-align:"+d[c]]]),f=e.push("inline","",0), 3 | f.content=p[c]?p[c].trim():"",f.children=[],f=e.push("td_close","td",-1);f=e.push("tr_close","tr",-1)}return f=e.push("tbody_close","tbody",-1),f=e.push("table_close","table",-1),m[1]=_[1]=u,e.line=u,!0}},{}],56:[function(e,t,r){"use strict";t.exports=function(e){var t;e.inlineMode?(t=new e.Token("inline","",0),t.content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}},{}],57:[function(e,t,r){"use strict";t.exports=function(e){var t,r,n,s=e.tokens;for(r=0,n=s.length;n>r;r++)t=s[r],"inline"===t.type&&e.md.inline.parse(t.content,e.md,e.env,t.children)}},{}],58:[function(e,t,r){"use strict";function n(e){return/^\s]/i.test(e)}function s(e){return/^<\/a\s*>/i.test(e)}var i=e("../common/utils").arrayReplaceAt;t.exports=function(e){var t,r,o,a,l,c,u,p,h,f,d,g,m,_,b,k,v,x=e.tokens;if(e.md.options.linkify)for(r=0,o=x.length;o>r;r++)if("inline"===x[r].type&&e.md.linkify.pretest(x[r].content))for(a=x[r].children,m=0,t=a.length-1;t>=0;t--)if(c=a[t],"link_close"!==c.type){if("html_inline"===c.type&&(n(c.content)&&m>0&&m--,s(c.content)&&m++),!(m>0)&&"text"===c.type&&e.md.linkify.test(c.content)){for(h=c.content,v=e.md.linkify.match(h),u=[],g=c.level,d=0,p=0;pd&&(l=new e.Token("text","",0),l.content=h.slice(d,f),l.level=g,u.push(l)),l=new e.Token("link_open","a",1),l.attrs=[["href",b]],l.level=g++,l.markup="linkify",l.info="auto",u.push(l),l=new e.Token("text","",0),l.content=k,l.level=g,u.push(l),l=new e.Token("link_close","a",-1),l.level=--g,l.markup="linkify",l.info="auto",u.push(l),d=v[p].lastIndex);d=0;t--)r=e[t],"text"===r.type&&(r.content=r.content.replace(l,n))}function i(e){var t,r;for(t=e.length-1;t>=0;t--)r=e[t],"text"===r.type&&o.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 o=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,a=/\((c|tm|r|p)\)/i,l=/\((c|tm|r|p)\)/gi,c={c:"©",r:"®",p:"§",tm:"™"};t.exports=function(e){var t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)"inline"===e.tokens[t].type&&(a.test(e.tokens[t].content)&&s(e.tokens[t].children),o.test(e.tokens[t].content)&&i(e.tokens[t].children))}},{}],61:[function(e,t,r){"use strict";function n(e,t,r){return e.substr(0,t)+r+e.substr(t+1)}function s(e,t){var r,s,l,p,h,f,d,g,m,_,b,k,v,x,y,E,w,C,A,D,S;for(A=[],r=0;r=0&&!(A[w].level<=d);w--);if(A.length=w+1,"text"===s.type){l=s.content,h=0,f=l.length;e:for(;f>h&&(c.lastIndex=h,p=c.exec(l));){if(y=E=!0,h=p.index+1,C="'"===p[0],m=32,p.index-1>=0)m=l.charCodeAt(p.index-1);else for(w=r-1;w>=0;w--)if("text"===e[w].type){m=e[w].content.charCodeAt(e[w].content.length-1);break}if(_=32,f>h)_=l.charCodeAt(h);else for(w=r+1;w=48&&57>=m&&(E=y=!1),y&&E&&(y=!1,E=k),y||E){if(E)for(w=A.length-1;w>=0&&(g=A[w],!(A[w].level=0;t--)"inline"===e.tokens[t].type&&l.test(e.tokens[t].content)&&s(e.tokens[t].children,e)}},{"../common/utils":30}],62:[function(e,t,r){"use strict";function n(e,t,r){this.src=e,this.env=r,this.tokens=[],this.inlineMode=!1,this.md=t}var s=e("../token");n.prototype.Token=s,t.exports=n},{"../token":77}],63:[function(e,t,r){"use strict";var n=e("../common/url_schemas"),s=/^<([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(e,t){var r,o,a,l,c,u,p=e.pos;return 60!==e.src.charCodeAt(p)?!1:(r=e.src.slice(p),r.indexOf(">")<0?!1:i.test(r)?(o=r.match(i),n.indexOf(o[1].toLowerCase())<0?!1:(l=o[0].slice(1,-1),c=e.md.normalizeLink(l),e.md.validateLink(c)?(t||(u=e.push("link_open","a",1),u.attrs=[["href",c]],u.markup="autolink",u.info="auto",u=e.push("text","",0),u.content=e.md.normalizeLinkText(l),u=e.push("link_close","a",-1),u.markup="autolink",u.info="auto"),e.pos+=o[0].length,!0):!1)):s.test(r)?(a=r.match(s),l=a[0].slice(1,-1),c=e.md.normalizeLink("mailto:"+l),e.md.validateLink(c)?(t||(u=e.push("link_open","a",1),u.attrs=[["href",c]],u.markup="autolink",u.info="auto",u=e.push("text","",0),u.content=e.md.normalizeLinkText(l),u=e.push("link_close","a",-1),u.markup="autolink",u.info="auto"),e.pos+=a[0].length,!0):!1):!1)}},{"../common/url_schemas":29}],64:[function(e,t,r){"use strict";t.exports=function(e,t){var r,n,s,i,o,a,l=e.pos,c=e.src.charCodeAt(l);if(96!==c)return!1;for(r=l,l++,n=e.posMax;n>l&&96===e.src.charCodeAt(l);)l++;for(s=e.src.slice(r,l),i=o=l;-1!==(i=e.src.indexOf("`",o));){for(o=i+1;n>o&&96===e.src.charCodeAt(o);)o++;if(o-i===s.length)return t||(a=e.push("code_inline","code",0),a.markup=s,a.content=e.src.slice(l,i).replace(/[ \n]+/g," ").trim()),e.pos=o,!0}return t||(e.pending+=s),e.pos+=s.length,!0}},{}],65:[function(e,t,r){"use strict";t.exports=function(e){var t,r,n,s,i=e.delimiters,o=e.delimiters.length;for(t=0;o>t;t++)if(n=i[t],n.close)for(r=t-n.jump-1;r>=0;){if(s=i[r],s.open&&s.marker===n.marker&&s.end<0&&s.level===n.level){n.jump=t-r,n.open=!1,s.end=t,s.jump=0;break}r-=s.jump+1}}},{}],66:[function(e,t,r){"use strict";t.exports.tokenize=function(e,t){var r,n,s,i=e.pos,o=e.src.charCodeAt(i);if(t)return!1;if(95!==o&&42!==o)return!1;for(n=e.scanDelims(e.pos,42===o),r=0;rt;t++)r=a[t],(95===r.marker||42===r.marker)&&-1!==r.end&&(n=a[r.end],o=l>t+1&&a[t+1].end===r.end-1&&a[t+1].token===r.token+1&&a[r.end-1].token===n.token-1&&a[t+1].marker===r.marker,i=String.fromCharCode(r.marker),s=e.tokens[r.token],s.type=o?"strong_open":"em_open",s.tag=o?"strong":"em",s.nesting=1,s.markup=o?i+i:i,s.content="",s=e.tokens[n.token],s.type=o?"strong_close":"em_close",s.tag=o?"strong":"em",s.nesting=-1,s.markup=o?i+i:i,s.content="",o&&(e.tokens[a[t+1].token].content="",e.tokens[a[r.end-1].token].content="",t++))}},{}],67:[function(e,t,r){"use strict";var n=e("../common/entities"),s=e("../common/utils").has,i=e("../common/utils").isValidEntityCode,o=e("../common/utils").fromCodePoint,a=/^&#((?:x[a-f0-9]{1,8}|[0-9]{1,8}));/i,l=/^&([a-z][a-z0-9]{1,31});/i;t.exports=function(e,t){var r,c,u,p=e.pos,h=e.posMax;if(38!==e.src.charCodeAt(p))return!1;if(h>p+1)if(r=e.src.charCodeAt(p+1),35===r){if(u=e.src.slice(p).match(a))return t||(c="x"===u[1][0].toLowerCase()?parseInt(u[1].slice(1),16):parseInt(u[1],10),e.pending+=o(i(c)?c:65533)),e.pos+=u[0].length,!0}else if(u=e.src.slice(p).match(l),u&&s(n,u[1]))return t||(e.pending+=n[u[1]]),e.pos+=u[0].length,!0;return t||(e.pending+="&"),e.pos++,!0}},{"../common/entities":26,"../common/utils":30}],68:[function(e,t,r){"use strict";for(var n=e("../common/utils").isSpace,s=[],i=0;256>i;i++)s.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){s[e.charCodeAt(0)]=1}),t.exports=function(e,t){var r,i=e.pos,o=e.posMax;if(92!==e.src.charCodeAt(i))return!1;if(i++,o>i){if(r=e.src.charCodeAt(i),256>r&&0!==s[r])return t||(e.pending+=e.src[i]),e.pos+=2,!0;if(10===r){for(t||e.push("hardbreak","br",0),i++;o>i&&(r=e.src.charCodeAt(i),n(r));)i++;return e.pos=i,!0}}return t||(e.pending+="\\"),e.pos++,!0}},{"../common/utils":30}],69:[function(e,t,r){"use strict";function n(e){var t=32|e;return t>=97&&122>=t}var s=e("../common/html_re").HTML_TAG_RE;t.exports=function(e,t){var r,i,o,a,l=e.pos;return e.md.options.html?(o=e.posMax,60!==e.src.charCodeAt(l)||l+2>=o?!1:(r=e.src.charCodeAt(l+1),(33===r||63===r||47===r||n(r))&&(i=e.src.slice(l).match(s))?(t||(a=e.push("html_inline","",0),a.content=e.src.slice(l,l+i[0].length)),e.pos+=i[0].length,!0):!1)):!1}},{"../common/html_re":28}],70:[function(e,t,r){"use strict";var n=e("../helpers/parse_link_label"),s=e("../helpers/parse_link_destination"),i=e("../helpers/parse_link_title"),o=e("../common/utils").normalizeReference,a=e("../common/utils").isSpace;t.exports=function(e,t){var r,l,c,u,p,h,f,d,g,m,_,b,k,v="",x=e.pos,y=e.posMax;if(33!==e.src.charCodeAt(e.pos))return!1;if(91!==e.src.charCodeAt(e.pos+1))return!1;if(h=e.pos+2,p=n(e,e.pos+1,!1),0>p)return!1;if(f=p+1,y>f&&40===e.src.charCodeAt(f)){for(f++;y>f&&(l=e.src.charCodeAt(f),a(l)||10===l);f++);if(f>=y)return!1;for(k=f,g=s(e.src,f,e.posMax),g.ok&&(v=e.md.normalizeLink(g.str),e.md.validateLink(v)?f=g.pos:v=""),k=f;y>f&&(l=e.src.charCodeAt(f),a(l)||10===l);f++);if(g=i(e.src,f,e.posMax),y>f&&k!==f&&g.ok)for(m=g.str,f=g.pos;y>f&&(l=e.src.charCodeAt(f),a(l)||10===l);f++);else m="";if(f>=y||41!==e.src.charCodeAt(f))return e.pos=x,!1;f++}else{if("undefined"==typeof e.env.references)return!1;for(;y>f&&(l=e.src.charCodeAt(f),a(l)||10===l);f++);if(y>f&&91===e.src.charCodeAt(f)?(k=f+1,f=n(e,f),f>=0?u=e.src.slice(k,f++):f=p+1):f=p+1,u||(u=e.src.slice(h,p)),d=e.env.references[o(u)],!d)return e.pos=x,!1;v=d.href,m=d.title}return t||(c=e.src.slice(h,p),e.md.inline.parse(c,e.md,e.env,b=[]),_=e.push("image","img",0),_.attrs=r=[["src",v],["alt",""]],_.children=b,_.content=c,m&&r.push(["title",m])),e.pos=f,e.posMax=y,!0}},{"../common/utils":30,"../helpers/parse_link_destination":32,"../helpers/parse_link_label":33,"../helpers/parse_link_title":34}],71:[function(e,t,r){"use strict";var n=e("../helpers/parse_link_label"),s=e("../helpers/parse_link_destination"),i=e("../helpers/parse_link_title"),o=e("../common/utils").normalizeReference,a=e("../common/utils").isSpace;t.exports=function(e,t){var r,l,c,u,p,h,f,d,g,m,_="",b=e.pos,k=e.posMax,v=e.pos;if(91!==e.src.charCodeAt(e.pos))return!1;if(p=e.pos+1,u=n(e,e.pos,!0),0>u)return!1;if(h=u+1,k>h&&40===e.src.charCodeAt(h)){for(h++;k>h&&(l=e.src.charCodeAt(h),a(l)||10===l);h++);if(h>=k)return!1;for(v=h,f=s(e.src,h,e.posMax),f.ok&&(_=e.md.normalizeLink(f.str),e.md.validateLink(_)?h=f.pos:_=""),v=h;k>h&&(l=e.src.charCodeAt(h),a(l)||10===l);h++);if(f=i(e.src,h,e.posMax),k>h&&v!==h&&f.ok)for(g=f.str,h=f.pos;k>h&&(l=e.src.charCodeAt(h),a(l)||10===l);h++);else g="";if(h>=k||41!==e.src.charCodeAt(h))return e.pos=b,!1;h++}else{if("undefined"==typeof e.env.references)return!1;for(;k>h&&(l=e.src.charCodeAt(h),a(l)||10===l);h++);if(k>h&&91===e.src.charCodeAt(h)?(v=h+1,h=n(e,h),h>=0?c=e.src.slice(v,h++):h=u+1):h=u+1,c||(c=e.src.slice(p,u)),d=e.env.references[o(c)],!d)return e.pos=b,!1;_=d.href,g=d.title}return t||(e.pos=p,e.posMax=u,m=e.push("link_open","a",1),m.attrs=r=[["href",_]],g&&r.push(["title",g]),e.md.inline.tokenize(e),m=e.push("link_close","a",-1)),e.pos=h,e.posMax=k,!0}},{"../common/utils":30,"../helpers/parse_link_destination":32,"../helpers/parse_link_label":33,"../helpers/parse_link_title":34}],72:[function(e,t,r){"use strict";t.exports=function(e,t){var r,n,s=e.pos;if(10!==e.src.charCodeAt(s))return!1;for(r=e.pending.length-1,n=e.posMax,t||(r>=0&&32===e.pending.charCodeAt(r)?r>=1&&32===e.pending.charCodeAt(r-1)?(e.pending=e.pending.replace(/ +$/,""),e.push("hardbreak","br",0)):(e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0)):e.push("softbreak","br",0)),s++;n>s&&32===e.src.charCodeAt(s);)s++;return e.pos=s,!0}},{}],73:[function(e,t,r){"use strict";function n(e,t,r,n){this.src=e,this.env=r,this.md=t,this.tokens=n,this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[]}var s=e("../token"),i=e("../common/utils").isWhiteSpace,o=e("../common/utils").isPunctChar,a=e("../common/utils").isMdAsciiPunct;n.prototype.pushPending=function(){var e=new s("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e},n.prototype.push=function(e,t,r){this.pending&&this.pushPending();var n=new s(e,t,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(e,t){var r,n,s,l,c,u,p,h,f,d=e,g=!0,m=!0,_=this.posMax,b=this.src.charCodeAt(e);for(r=e>0?this.src.charCodeAt(e-1):32;_>d&&this.src.charCodeAt(d)===b;)d++;return s=d-e,n=_>d?this.src.charCodeAt(d):32,p=a(r)||o(String.fromCharCode(r)),f=a(n)||o(String.fromCharCode(n)),u=i(r),h=i(n),h?g=!1:f&&(u||p||(g=!1)),u?m=!1:p&&(h||f||(m=!1)),t?(l=g,c=m):(l=g&&(!m||p),c=m&&(!g||f)),{can_open:l,can_close:c,length:s}},n.prototype.Token=s,t.exports=n},{"../common/utils":30,"../token":77}],74:[function(e,t,r){"use strict";t.exports.tokenize=function(e,t){var r,n,s,i,o,a=e.pos,l=e.src.charCodeAt(a);if(t)return!1;if(126!==l)return!1;if(n=e.scanDelims(e.pos,!0),i=n.length,o=String.fromCharCode(l),2>i)return!1;for(i%2&&(s=e.push("text","",0),s.content=o,i--),r=0;i>r;r+=2)s=e.push("text","",0),s.content=o+o,e.delimiters.push({marker:l,jump:r,token:e.tokens.length-1,level:e.level,end:-1,open:n.can_open,close:n.can_close});return e.pos+=n.length,!0},t.exports.postProcess=function(e){var t,r,n,s,i,o=[],a=e.delimiters,l=e.delimiters.length;for(t=0;l>t;t++)n=a[t],126===n.marker&&-1!==n.end&&(s=a[n.end],i=e.tokens[n.token],i.type="s_open",i.tag="s",i.nesting=1,i.markup="~~",i.content="",i=e.tokens[s.token],i.type="s_close",i.tag="s",i.nesting=-1,i.markup="~~",i.content="","text"===e.tokens[s.token-1].type&&"~"===e.tokens[s.token-1].content&&o.push(s.token-1));for(;o.length;){for(t=o.pop(),r=t+1;rt;t++)n+=s[t].nesting,s[t].level=n,"text"===s[t].type&&i>t+1&&"text"===s[t+1].type?s[t+1].content=s[t].content+s[t+1].content:(t!==r&&(s[r]=s[t]),r++);t!==r&&(s.length=r)}},{}],77:[function(e,t,r){"use strict";function n(e,t,r){this.type=e,this.tag=t,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}n.prototype.attrIndex=function(e){var t,r,n;if(!this.attrs)return-1;for(t=this.attrs,r=0,n=t.length;n>r;r++)if(t[r][0]===e)return r;return-1},n.prototype.attrPush=function(e){this.attrs?this.attrs.push(e):this.attrs=[e]},n.prototype.attrSet=function(e,t){var r=this.attrIndex(e),n=[e,t];0>r?this.attrPush(n):this.attrs[r]=n},n.prototype.attrJoin=function(e,t){var r=this.attrIndex(e);0>r?this.attrPush([e,t]):this.attrs[r][1]=this.attrs[r][1]+" "+t},t.exports=n},{}],78:[function(e,t,r){t.exports={Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",amp:"&",AMP:"&",andand:"⩕",And:"⩓",and:"∧",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angmsd:"∡",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",apacir:"⩯",ap:"≈",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",barwed:"⌅",Barwed:"⌆",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",because:"∵",Because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxdl:"┐",boxdL:"╕",boxDl:"╖",boxDL:"╗",boxdr:"┌",boxdR:"╒",boxDr:"╓",boxDR:"╔",boxh:"─",boxH:"═",boxhd:"┬",boxHd:"╤",boxhD:"╥",boxHD:"╦",boxhu:"┴",boxHu:"╧",boxhU:"╨",boxHU:"╩",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxul:"┘",boxuL:"╛",boxUl:"╜",boxUL:"╝",boxur:"└",boxuR:"╘",boxUr:"╙",boxUR:"╚",boxv:"│",boxV:"║",boxvh:"┼",boxvH:"╪",boxVh:"╫",boxVH:"╬",boxvl:"┤",boxvL:"╡",boxVl:"╢",boxVL:"╣",boxvr:"├",boxvR:"╞",boxVr:"╟",boxVR:"╠",bprime:"‵",breve:"˘",Breve:"˘",brvbar:"¦",bscr:"𝒷",Bscr:"ℬ",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsolb:"⧅",bsol:"\\",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",capand:"⩄",capbrcup:"⩉",capcap:"⩋",cap:"∩",Cap:"⋒",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",CenterDot:"·",cfr:"𝔠",Cfr:"ℭ",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cir:"○",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",colon:":",Colon:"∷",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",conint:"∮",Conint:"∯",ContourIntegral:"∮",copf:"𝕔",Copf:"ℂ",coprod:"∐",Coproduct:"∐",copy:"©",COPY:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",cross:"✗",Cross:"⨯",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cupbrcap:"⩈",cupcap:"⩆",CupCap:"≍",cup:"∪",Cup:"⋓",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dagger:"†",Dagger:"‡",daleth:"ℸ",darr:"↓",Darr:"↡",dArr:"⇓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",ddagger:"‡",ddarr:"⇊",DD:"ⅅ",dd:"ⅆ",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",diamond:"⋄",Diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrowBar:"⤓",downarrow:"↓",DownArrow:"↓",Downarrow:"⇓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVectorBar:"⥖",DownLeftVector:"↽",DownRightTeeVector:"⥟",DownRightVectorBar:"⥗",DownRightVector:"⇁",DownTeeArrow:"↧",DownTee:"⊤",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",Ecirc:"Ê",ecirc:"ê",ecir:"≖",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",edot:"ė",eDot:"≑",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp13:" ",emsp14:" ",emsp:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",escr:"ℯ",Escr:"ℰ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",exponentiale:"ⅇ",ExponentialE:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",forall:"∀",ForAll:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"𝒻",Fscr:"ℱ",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",ge:"≥",gE:"≧",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",gescc:"⪩",ges:"⩾",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",gg:"≫",Gg:"⋙",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gla:"⪥",gl:"≷",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gnE:"≩",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",gtcc:"⪧",gtcir:"⩺",gt:">",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:"⥼",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:"⤄", 4 | 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:"‌"}},{}],79:[function(e,t,r){"use strict";function n(e){var t=Array.prototype.slice.call(arguments,1);return t.forEach(function(t){t&&Object.keys(t).forEach(function(r){e[r]=t[r]})}),e}function s(e){return Object.prototype.toString.call(e)}function i(e){return"[object String]"===s(e)}function o(e){return"[object Object]"===s(e)}function a(e){return"[object RegExp]"===s(e)}function l(e){return"[object Function]"===s(e)}function c(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function u(e){return Object.keys(e||{}).reduce(function(e,t){return e||b.hasOwnProperty(t)},!1)}function p(e){e.__index__=-1,e.__text_cache__=""}function h(e){return function(t,r){var n=t.slice(r);return e.test(n)?n.match(e)[0].length:0}}function f(){return function(e,t){t.normalize(e)}}function d(t){function r(e){return e.replace("%TLDS%",u.src_tlds)}function s(e,t){throw new Error('(LinkifyIt) Invalid schema "'+e+'": '+t)}var u=t.re=n({},e("./lib/re")),d=t.__tlds__.slice();t.__tlds_replaced__||d.push(v),d.push(u.src_xn),u.src_tlds=d.join("|"),u.email_fuzzy=RegExp(r(u.tpl_email_fuzzy),"i"),u.link_fuzzy=RegExp(r(u.tpl_link_fuzzy),"i"),u.link_no_ip_fuzzy=RegExp(r(u.tpl_link_no_ip_fuzzy),"i"),u.host_fuzzy_test=RegExp(r(u.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,o(r)?(a(r.validate)?n.validate=h(r.validate):l(r.validate)?n.validate=r.validate:s(e,r),void(l(r.normalize)?n.normalize=r.normalize:r.normalize?s(e,r):n.normalize=f())):i(r)?void g.push(e):void s(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:f()};var m=Object.keys(t.__compiled__).filter(function(e){return e.length>0&&t.__compiled__[e]}).map(c).join("|");t.re.schema_test=RegExp("(^|(?!_)(?:>|"+u.src_ZPCc+"))("+m+")","i"),t.re.schema_search=RegExp("(^|(?!_)(?:>|"+u.src_ZPCc+"))("+m+")","ig"),t.re.pretest=RegExp("("+t.re.schema_test.source+")|("+t.re.host_fuzzy_test.source+")|@","i"),p(t)}function g(e,t){var r=e.__index__,n=e.__last_index__,s=e.__text_cache__.slice(r,n);this.schema=e.__schema__.toLowerCase(),this.index=r+t,this.lastIndex=n+t,this.raw=s,this.text=s,this.url=s}function m(e,t){var r=new g(e,t);return e.__compiled__[r.schema].normalize(r,e),r}function _(e,t){return this instanceof _?(t||u(e)&&(t=e,e={}),this.__opts__=n({},b,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=n({},k,e),this.__compiled__={},this.__tlds__=x,this.__tlds_replaced__=!1,this.re={},void d(this)):new _(e,t)}var b={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1},k={"http:":{validate:function(e,t,r){var n=e.slice(t);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(e,t,r){var n=e.slice(t);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)?t>=3&&":"===e[t-3]?0:n.match(r.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,r){var n=e.slice(t);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}}},v="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]",x="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");_.prototype.add=function(e,t){return this.__schemas__[e]=t,d(this),this},_.prototype.set=function(e){return this.__opts__=n(this.__opts__,e),this},_.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;var t,r,n,s,i,o,a,l,c;if(this.re.schema_test.test(e))for(a=this.re.schema_search,a.lastIndex=0;null!==(t=a.exec(e));)if(s=this.testSchemaAt(e,t[2],a.lastIndex)){this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+s;break}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(l=e.search(this.re.host_fuzzy_test),l>=0&&(this.__index__<0||l=0&&null!==(n=e.match(this.re.email_fuzzy))&&(i=n.index+n[1].length,o=n.index+n[0].length,(this.__index__<0||ithis.__last_index__)&&(this.__schema__="mailto:",this.__index__=i,this.__last_index__=o))),this.__index__>=0},_.prototype.pretest=function(e){return this.re.pretest.test(e)},_.prototype.testSchemaAt=function(e,t,r){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,r,this):0},_.prototype.match=function(e){var t=0,r=[];this.__index__>=0&&this.__text_cache__===e&&(r.push(m(this,t)),t=this.__last_index__);for(var n=t?e.slice(t):e;this.test(n);)r.push(m(this,t)),n=n.slice(this.__last_index__),t+=this.__last_index__;return r.length?r:null},_.prototype.tlds=function(e,t){return e=Array.isArray(e)?e:[e],t?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(e,t,r){return e!==r[t-1]}).reverse(),d(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,d(this),this)},_.prototype.normalize=function(e){e.schema||(e.url="http://"+e.url),"mailto:"!==e.schema||/^mailto:/i.test(e.url)||(e.url="mailto:"+e.url)},t.exports=_},{"./lib/re":80}],80:[function(e,t,r){"use strict";var n=r.src_Any=e("uc.micro/properties/Any/regex").source,s=r.src_Cc=e("uc.micro/categories/Cc/regex").source,i=r.src_Z=e("uc.micro/categories/Z/regex").source,o=r.src_P=e("uc.micro/categories/P/regex").source,a=r.src_ZPCc=[i,o,s].join("|"),l=r.src_ZCc=[i,s].join("|"),c="(?:(?!"+a+")"+n+")",u="(?:(?![0-9]|"+a+")"+n+")",p=r.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]?)";r.src_auth="(?:(?:(?!"+l+").)+@)?";var h=r.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",f=r.src_host_terminator="(?=$|"+a+")(?!-|_|:\\d|\\.-|\\.(?!$|"+a+"))",d=r.src_path="(?:[/?#](?:(?!"+l+"|[()[\\]{}.,\"'?!\\-]).|\\[(?:(?!"+l+"|\\]).)*\\]|\\((?:(?!"+l+"|[)]).)*\\)|\\{(?:(?!"+l+'|[}]).)*\\}|\\"(?:(?!'+l+'|["]).)+\\"|\\\'(?:(?!'+l+"|[']).)+\\'|\\'(?="+c+").|\\.{2,3}[a-zA-Z0-9%/]|\\.(?!"+l+"|[.]).|\\-(?!--(?:[^-]|$))(?:-*)|\\,(?!"+l+").|\\!(?!"+l+"|[!]).|\\?(?!"+l+"|[?]).)+|\\/)?",g=r.src_email_name='[\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]+',m=r.src_xn="xn--[a-z0-9\\-]{1,59}",_=r.src_domain_root="(?:"+m+"|"+u+"{1,63})",b=r.src_domain="(?:"+m+"|(?:"+c+")|(?:"+c+"(?:-(?!-)|"+c+"){0,61}"+c+"))",k=r.src_host="(?:"+p+"|(?:(?:(?:"+b+")\\.)*"+_+"))",v=r.tpl_host_fuzzy="(?:"+p+"|(?:(?:(?:"+b+")\\.)+(?:%TLDS%)))",x=r.tpl_host_no_ip_fuzzy="(?:(?:(?:"+b+")\\.)+(?:%TLDS%))";r.src_host_strict=k+f;var y=r.tpl_host_fuzzy_strict=v+f;r.src_host_port_strict=k+h+f;var E=r.tpl_host_port_fuzzy_strict=v+h+f,w=r.tpl_host_port_no_ip_fuzzy_strict=x+h+f;r.tpl_host_fuzzy_test="localhost|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+a+"|$))",r.tpl_email_fuzzy="(^|>|"+l+")("+g+"@"+y+")",r.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`|]|"+a+"))((?![$+<=>^`|])"+E+d+")",r.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`|]|"+a+"))((?![$+<=>^`|])"+w+d+")"},{"uc.micro/categories/Cc/regex":86,"uc.micro/categories/P/regex":88,"uc.micro/categories/Z/regex":89,"uc.micro/properties/Any/regex":91}],81:[function(e,t,r){"use strict";function n(e){var t,r,n=i[e];if(n)return n;for(n=i[e]=[],t=0;128>t;t++)r=String.fromCharCode(t),n.push(r);for(t=0;tt;t+=3)s=parseInt(e.slice(t+1,t+3),16),128>s?c+=r[s]:192===(224&s)&&n>t+3&&(i=parseInt(e.slice(t+4,t+6),16),128===(192&i))?(l=s<<6&1984|63&i,c+=128>l?"��":String.fromCharCode(l),t+=3):224===(240&s)&&n>t+6&&(i=parseInt(e.slice(t+4,t+6),16),o=parseInt(e.slice(t+7,t+9),16),128===(192&i)&&128===(192&o))?(l=s<<12&61440|i<<6&4032|63&o,c+=2048>l||l>=55296&&57343>=l?"���":String.fromCharCode(l),t+=6):240===(248&s)&&n>t+9&&(i=parseInt(e.slice(t+4,t+6),16),o=parseInt(e.slice(t+7,t+9),16),a=parseInt(e.slice(t+10,t+12),16),128===(192&i)&&128===(192&o)&&128===(192&a))?(l=s<<18&1835008|i<<12&258048|o<<6&4032|63&a,65536>l||l>1114111?c+="����":(l-=65536,c+=String.fromCharCode(55296+(l>>10),56320+(1023&l))),t+=9):c+="�";return c})}var i={};s.defaultChars=";/?:@&=+$,#",s.componentChars="",t.exports=s},{}],82:[function(e,t,r){"use strict";function n(e){var t,r,n=i[e];if(n)return n;for(n=i[e]=[],t=0;128>t;t++)r=String.fromCharCode(t),/^[0-9a-z]$/i.test(r)?n.push(r):n.push("%"+("0"+t.toString(16).toUpperCase()).slice(-2));for(t=0;ti;i++)if(a=e.charCodeAt(i),r&&37===a&&o>i+2&&/^[0-9a-f]{2}$/i.test(e.slice(i+1,i+3)))u+=e.slice(i,i+3),i+=2;else if(128>a)u+=c[a];else if(a>=55296&&57343>=a){if(a>=55296&&56319>=a&&o>i+1&&(l=e.charCodeAt(i+1),l>=56320&&57343>=l)){u+=encodeURIComponent(e[i]+e[i+1]),i++;continue}u+="%EF%BF%BD"}else u+=encodeURIComponent(e[i]);return u}var i={};s.defaultChars=";/?:@&=+$,-_.!~*'()#",s.componentChars="-_.!~*'()",t.exports=s},{}],83:[function(e,t,r){"use strict";t.exports=function(e){var t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",t+=e.hostname&&-1!==e.hostname.indexOf(":")?"["+e.hostname+"]":e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||""}},{}],84:[function(e,t,r){"use strict";t.exports.encode=e("./encode"),t.exports.decode=e("./decode"),t.exports.format=e("./format"),t.exports.parse=e("./parse")},{"./decode":81,"./encode":82,"./format":83,"./parse":85}],85:[function(e,t,r){"use strict";function n(){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 s(e,t){if(e&&e instanceof n)return e;var r=new n;return r.parse(e,t),r}var i=/^([a-z0-9.+-]+:)/i,o=/:[0-9]*$/,a=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,l=["<",">",'"',"`"," ","\r","\n"," "],c=["{","}","|","\\","^","`"].concat(l),u=["'"].concat(c),p=["%","/","?",";","#"].concat(u),h=["/","?","#"],f=255,d=/^[+a-z0-9A-Z_-]{0,63}$/,g=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},_={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};n.prototype.parse=function(e,t){var r,n,s,o,l,c=e;if(c=c.trim(),!t&&1===e.split("#").length){var u=a.exec(c);if(u)return this.pathname=u[1],u[2]&&(this.search=u[2]),this}var b=i.exec(c);if(b&&(b=b[0],s=b.toLowerCase(),this.protocol=b,c=c.substr(b.length)),(t||b||c.match(/^\/\/[^@\/]+@[^@\/]+/))&&(l="//"===c.substr(0,2),!l||b&&m[b]||(c=c.substr(2),this.slashes=!0)),!m[b]&&(l||b&&!_[b])){var k=-1;for(r=0;ro)&&(k=o);var v,x;for(x=-1===k?c.lastIndexOf("@"):c.lastIndexOf("@",k),-1!==x&&(v=c.slice(0,x),c=c.slice(x+1),this.auth=v),k=-1,r=0;ro)&&(k=o);-1===k&&(k=c.length),":"===c[k-1]&&k--;var y=c.slice(0,k);c=c.slice(k),this.parseHost(y),this.hostname=this.hostname||"";var E="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!E){var w=this.hostname.split(/\./);for(r=0,n=w.length;n>r;r++){var C=w[r];if(C&&!C.match(d)){for(var A="",D=0,S=C.length;S>D;D++)A+=C.charCodeAt(D)>127?"x":C[D];if(!A.match(d)){var q=w.slice(0,r),N=w.slice(r+1),L=C.match(g);L&&(q.push(L[1]),N.unshift(L[2])),N.length&&(c=N.join(".")+c),this.hostname=q.join(".");break}}}}this.hostname.length>f&&(this.hostname=""),E&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}var F=c.indexOf("#");-1!==F&&(this.hash=c.substr(F),c=c.slice(0,F));var M=c.indexOf("?");return-1!==M&&(this.search=c.substr(M),c=c.slice(0,M)),c&&(this.pathname=c),_[s]&&this.hostname&&!this.pathname&&(this.pathname=""),this},n.prototype.parseHost=function(e){var t=o.exec(e);t&&(t=t[0],":"!==t&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)},t.exports=s},{}],86:[function(e,t,r){t.exports=/[\0-\x1F\x7F-\x9F]/},{}],87:[function(e,t,r){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]/},{}],88:[function(e,t,r){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/},{}],89:[function(e,t,r){t.exports=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/},{}],90:[function(e,t,r){t.exports.Any=e("./properties/Any/regex"),t.exports.Cc=e("./categories/Cc/regex"),t.exports.Cf=e("./categories/Cf/regex"),t.exports.P=e("./categories/P/regex"),t.exports.Z=e("./categories/Z/regex")},{"./categories/Cc/regex":86,"./categories/Cf/regex":87,"./categories/P/regex":88,"./categories/Z/regex":89,"./properties/Any/regex":91}],91:[function(e,t,r){t.exports=/[\0-\uD7FF\uDC00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF]/},{}],92:[function(e,t,r){"use strict";function n(e){var t=s(e,f);return-1===t.search(p)?t:s(t,h)}function s(e,t){return t.reduce(function(e,t){return e.replace(t[0],t[1])},e)}function i(e){return null===e||void 0===e?"":e.toString()}function o(e){return n(i(e)).replace(u,"-").replace(a,"-").replace(l,"-").replace(c,"").trim().toLowerCase()}var a=/\s+/g,l=/[-_]+/g,c=/^-|-$/g,u=/[^\x20\x2D0-9A-Z\x5Fa-z\xC0-\xD6\xD8-\xF6\xF8-\xFF]/g,p=/[\xC0-\xFF]/g,h=[[/[\xC0-\xC5]/g,"A"],[/[\xC6]/g,"AE"],[/[\xC7]/g,"C"],[/[\xC8-\xCB]/g,"E"],[/[\xCC-\xCF]/g,"I"],[/[\xD0]/g,"D"],[/[\xD1]/g,"N"],[/[\xD2-\xD6\xD8]/g,"O"],[/[\xD9-\xDC]/g,"U"],[/[\xDD]/g,"Y"],[/[\xDE]/g,"P"],[/[\xE0-\xE5]/g,"a"],[/[\xE6]/g,"ae"],[/[\xE7]/g,"c"],[/[\xE8-\xEB]/g,"e"],[/[\xEC-\xEF]/g,"i"],[/[\xF1]/g,"n"],[/[\xF2-\xF6\xF8]/g,"o"],[/[\xF9-\xFC]/g,"u"],[/[\xFE]/g,"p"],[/[\xFD\xFF]/g,"y"]],f=[[/&/g," and "],[/\./g,""]];t.exports=o},{}],93:[function(e,t,r){"use strict";function n(e,t,r){var n=e.slice(0,t),s=e.slice(t+1);return n.concat(r,s)}function s(e){return/^\s]/i.test(e)}function i(e){return/^<\/a\s*>/i.test(e)}function o(e,t){function r(e){return w=e(y[f].url,y[f].text),"string"==typeof w}var o,a,l,c,u,p,h,f,d,g,m,_,b,k,v,x,y,E=e.tokens;if(e.md.options.linkify){for(a=0,l=E.length;l>a;a++)if("inline"===E[a].type&&e.md.linkify.pretest(E[a].content))for(c=E[a].children,b=0,o=c.length-1;o>=0;o--)if(p=c[o],"link_close"!==p.type){if("html_inline"===p.type&&(s(p.content)&&b>0&&b--,i(p.content)&&b++),!(b>0)&&"text"===p.type&&e.md.linkify.test(p.content)){for(d=p.content,y=e.md.linkify.match(d),h=[],_=p.level,m=0,f=0;fm&&(u=new e.Token("text","",0),u.content=d.slice(m,g),u.level=_,h.push(u)),w=null,t.linkifiers.some(r),"string"==typeof w?h.push({type:"html_block",content:w,level:_}):(u=new e.Token("link_open","a",1),u.attrs=[["href",v]],u.level=_++,u.markup="linkify",u.info="auto",h.push(u),u=new e.Token("text","",0),u.content=x,u.level=_,h.push(u),u=new e.Token("link_close","a",-1),u.level=--_,u.markup="linkify",u.info="auto",h.push(u)),m=y[f].lastIndex);m