summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorVse Mozhet Byt <vsemozhetbyt@gmail.com>2017-07-03 03:05:59 +0300
committerVse Mozhet Byt <vsemozhetbyt@gmail.com>2017-07-05 06:51:10 +0300
commit15599cbc977af3bc2a94365adc6687ca5e2bde04 (patch)
treefd4c0022ed9e2059fb5e979332cb247627d077f0 /tools
parent5100cc6851e5513b9e11f7e6244436ba48c79f2b (diff)
downloadandroid-node-v8-15599cbc977af3bc2a94365adc6687ca5e2bde04.tar.gz
android-node-v8-15599cbc977af3bc2a94365adc6687ca5e2bde04.tar.bz2
android-node-v8-15599cbc977af3bc2a94365adc6687ca5e2bde04.zip
tools: update: eslint-plugin-markdown@1.0.0-beta.7
* Remove pinning of eslint-plugin-markdown An issue affecting Node.js source has been fixed in eslint-plugin-markdown so we don't need to pin it to beta-4 anymore. Refs: https://github.com/eslint/eslint-plugin-markdown/issues/69 * Update eslint-plugin-markdown up to 1.0.0-beta.7 * Fix docs for eslint-plugin-markdown@1.0.0-beta.7 PR-URL: https://github.com/nodejs/node/pull/14047 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/eslint/node_modules/ccount/history.md11
-rw-r--r--tools/eslint/node_modules/ccount/index.js46
-rw-r--r--tools/eslint/node_modules/ccount/readme.md57
-rw-r--r--tools/eslint/node_modules/character-entities-html4/index.json254
-rw-r--r--tools/eslint/node_modules/character-entities-html4/package.json98
-rw-r--r--tools/eslint/node_modules/character-entities-html4/readme.md52
-rw-r--r--tools/eslint/node_modules/eslint-plugin-markdown/README.md23
-rw-r--r--tools/eslint/node_modules/eslint-plugin-markdown/lib/processor.js65
-rw-r--r--tools/eslint/node_modules/eslint-plugin-markdown/package.json42
-rw-r--r--tools/eslint/node_modules/is-buffer/LICENSE (renamed from tools/eslint/node_modules/parse5/LICENSE)4
-rw-r--r--tools/eslint/node_modules/is-buffer/README.md49
-rw-r--r--tools/eslint/node_modules/is-buffer/index.js21
-rw-r--r--tools/eslint/node_modules/is-buffer/package.json77
-rw-r--r--tools/eslint/node_modules/is-plain-obj/index.js7
-rw-r--r--tools/eslint/node_modules/is-plain-obj/license21
-rw-r--r--tools/eslint/node_modules/is-plain-obj/package.json68
-rw-r--r--tools/eslint/node_modules/is-plain-obj/readme.md35
-rw-r--r--tools/eslint/node_modules/is-whitespace-character/LICENSE (renamed from tools/eslint/node_modules/ccount/LICENSE)2
-rw-r--r--tools/eslint/node_modules/is-whitespace-character/history.md (renamed from tools/eslint/node_modules/longest-streak/history.md)7
-rw-r--r--tools/eslint/node_modules/is-whitespace-character/index.js33
-rw-r--r--tools/eslint/node_modules/is-whitespace-character/package.json111
-rw-r--r--tools/eslint/node_modules/is-whitespace-character/readme.md63
-rw-r--r--tools/eslint/node_modules/is-word-character/LICENSE (renamed from tools/eslint/node_modules/character-entities-html4/LICENSE)2
-rw-r--r--tools/eslint/node_modules/is-word-character/history.md6
-rw-r--r--tools/eslint/node_modules/is-word-character/index.js33
-rw-r--r--tools/eslint/node_modules/is-word-character/package.json109
-rw-r--r--tools/eslint/node_modules/is-word-character/readme.md62
-rw-r--r--tools/eslint/node_modules/longest-streak/index.js51
-rw-r--r--tools/eslint/node_modules/longest-streak/package.json83
-rw-r--r--tools/eslint/node_modules/longest-streak/readme.md52
-rw-r--r--tools/eslint/node_modules/markdown-escapes/LICENSE (renamed from tools/eslint/node_modules/markdown-table/LICENSE)2
-rw-r--r--tools/eslint/node_modules/markdown-escapes/history.md6
-rw-r--r--tools/eslint/node_modules/markdown-escapes/index.js75
-rw-r--r--tools/eslint/node_modules/markdown-escapes/package.json109
-rw-r--r--tools/eslint/node_modules/markdown-escapes/readme.md71
-rw-r--r--tools/eslint/node_modules/markdown-table/Readme.md132
-rw-r--r--tools/eslint/node_modules/markdown-table/index.js284
-rw-r--r--tools/eslint/node_modules/markdown-table/package.json72
-rw-r--r--tools/eslint/node_modules/parse5/README.md40
-rw-r--r--tools/eslint/node_modules/parse5/lib/common/doctype.js137
-rw-r--r--tools/eslint/node_modules/parse5/lib/common/foreign_content.js260
-rw-r--r--tools/eslint/node_modules/parse5/lib/common/html.js266
-rw-r--r--tools/eslint/node_modules/parse5/lib/common/merge_options.js13
-rw-r--r--tools/eslint/node_modules/parse5/lib/common/unicode.js47
-rw-r--r--tools/eslint/node_modules/parse5/lib/index.js108
-rw-r--r--tools/eslint/node_modules/parse5/lib/location_info/parser_mixin.js217
-rw-r--r--tools/eslint/node_modules/parse5/lib/location_info/tokenizer_mixin.js169
-rw-r--r--tools/eslint/node_modules/parse5/lib/parser/formatting_element_list.js167
-rw-r--r--tools/eslint/node_modules/parse5/lib/parser/index.js2817
-rw-r--r--tools/eslint/node_modules/parse5/lib/parser/open_element_stack.js395
-rw-r--r--tools/eslint/node_modules/parse5/lib/parser/stream.js140
-rw-r--r--tools/eslint/node_modules/parse5/lib/sax/dev_null_stream.js14
-rw-r--r--tools/eslint/node_modules/parse5/lib/sax/index.js230
-rw-r--r--tools/eslint/node_modules/parse5/lib/sax/parser_feedback_simulator.js153
-rw-r--r--tools/eslint/node_modules/parse5/lib/serializer/index.js180
-rw-r--r--tools/eslint/node_modules/parse5/lib/serializer/stream.js49
-rw-r--r--tools/eslint/node_modules/parse5/lib/tokenizer/index.js2101
-rw-r--r--tools/eslint/node_modules/parse5/lib/tokenizer/named_entity_trie.js6
-rw-r--r--tools/eslint/node_modules/parse5/lib/tokenizer/preprocessor.js155
-rw-r--r--tools/eslint/node_modules/parse5/lib/tree_adapters/default.js578
-rw-r--r--tools/eslint/node_modules/parse5/lib/tree_adapters/htmlparser2.js327
-rw-r--r--tools/eslint/node_modules/parse5/package.json113
-rw-r--r--tools/eslint/node_modules/remark-parse/index.js30
-rw-r--r--tools/eslint/node_modules/remark-parse/lib/block-elements.json116
-rw-r--r--tools/eslint/node_modules/remark-parse/lib/decode.js71
-rw-r--r--tools/eslint/node_modules/remark-parse/lib/defaults.js20
-rw-r--r--tools/eslint/node_modules/remark-parse/lib/escapes.json75
-rw-r--r--tools/eslint/node_modules/remark-parse/lib/locate/break.js25
-rw-r--r--tools/eslint/node_modules/remark-parse/lib/locate/code-inline.js15
-rw-r--r--tools/eslint/node_modules/remark-parse/lib/locate/delete.js15
-rw-r--r--tools/eslint/node_modules/remark-parse/lib/locate/emphasis.js26
-rw-r--r--tools/eslint/node_modules/remark-parse/lib/locate/escape.js15
-rw-r--r--tools/eslint/node_modules/remark-parse/lib/locate/link.js24
-rw-r--r--tools/eslint/node_modules/remark-parse/lib/locate/strong.js26
-rw-r--r--tools/eslint/node_modules/remark-parse/lib/locate/tag.js15
-rw-r--r--tools/eslint/node_modules/remark-parse/lib/locate/url.js34
-rw-r--r--tools/eslint/node_modules/remark-parse/lib/parse.js53
-rw-r--r--tools/eslint/node_modules/remark-parse/lib/parser.js6428
-rw-r--r--tools/eslint/node_modules/remark-parse/lib/set-options.js59
-rw-r--r--tools/eslint/node_modules/remark-parse/lib/tokenize/auto-link.js151
-rw-r--r--tools/eslint/node_modules/remark-parse/lib/tokenize/blockquote.js137
-rw-r--r--tools/eslint/node_modules/remark-parse/lib/tokenize/break.js51
-rw-r--r--tools/eslint/node_modules/remark-parse/lib/tokenize/code-fenced.js245
-rw-r--r--tools/eslint/node_modules/remark-parse/lib/tokenize/code-indented.js106
-rw-r--r--tools/eslint/node_modules/remark-parse/lib/tokenize/code-inline.js120
-rw-r--r--tools/eslint/node_modules/remark-parse/lib/tokenize/definition.js287
-rw-r--r--tools/eslint/node_modules/remark-parse/lib/tokenize/delete.js69
-rw-r--r--tools/eslint/node_modules/remark-parse/lib/tokenize/emphasis.js94
-rw-r--r--tools/eslint/node_modules/remark-parse/lib/tokenize/escape.js43
-rw-r--r--tools/eslint/node_modules/remark-parse/lib/tokenize/footnote-definition.js194
-rw-r--r--tools/eslint/node_modules/remark-parse/lib/tokenize/heading-atx.js150
-rw-r--r--tools/eslint/node_modules/remark-parse/lib/tokenize/heading-setext.js116
-rw-r--r--tools/eslint/node_modules/remark-parse/lib/tokenize/html-block.js103
-rw-r--r--tools/eslint/node_modules/remark-parse/lib/tokenize/html-inline.js63
-rw-r--r--tools/eslint/node_modules/remark-parse/lib/tokenize/link.js399
-rw-r--r--tools/eslint/node_modules/remark-parse/lib/tokenize/list.js494
-rw-r--r--tools/eslint/node_modules/remark-parse/lib/tokenize/newline.js55
-rw-r--r--tools/eslint/node_modules/remark-parse/lib/tokenize/paragraph.js130
-rw-r--r--tools/eslint/node_modules/remark-parse/lib/tokenize/reference.js219
-rw-r--r--tools/eslint/node_modules/remark-parse/lib/tokenize/strong.js93
-rw-r--r--tools/eslint/node_modules/remark-parse/lib/tokenize/table.js276
-rw-r--r--tools/eslint/node_modules/remark-parse/lib/tokenize/text.js67
-rw-r--r--tools/eslint/node_modules/remark-parse/lib/tokenize/thematic-break.js79
-rw-r--r--tools/eslint/node_modules/remark-parse/lib/tokenize/url.js153
-rw-r--r--tools/eslint/node_modules/remark-parse/lib/tokenize/yaml.js74
-rw-r--r--tools/eslint/node_modules/remark-parse/lib/tokenizer.js451
-rw-r--r--tools/eslint/node_modules/remark-parse/lib/unescape.js46
-rw-r--r--tools/eslint/node_modules/remark-parse/lib/util/get-indentation.js46
-rw-r--r--tools/eslint/node_modules/remark-parse/lib/util/html.js33
-rw-r--r--tools/eslint/node_modules/remark-parse/lib/util/interrupt.js51
-rw-r--r--tools/eslint/node_modules/remark-parse/lib/util/normalize.js29
-rw-r--r--tools/eslint/node_modules/remark-parse/lib/util/remove-indentation.js102
-rw-r--r--tools/eslint/node_modules/remark-parse/package.json85
-rw-r--r--tools/eslint/node_modules/remark-parse/readme.md178
-rw-r--r--tools/eslint/node_modules/remark-stringify/index.js30
-rw-r--r--tools/eslint/node_modules/remark-stringify/lib/compiler.js2629
-rw-r--r--tools/eslint/node_modules/remark-stringify/lib/defaults.js32
-rw-r--r--tools/eslint/node_modules/remark-stringify/package.json80
-rw-r--r--tools/eslint/node_modules/remark-stringify/readme.md209
-rw-r--r--tools/eslint/node_modules/remark/cli.js11
-rw-r--r--tools/eslint/node_modules/remark/index.js19
-rw-r--r--tools/eslint/node_modules/remark/package.json77
-rw-r--r--tools/eslint/node_modules/remark/readme.md84
-rw-r--r--tools/eslint/node_modules/replace-ext/LICENSE21
-rw-r--r--tools/eslint/node_modules/replace-ext/README.md50
-rw-r--r--tools/eslint/node_modules/replace-ext/index.js18
-rw-r--r--tools/eslint/node_modules/replace-ext/package.json86
-rw-r--r--tools/eslint/node_modules/state-toggle/LICENSE (renamed from tools/eslint/node_modules/longest-streak/LICENSE)2
-rw-r--r--tools/eslint/node_modules/state-toggle/history.md6
-rw-r--r--tools/eslint/node_modules/state-toggle/index.js45
-rw-r--r--tools/eslint/node_modules/state-toggle/package.json (renamed from tools/eslint/node_modules/ccount/package.json)56
-rw-r--r--tools/eslint/node_modules/state-toggle/readme.md83
-rw-r--r--tools/eslint/node_modules/stringify-entities/LICENSE22
-rw-r--r--tools/eslint/node_modules/stringify-entities/dangerous.json10
-rw-r--r--tools/eslint/node_modules/stringify-entities/index.js132
-rw-r--r--tools/eslint/node_modules/stringify-entities/package.json113
-rw-r--r--tools/eslint/node_modules/stringify-entities/readme.md118
-rw-r--r--tools/eslint/node_modules/unified/history.md85
-rw-r--r--tools/eslint/node_modules/unified/index.js823
-rw-r--r--tools/eslint/node_modules/unified/package.json139
-rw-r--r--tools/eslint/node_modules/unified/readme.md829
-rw-r--r--tools/eslint/node_modules/unist-util-stringify-position/LICENSE22
-rw-r--r--tools/eslint/node_modules/unist-util-stringify-position/index.js50
-rw-r--r--tools/eslint/node_modules/unist-util-stringify-position/package.json102
-rw-r--r--tools/eslint/node_modules/unist-util-stringify-position/readme.md85
-rw-r--r--tools/eslint/node_modules/vfile/history.md56
-rw-r--r--tools/eslint/node_modules/vfile/index.js809
-rw-r--r--tools/eslint/node_modules/vfile/package.json102
-rw-r--r--tools/eslint/node_modules/vfile/readme.md626
-rw-r--r--tools/eslint/node_modules/x-is-function/LICENSE21
-rw-r--r--tools/eslint/node_modules/x-is-function/README.md41
-rw-r--r--tools/eslint/node_modules/x-is-function/index.js3
-rw-r--r--tools/eslint/node_modules/x-is-function/package.json46
-rw-r--r--tools/eslint/node_modules/x-is-string/LICENCE19
-rw-r--r--tools/eslint/node_modules/x-is-string/README.md46
-rw-r--r--tools/eslint/node_modules/x-is-string/index.js7
-rw-r--r--tools/eslint/node_modules/x-is-string/package.json86
-rw-r--r--tools/eslint/package-lock.json110
-rw-r--r--tools/eslint/package.json2
-rw-r--r--tools/icu/README.md2
-rw-r--r--tools/package-lock.json6
-rwxr-xr-xtools/update-eslint.sh6
162 files changed, 8740 insertions, 22329 deletions
diff --git a/tools/eslint/node_modules/ccount/history.md b/tools/eslint/node_modules/ccount/history.md
deleted file mode 100644
index 908b6f7578..0000000000
--- a/tools/eslint/node_modules/ccount/history.md
+++ /dev/null
@@ -1,11 +0,0 @@
-<!--remark setext-->
-
-<!--lint disable no-multiple-toplevel-headings-->
-
-1.0.1 / 2016-07-23
-==================
-
-* Rewrite module ([`c3cd494`](https://github.com/wooorm/ccount/commit/c3cd494))
-
-1.0.0 / 2015-07-12
-==================
diff --git a/tools/eslint/node_modules/ccount/index.js b/tools/eslint/node_modules/ccount/index.js
deleted file mode 100644
index 0d72d6e527..0000000000
--- a/tools/eslint/node_modules/ccount/index.js
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- * @author Titus Wormer
- * @copyright 2015 Titus Wormer
- * @license MIT
- * @module ccount
- * @fileoverview Count characters.
- */
-
-'use strict';
-
-/* Expose. */
-module.exports = ccount;
-
-/**
- * Count how many characters `character` occur in `value`.
- *
- * @example
- * ccount('foo(bar(baz)', '(') // 2
- * ccount('foo(bar(baz)', ')') // 1
- *
- * @param {string} value - Content, coerced to string.
- * @param {string} character - Single character to look
- * for.
- * @return {number} - Count.
- * @throws {Error} - when `character` is not a single
- * character.
- */
-function ccount(value, character) {
- var count = 0;
- var index;
-
- value = String(value);
-
- if (typeof character !== 'string' || character.length !== 1) {
- throw new Error('Expected character');
- }
-
- index = value.indexOf(character);
-
- while (index !== -1) {
- count++;
- index = value.indexOf(character, index + 1);
- }
-
- return count;
-}
diff --git a/tools/eslint/node_modules/ccount/readme.md b/tools/eslint/node_modules/ccount/readme.md
deleted file mode 100644
index d773d12c8c..0000000000
--- a/tools/eslint/node_modules/ccount/readme.md
+++ /dev/null
@@ -1,57 +0,0 @@
-# ccount [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov]
-
-<!--lint disable heading-increment list-item-spacing-->
-
-Count characters.
-
-## Installation
-
-[npm][npm-install]:
-
-```bash
-npm install ccount
-```
-
-## Usage
-
-```javascript
-var ccount = require('ccount');
-
-ccount('foo(bar(baz)', '(') // 2
-ccount('foo(bar(baz)', ')') // 1
-```
-
-## API
-
-### `ccount(value, character)`
-
-Get the total count of `character` in `value`.
-
-###### Parameters
-
-* `value` (`string`) — Content, coerced to string.
-* `character` (`string`) — Single character to look for.
-
-###### Returns
-
-`number` — Number of times `character` occurred in `value`.
-
-## License
-
-[MIT][license] © [Titus Wormer][author]
-
-<!-- Definitions -->
-
-[travis-badge]: https://img.shields.io/travis/wooorm/ccount.svg
-
-[travis]: https://travis-ci.org/wooorm/ccount
-
-[codecov-badge]: https://img.shields.io/codecov/c/github/wooorm/ccount.svg
-
-[codecov]: https://codecov.io/github/wooorm/ccount
-
-[npm-install]: https://docs.npmjs.com/cli/install
-
-[license]: LICENSE
-
-[author]: http://wooorm.com
diff --git a/tools/eslint/node_modules/character-entities-html4/index.json b/tools/eslint/node_modules/character-entities-html4/index.json
deleted file mode 100644
index fa0d7bc7c7..0000000000
--- a/tools/eslint/node_modules/character-entities-html4/index.json
+++ /dev/null
@@ -1,254 +0,0 @@
-{
- "nbsp": " ",
- "iexcl": "¡",
- "cent": "¢",
- "pound": "£",
- "curren": "¤",
- "yen": "¥",
- "brvbar": "¦",
- "sect": "§",
- "uml": "¨",
- "copy": "©",
- "ordf": "ª",
- "laquo": "«",
- "not": "¬",
- "shy": "­",
- "reg": "®",
- "macr": "¯",
- "deg": "°",
- "plusmn": "±",
- "sup2": "²",
- "sup3": "³",
- "acute": "´",
- "micro": "µ",
- "para": "¶",
- "middot": "·",
- "cedil": "¸",
- "sup1": "¹",
- "ordm": "º",
- "raquo": "»",
- "frac14": "¼",
- "frac12": "½",
- "frac34": "¾",
- "iquest": "¿",
- "Agrave": "À",
- "Aacute": "Á",
- "Acirc": "Â",
- "Atilde": "Ã",
- "Auml": "Ä",
- "Aring": "Å",
- "AElig": "Æ",
- "Ccedil": "Ç",
- "Egrave": "È",
- "Eacute": "É",
- "Ecirc": "Ê",
- "Euml": "Ë",
- "Igrave": "Ì",
- "Iacute": "Í",
- "Icirc": "Î",
- "Iuml": "Ï",
- "ETH": "Ð",
- "Ntilde": "Ñ",
- "Ograve": "Ò",
- "Oacute": "Ó",
- "Ocirc": "Ô",
- "Otilde": "Õ",
- "Ouml": "Ö",
- "times": "×",
- "Oslash": "Ø",
- "Ugrave": "Ù",
- "Uacute": "Ú",
- "Ucirc": "Û",
- "Uuml": "Ü",
- "Yacute": "Ý",
- "THORN": "Þ",
- "szlig": "ß",
- "agrave": "à",
- "aacute": "á",
- "acirc": "â",
- "atilde": "ã",
- "auml": "ä",
- "aring": "å",
- "aelig": "æ",
- "ccedil": "ç",
- "egrave": "è",
- "eacute": "é",
- "ecirc": "ê",
- "euml": "ë",
- "igrave": "ì",
- "iacute": "í",
- "icirc": "î",
- "iuml": "ï",
- "eth": "ð",
- "ntilde": "ñ",
- "ograve": "ò",
- "oacute": "ó",
- "ocirc": "ô",
- "otilde": "õ",
- "ouml": "ö",
- "divide": "÷",
- "oslash": "ø",
- "ugrave": "ù",
- "uacute": "ú",
- "ucirc": "û",
- "uuml": "ü",
- "yacute": "ý",
- "thorn": "þ",
- "yuml": "ÿ",
- "fnof": "ƒ",
- "Alpha": "Α",
- "Beta": "Β",
- "Gamma": "Γ",
- "Delta": "Δ",
- "Epsilon": "Ε",
- "Zeta": "Ζ",
- "Eta": "Η",
- "Theta": "Θ",
- "Iota": "Ι",
- "Kappa": "Κ",
- "Lambda": "Λ",
- "Mu": "Μ",
- "Nu": "Ν",
- "Xi": "Ξ",
- "Omicron": "Ο",
- "Pi": "Π",
- "Rho": "Ρ",
- "Sigma": "Σ",
- "Tau": "Τ",
- "Upsilon": "Υ",
- "Phi": "Φ",
- "Chi": "Χ",
- "Psi": "Ψ",
- "Omega": "Ω",
- "alpha": "α",
- "beta": "β",
- "gamma": "γ",
- "delta": "δ",
- "epsilon": "ε",
- "zeta": "ζ",
- "eta": "η",
- "theta": "θ",
- "iota": "ι",
- "kappa": "κ",
- "lambda": "λ",
- "mu": "μ",
- "nu": "ν",
- "xi": "ξ",
- "omicron": "ο",
- "pi": "π",
- "rho": "ρ",
- "sigmaf": "ς",
- "sigma": "σ",
- "tau": "τ",
- "upsilon": "υ",
- "phi": "φ",
- "chi": "χ",
- "psi": "ψ",
- "omega": "ω",
- "thetasym": "ϑ",
- "upsih": "ϒ",
- "piv": "ϖ",
- "bull": "•",
- "hellip": "…",
- "prime": "′",
- "Prime": "″",
- "oline": "‾",
- "frasl": "⁄",
- "weierp": "℘",
- "image": "ℑ",
- "real": "ℜ",
- "trade": "™",
- "alefsym": "ℵ",
- "larr": "←",
- "uarr": "↑",
- "rarr": "→",
- "darr": "↓",
- "harr": "↔",
- "crarr": "↵",
- "lArr": "⇐",
- "uArr": "⇑",
- "rArr": "⇒",
- "dArr": "⇓",
- "hArr": "⇔",
- "forall": "∀",
- "part": "∂",
- "exist": "∃",
- "empty": "∅",
- "nabla": "∇",
- "isin": "∈",
- "notin": "∉",
- "ni": "∋",
- "prod": "∏",
- "sum": "∑",
- "minus": "−",
- "lowast": "∗",
- "radic": "√",
- "prop": "∝",
- "infin": "∞",
- "ang": "∠",
- "and": "∧",
- "or": "∨",
- "cap": "∩",
- "cup": "∪",
- "int": "∫",
- "there4": "∴",
- "sim": "∼",
- "cong": "≅",
- "asymp": "≈",
- "ne": "≠",
- "equiv": "≡",
- "le": "≤",
- "ge": "≥",
- "sub": "⊂",
- "sup": "⊃",
- "nsub": "⊄",
- "sube": "⊆",
- "supe": "⊇",
- "oplus": "⊕",
- "otimes": "⊗",
- "perp": "⊥",
- "sdot": "⋅",
- "lceil": "⌈",
- "rceil": "⌉",
- "lfloor": "⌊",
- "rfloor": "⌋",
- "lang": "〈",
- "rang": "〉",
- "loz": "◊",
- "spades": "♠",
- "clubs": "♣",
- "hearts": "♥",
- "diams": "♦",
- "quot": "\"",
- "amp": "&",
- "lt": "<",
- "gt": ">",
- "OElig": "Œ",
- "oelig": "œ",
- "Scaron": "Š",
- "scaron": "š",
- "Yuml": "Ÿ",
- "circ": "ˆ",
- "tilde": "˜",
- "ensp": " ",
- "emsp": " ",
- "thinsp": " ",
- "zwnj": "‌",
- "zwj": "‍",
- "lrm": "‎",
- "rlm": "‏",
- "ndash": "–",
- "mdash": "—",
- "lsquo": "‘",
- "rsquo": "’",
- "sbquo": "‚",
- "ldquo": "“",
- "rdquo": "”",
- "bdquo": "„",
- "dagger": "†",
- "Dagger": "‡",
- "permil": "‰",
- "lsaquo": "‹",
- "rsaquo": "›",
- "euro": "€"
-}
diff --git a/tools/eslint/node_modules/character-entities-html4/package.json b/tools/eslint/node_modules/character-entities-html4/package.json
deleted file mode 100644
index 9540ae4f95..0000000000
--- a/tools/eslint/node_modules/character-entities-html4/package.json
+++ /dev/null
@@ -1,98 +0,0 @@
-{
- "_from": "character-entities-html4@^1.0.0",
- "_id": "character-entities-html4@1.1.0",
- "_inBundle": false,
- "_integrity": "sha1-GrCFUdPOH6HfCNAPucod77FHoGw=",
- "_location": "/character-entities-html4",
- "_phantomChildren": {},
- "_requested": {
- "type": "range",
- "registry": true,
- "raw": "character-entities-html4@^1.0.0",
- "name": "character-entities-html4",
- "escapedName": "character-entities-html4",
- "rawSpec": "^1.0.0",
- "saveSpec": null,
- "fetchSpec": "^1.0.0"
- },
- "_requiredBy": [
- "/stringify-entities"
- ],
- "_resolved": "https://registry.npmjs.org/character-entities-html4/-/character-entities-html4-1.1.0.tgz",
- "_shasum": "1ab08551d3ce1fa1df08d00fb9ca1defb147a06c",
- "_spec": "character-entities-html4@^1.0.0",
- "_where": "/Users/trott/io.js/tools/eslint-tmp/node_modules/eslint/node_modules/stringify-entities",
- "author": {
- "name": "Titus Wormer",
- "email": "tituswormer@gmail.com",
- "url": "http://wooorm.com"
- },
- "bugs": {
- "url": "https://github.com/wooorm/character-entities-html4/issues"
- },
- "bundleDependencies": false,
- "contributors": [
- {
- "name": "Titus Wormer",
- "email": "tituswormer@gmail.com",
- "url": "http://wooorm.com"
- }
- ],
- "dependencies": {},
- "deprecated": false,
- "description": "HTML4 character entity information",
- "devDependencies": {
- "bail": "^1.0.1",
- "browserify": "^13.0.1",
- "concat-stream": "^1.5.2",
- "esmangle": "^1.0.1",
- "nyc": "^8.0.0",
- "remark-cli": "^2.0.0",
- "remark-preset-wooorm": "^1.0.0",
- "tape": "^4.0.0",
- "xo": "^0.17.0"
- },
- "files": [
- "index.json"
- ],
- "homepage": "https://github.com/wooorm/character-entities-html4#readme",
- "keywords": [
- "html",
- "html4",
- "entity",
- "entities",
- "character",
- "reference",
- "name",
- "replacement"
- ],
- "license": "MIT",
- "main": "index.json",
- "name": "character-entities-html4",
- "remarkConfig": {
- "output": true,
- "presets": "wooorm"
- },
- "repository": {
- "type": "git",
- "url": "git+https://github.com/wooorm/character-entities-html4.git"
- },
- "scripts": {
- "build": "npm run build-md && npm run build-generate && npm run build-bundle && npm run build-mangle",
- "build-bundle": "browserify index.json --bare -s characterEntitiesHTML4 > character-entities-html4.js",
- "build-generate": "node build",
- "build-mangle": "esmangle character-entities-html4.js > character-entities-html4.min.js",
- "build-md": "remark . --quiet --frail",
- "lint": "xo",
- "test": "npm run build && npm run lint && npm run test-coverage",
- "test-api": "node test",
- "test-coverage": "nyc --reporter lcov tape test.js"
- },
- "version": "1.1.0",
- "xo": {
- "space": true,
- "ignores": [
- "character-entities-html4.js"
- ]
- }
-}
diff --git a/tools/eslint/node_modules/character-entities-html4/readme.md b/tools/eslint/node_modules/character-entities-html4/readme.md
deleted file mode 100644
index d607a6483e..0000000000
--- a/tools/eslint/node_modules/character-entities-html4/readme.md
+++ /dev/null
@@ -1,52 +0,0 @@
-# character-entities-html4 [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov]
-
-HTML4 character entity information.
-
-## Installation
-
-[npm][npm-install]:
-
-```bash
-npm install character-entities-html4
-```
-
-## Usage
-
-```js
-console.log(characterEntities.AElig); // Æ
-console.log(characterEntities.aelig); // æ
-console.log(characterEntities.amp); // &
-console.log(characterEntities.apos); // undefined
-```
-
-## API
-
-### `characterEntitiesHTML4`
-
-Mapping between (case-sensitive) character entity names to replacements.
-
-## Support
-
-See [w3.org][html].
-
-## License
-
-[MIT][license] © [Titus Wormer][author]
-
-<!-- Definitions -->
-
-[travis-badge]: https://img.shields.io/travis/wooorm/character-entities-html4.svg
-
-[travis]: https://travis-ci.org/wooorm/character-entities-html4
-
-[codecov-badge]: https://img.shields.io/codecov/c/github/wooorm/character-entities-html4.svg
-
-[codecov]: https://codecov.io/github/wooorm/character-entities-html4
-
-[npm-install]: https://docs.npmjs.com/cli/install
-
-[license]: LICENSE
-
-[author]: http://wooorm.com
-
-[html]: http://www.w3.org/TR/html4/sgml/entities.html
diff --git a/tools/eslint/node_modules/eslint-plugin-markdown/README.md b/tools/eslint/node_modules/eslint-plugin-markdown/README.md
index 4f212022c8..749c188323 100644
--- a/tools/eslint/node_modules/eslint-plugin-markdown/README.md
+++ b/tools/eslint/node_modules/eslint-plugin-markdown/README.md
@@ -102,6 +102,26 @@ Each code block in a file is linted separately, so configuration comments apply
alert("Hello, world!");
```
+## Skipping Blocks
+
+Sometimes it can be useful to have code blocks marked with `js` even though they don't contain valid JavaScript syntax, such as commented JSON blobs that need `js` syntax highlighting. Standard `eslint-disable` comments only silence rule reporting, but ESLint still reports any syntax errors it finds. In cases where a code block should not even be parsed, insert a non-standard `<!-- eslint-skip -->` comment before the block, and this plugin will hide the following block from ESLint. Neither rule nor syntax errors will be reported.
+
+ There are comments in this JSON, so we use `js` syntax for better
+ highlighting. Skip the block to prevent warnings about invalid syntax.
+
+ <!-- eslint-skip -->
+
+ ```js
+ {
+ // This code block is hidden from ESLint.
+ "hello": "world"
+ }
+ ```
+
+ ```js
+ console.log("This code block is linted normally.");
+ ```
+
## Unsatisfiable Rules
Since code blocks are not files themselves but embedded inside a Markdown document, some rules do not apply to Markdown code blocks, and messages from these rules are automatically suppressed:
@@ -113,8 +133,7 @@ Since code blocks are not files themselves but embedded inside a Markdown docume
```sh
$ git clone https://github.com/eslint/eslint-plugin-markdown.git
$ cd eslint-plugin-markdown
-$ npm link
-$ npm link eslint-plugin-markdown
+$ npm install
$ npm test
```
diff --git a/tools/eslint/node_modules/eslint-plugin-markdown/lib/processor.js b/tools/eslint/node_modules/eslint-plugin-markdown/lib/processor.js
index 7d0fa62f79..8df09ef614 100644
--- a/tools/eslint/node_modules/eslint-plugin-markdown/lib/processor.js
+++ b/tools/eslint/node_modules/eslint-plugin-markdown/lib/processor.js
@@ -6,14 +6,16 @@
"use strict";
var assign = require("object-assign");
-var parse5 = require("parse5");
-var remark = require("remark");
+var unified = require("unified");
+var remarkParse = require("remark-parse");
var SUPPORTED_SYNTAXES = ["js", "javascript", "node", "jsx"];
var UNSATISFIABLE_RULES = [
"eol-last" // The Markdown parser strips trailing newlines in code fences
];
+var markdown = unified().use(remarkParse);
+
var blocks = [];
/**
@@ -42,26 +44,25 @@ function traverse(node, callbacks, parent) {
* @param {string} html The text content of an HTML AST node.
* @returns {string[]} An array of JS block comments.
*/
-function getComments(html) {
- var ast = parse5.parse(html, { locationInfo: true });
- var nodes = ast.childNodes.filter(function(node) {
- return node.__location; // eslint-disable-line no-underscore-dangle
- });
- var comments = [];
- var index;
-
- for (index = nodes.length - 1; index >= 0; index--) {
- if (
- nodes[index].nodeName === "#comment"
- && nodes[index].data.trim().slice(0, "eslint".length) === "eslint"
- ) {
- comments.unshift("/*" + nodes[index].data + "*/");
- } else {
- break;
- }
+function getComment(html) {
+ var commentStart = "<!--";
+ var commentEnd = "-->";
+ var prefix = "eslint";
+
+ if (
+ html.slice(0, commentStart.length) !== commentStart ||
+ html.slice(-commentEnd.length) !== commentEnd
+ ) {
+ return "";
+ }
+
+ html = html.slice(commentStart.length, -commentEnd.length);
+
+ if (html.trim().slice(0, prefix.length) !== prefix) {
+ return "";
}
- return comments;
+ return html;
}
/**
@@ -70,19 +71,31 @@ function getComments(html) {
* @returns {string[]} Source code strings to lint.
*/
function preprocess(text) {
- var ast = remark().parse(text);
+ var ast = markdown.parse(text);
blocks = [];
traverse(ast, {
"code": function(node, parent) {
var comments = [];
- var index, previousNode;
+ var index, previousNode, comment;
if (node.lang && SUPPORTED_SYNTAXES.indexOf(node.lang.toLowerCase()) >= 0) {
- index = parent.children.indexOf(node);
- previousNode = parent.children[index - 1];
- if (previousNode && previousNode.type === "html") {
- comments = getComments(previousNode.value) || [];
+ index = parent.children.indexOf(node) - 1;
+ previousNode = parent.children[index];
+ while (previousNode && previousNode.type === "html") {
+ comment = getComment(previousNode.value);
+
+ if (!comment) {
+ break;
+ }
+
+ if (comment.trim() === "eslint-skip") {
+ return;
+ }
+
+ comments.unshift("/*" + comment + "*/");
+ index--;
+ previousNode = parent.children[index];
}
blocks.push(assign({}, node, { comments: comments }));
diff --git a/tools/eslint/node_modules/eslint-plugin-markdown/package.json b/tools/eslint/node_modules/eslint-plugin-markdown/package.json
index bf0bf1ca70..54d03e7a41 100644
--- a/tools/eslint/node_modules/eslint-plugin-markdown/package.json
+++ b/tools/eslint/node_modules/eslint-plugin-markdown/package.json
@@ -1,28 +1,28 @@
{
- "_from": "eslint-plugin-markdown@1.0.0-beta.4",
- "_id": "eslint-plugin-markdown@1.0.0-beta.4",
+ "_from": "eslint-plugin-markdown@1.0.0-beta.7",
+ "_id": "eslint-plugin-markdown@1.0.0-beta.7",
"_inBundle": false,
- "_integrity": "sha1-gqGZcTmeSxti99SsZCRofCwH7no=",
+ "_integrity": "sha1-Euc6QSfEpLedlm+fR1hR3Q949+c=",
"_location": "/eslint-plugin-markdown",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
- "raw": "eslint-plugin-markdown@1.0.0-beta.4",
+ "raw": "eslint-plugin-markdown@1.0.0-beta.7",
"name": "eslint-plugin-markdown",
"escapedName": "eslint-plugin-markdown",
- "rawSpec": "1.0.0-beta.4",
+ "rawSpec": "1.0.0-beta.7",
"saveSpec": null,
- "fetchSpec": "1.0.0-beta.4"
+ "fetchSpec": "1.0.0-beta.7"
},
"_requiredBy": [
"#USER",
"/"
],
- "_resolved": "https://registry.npmjs.org/eslint-plugin-markdown/-/eslint-plugin-markdown-1.0.0-beta.4.tgz",
- "_shasum": "82a19971399e4b1b62f7d4ac6424687c2c07ee7a",
- "_spec": "eslint-plugin-markdown@1.0.0-beta.4",
- "_where": "/Users/trott/io.js/tools/eslint-tmp/node_modules/eslint",
+ "_resolved": "https://registry.npmjs.org/eslint-plugin-markdown/-/eslint-plugin-markdown-1.0.0-beta.7.tgz",
+ "_shasum": "12e73a4127c4a4b79d966f9f475851dd0f78f7e7",
+ "_spec": "eslint-plugin-markdown@1.0.0-beta.7",
+ "_where": "j:\\temp\\_git\\node-fork\\tools\\eslint",
"author": {
"name": "Brandon Mills",
"url": "https://github.com/btmills"
@@ -33,8 +33,8 @@
"bundleDependencies": false,
"dependencies": {
"object-assign": "^4.0.1",
- "parse5": "^2.2.2",
- "remark": "^5.0.0"
+ "remark-parse": "^3.0.0",
+ "unified": "^6.1.2"
},
"deprecated": false,
"description": "An ESLint plugin to lint JavaScript in Markdown code fences.",
@@ -42,13 +42,14 @@
"chai": "^3.0.0",
"eslint": "^2.2.0",
"eslint-config-eslint": "^3.0.0",
+ "eslint-release": "^0.10.2",
+ "istanbul": "^0.4.5",
"mocha": "^2.2.5"
},
"files": [
- "lib/*.js",
"index.js",
- "LICENSE",
- "README.md"
+ "lib/index.js",
+ "lib/processor.js"
],
"homepage": "https://github.com/eslint/eslint-plugin-markdown#readme",
"keywords": [
@@ -66,7 +67,14 @@
"url": "git+https://github.com/eslint/eslint-plugin-markdown.git"
},
"scripts": {
- "test": "eslint --ext .js --ext .md . && mocha tests"
+ "alpharelease": "eslint-prerelease alpha",
+ "betarelease": "eslint-prerelease beta",
+ "ci-release": "eslint-ci-release",
+ "gh-release": "eslint-gh-release",
+ "lint": "eslint Makefile.js lib/**/*.js tests/lib/plugin.js",
+ "release": "eslint-release",
+ "test": "npm run lint && npm run test-cov",
+ "test-cov": "istanbul cover _mocha -- -c tests/lib/**/*.js"
},
- "version": "1.0.0-beta.4"
+ "version": "1.0.0-beta.7"
}
diff --git a/tools/eslint/node_modules/parse5/LICENSE b/tools/eslint/node_modules/is-buffer/LICENSE
index 120d532f4a..0c068ceecb 100644
--- a/tools/eslint/node_modules/parse5/LICENSE
+++ b/tools/eslint/node_modules/is-buffer/LICENSE
@@ -1,4 +1,6 @@
-Copyright (c) 2013-2016 Ivan Nikulin (ifaaan@gmail.com, https://github.com/inikulin)
+The MIT License (MIT)
+
+Copyright (c) Feross Aboukhadijeh
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/tools/eslint/node_modules/is-buffer/README.md b/tools/eslint/node_modules/is-buffer/README.md
new file mode 100644
index 0000000000..cb6f356d5a
--- /dev/null
+++ b/tools/eslint/node_modules/is-buffer/README.md
@@ -0,0 +1,49 @@
+# is-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][npm-url]
+
+#### Determine if an object is a [`Buffer`](http://nodejs.org/api/buffer.html) (including the [browserify Buffer](https://github.com/feross/buffer))
+
+[![saucelabs][saucelabs-image]][saucelabs-url]
+
+[travis-image]: https://img.shields.io/travis/feross/is-buffer/master.svg
+[travis-url]: https://travis-ci.org/feross/is-buffer
+[npm-image]: https://img.shields.io/npm/v/is-buffer.svg
+[npm-url]: https://npmjs.org/package/is-buffer
+[downloads-image]: https://img.shields.io/npm/dm/is-buffer.svg
+[saucelabs-image]: https://saucelabs.com/browser-matrix/is-buffer.svg
+[saucelabs-url]: https://saucelabs.com/u/is-buffer
+
+## Why not use `Buffer.isBuffer`?
+
+This module lets you check if an object is a `Buffer` without using `Buffer.isBuffer` (which includes the whole [buffer](https://github.com/feross/buffer) module in [browserify](http://browserify.org/)).
+
+It's future-proof and works in node too!
+
+## install
+
+```bash
+npm install is-buffer
+```
+
+## usage
+
+```js
+var isBuffer = require('is-buffer')
+
+isBuffer(new Buffer(4)) // true
+
+isBuffer(undefined) // false
+isBuffer(null) // false
+isBuffer('') // false
+isBuffer(true) // false
+isBuffer(false) // false
+isBuffer(0) // false
+isBuffer(1) // false
+isBuffer(1.0) // false
+isBuffer('string') // false
+isBuffer({}) // false
+isBuffer(function foo () {}) // false
+```
+
+## license
+
+MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org).
diff --git a/tools/eslint/node_modules/is-buffer/index.js b/tools/eslint/node_modules/is-buffer/index.js
new file mode 100644
index 0000000000..36c808ea75
--- /dev/null
+++ b/tools/eslint/node_modules/is-buffer/index.js
@@ -0,0 +1,21 @@
+/*!
+ * Determine if an object is a Buffer
+ *
+ * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
+ * @license MIT
+ */
+
+// The _isBuffer check is for Safari 5-7 support, because it's missing
+// Object.prototype.constructor. Remove this eventually
+module.exports = function (obj) {
+ return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)
+}
+
+function isBuffer (obj) {
+ return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
+}
+
+// For Node v0.10 support. Remove this eventually.
+function isSlowBuffer (obj) {
+ return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))
+}
diff --git a/tools/eslint/node_modules/is-buffer/package.json b/tools/eslint/node_modules/is-buffer/package.json
new file mode 100644
index 0000000000..f9440208bc
--- /dev/null
+++ b/tools/eslint/node_modules/is-buffer/package.json
@@ -0,0 +1,77 @@
+{
+ "_from": "is-buffer@^1.1.4",
+ "_id": "is-buffer@1.1.5",
+ "_inBundle": false,
+ "_integrity": "sha1-Hzsm72E7IUuIy8ojzGwB2Hlh7sw=",
+ "_location": "/is-buffer",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "is-buffer@^1.1.4",
+ "name": "is-buffer",
+ "escapedName": "is-buffer",
+ "rawSpec": "^1.1.4",
+ "saveSpec": null,
+ "fetchSpec": "^1.1.4"
+ },
+ "_requiredBy": [
+ "/eslint-plugin-markdown/vfile"
+ ],
+ "_resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.5.tgz",
+ "_shasum": "1f3b26ef613b214b88cbca23cc6c01d87961eecc",
+ "_spec": "is-buffer@^1.1.4",
+ "_where": "j:\\temp\\_git\\node-fork\\tools\\eslint\\node_modules\\eslint-plugin-markdown\\node_modules\\vfile",
+ "author": {
+ "name": "Feross Aboukhadijeh",
+ "email": "feross@feross.org",
+ "url": "http://feross.org/"
+ },
+ "bugs": {
+ "url": "https://github.com/feross/is-buffer/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {},
+ "deprecated": false,
+ "description": "Determine if an object is a Buffer",
+ "devDependencies": {
+ "standard": "*",
+ "tape": "^4.0.0",
+ "zuul": "^3.0.0"
+ },
+ "homepage": "https://github.com/feross/is-buffer#readme",
+ "keywords": [
+ "buffer",
+ "buffers",
+ "type",
+ "core buffer",
+ "browser buffer",
+ "browserify",
+ "typed array",
+ "uint32array",
+ "int16array",
+ "int32array",
+ "float32array",
+ "float64array",
+ "browser",
+ "arraybuffer",
+ "dataview"
+ ],
+ "license": "MIT",
+ "main": "index.js",
+ "name": "is-buffer",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/feross/is-buffer.git"
+ },
+ "scripts": {
+ "test": "standard && npm run test-node && npm run test-browser",
+ "test-browser": "zuul -- test/*.js",
+ "test-browser-local": "zuul --local -- test/*.js",
+ "test-node": "tape test/*.js"
+ },
+ "testling": {
+ "files": "test/*.js"
+ },
+ "version": "1.1.5"
+}
diff --git a/tools/eslint/node_modules/is-plain-obj/index.js b/tools/eslint/node_modules/is-plain-obj/index.js
new file mode 100644
index 0000000000..0d1ba9eeb8
--- /dev/null
+++ b/tools/eslint/node_modules/is-plain-obj/index.js
@@ -0,0 +1,7 @@
+'use strict';
+var toString = Object.prototype.toString;
+
+module.exports = function (x) {
+ var prototype;
+ return toString.call(x) === '[object Object]' && (prototype = Object.getPrototypeOf(x), prototype === null || prototype === Object.getPrototypeOf({}));
+};
diff --git a/tools/eslint/node_modules/is-plain-obj/license b/tools/eslint/node_modules/is-plain-obj/license
new file mode 100644
index 0000000000..654d0bfe94
--- /dev/null
+++ b/tools/eslint/node_modules/is-plain-obj/license
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/tools/eslint/node_modules/is-plain-obj/package.json b/tools/eslint/node_modules/is-plain-obj/package.json
new file mode 100644
index 0000000000..697b7e70c9
--- /dev/null
+++ b/tools/eslint/node_modules/is-plain-obj/package.json
@@ -0,0 +1,68 @@
+{
+ "_from": "is-plain-obj@^1.1.0",
+ "_id": "is-plain-obj@1.1.0",
+ "_inBundle": false,
+ "_integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=",
+ "_location": "/is-plain-obj",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "is-plain-obj@^1.1.0",
+ "name": "is-plain-obj",
+ "escapedName": "is-plain-obj",
+ "rawSpec": "^1.1.0",
+ "saveSpec": null,
+ "fetchSpec": "^1.1.0"
+ },
+ "_requiredBy": [
+ "/eslint-plugin-markdown/unified"
+ ],
+ "_resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz",
+ "_shasum": "71a50c8429dfca773c92a390a4a03b39fcd51d3e",
+ "_spec": "is-plain-obj@^1.1.0",
+ "_where": "j:\\temp\\_git\\node-fork\\tools\\eslint\\node_modules\\eslint-plugin-markdown\\node_modules\\unified",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "bugs": {
+ "url": "https://github.com/sindresorhus/is-plain-obj/issues"
+ },
+ "bundleDependencies": false,
+ "deprecated": false,
+ "description": "Check if a value is a plain object",
+ "devDependencies": {
+ "ava": "0.0.4"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "files": [
+ "index.js"
+ ],
+ "homepage": "https://github.com/sindresorhus/is-plain-obj#readme",
+ "keywords": [
+ "obj",
+ "object",
+ "is",
+ "check",
+ "test",
+ "type",
+ "plain",
+ "vanilla",
+ "pure",
+ "simple"
+ ],
+ "license": "MIT",
+ "name": "is-plain-obj",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/sindresorhus/is-plain-obj.git"
+ },
+ "scripts": {
+ "test": "node test.js"
+ },
+ "version": "1.1.0"
+}
diff --git a/tools/eslint/node_modules/is-plain-obj/readme.md b/tools/eslint/node_modules/is-plain-obj/readme.md
new file mode 100644
index 0000000000..269e56aeff
--- /dev/null
+++ b/tools/eslint/node_modules/is-plain-obj/readme.md
@@ -0,0 +1,35 @@
+# is-plain-obj [![Build Status](https://travis-ci.org/sindresorhus/is-plain-obj.svg?branch=master)](https://travis-ci.org/sindresorhus/is-plain-obj)
+
+> Check if a value is a plain object
+
+An object is plain if it's created by either `{}`, `new Object()` or `Object.create(null)`.
+
+
+## Install
+
+```
+$ npm install --save is-plain-obj
+```
+
+
+## Usage
+
+```js
+var isPlainObj = require('is-plain-obj');
+
+isPlainObj({foo: 'bar'});
+//=> true
+
+isPlainObj([1, 2, 3]);
+//=> false
+```
+
+
+## Related
+
+- [is-obj](https://github.com/sindresorhus/is-obj) - Check if a value is an object
+
+
+## License
+
+MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/tools/eslint/node_modules/ccount/LICENSE b/tools/eslint/node_modules/is-whitespace-character/LICENSE
index 32e7a3d93c..8d8660d36e 100644
--- a/tools/eslint/node_modules/ccount/LICENSE
+++ b/tools/eslint/node_modules/is-whitespace-character/LICENSE
@@ -1,6 +1,6 @@
(The MIT License)
-Copyright (c) 2015 Titus Wormer <tituswormer@gmail.com>
+Copyright (c) 2016 Titus Wormer <tituswormer@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
diff --git a/tools/eslint/node_modules/longest-streak/history.md b/tools/eslint/node_modules/is-whitespace-character/history.md
index 654a34d89a..674e111c47 100644
--- a/tools/eslint/node_modules/longest-streak/history.md
+++ b/tools/eslint/node_modules/is-whitespace-character/history.md
@@ -1,9 +1,6 @@
----
-mdast:
- setext: true
----
+<!--remark setext-->
<!--lint disable no-multiple-toplevel-headings -->
-1.0.0 / 2015-07-12
+1.0.0 / 2016-07-12
==================
diff --git a/tools/eslint/node_modules/is-whitespace-character/index.js b/tools/eslint/node_modules/is-whitespace-character/index.js
new file mode 100644
index 0000000000..f9e23df3f7
--- /dev/null
+++ b/tools/eslint/node_modules/is-whitespace-character/index.js
@@ -0,0 +1,33 @@
+/**
+ * @author Titus Wormer
+ * @copyright 2016 Titus Wormer
+ * @license MIT
+ * @module is-whitespace-character
+ * @fileoverview Check if a character is a whitespace character.
+ */
+
+'use strict';
+
+/* eslint-env commonjs */
+
+/* Expose. */
+module.exports = whitespace;
+
+/* Methods. */
+var fromCode = String.fromCharCode;
+
+/* Constants. */
+var re = /\s/;
+
+/**
+ * Check whether the given character code, or the character
+ * code at the first character, is a whitespace character.
+ *
+ * @param {string|number} character
+ * @return {boolean} - Whether `character` is a whitespaces character.
+ */
+function whitespace(character) {
+ return re.test(
+ typeof character === 'number' ? fromCode(character) : character.charAt(0)
+ );
+}
diff --git a/tools/eslint/node_modules/is-whitespace-character/package.json b/tools/eslint/node_modules/is-whitespace-character/package.json
new file mode 100644
index 0000000000..d70f094f55
--- /dev/null
+++ b/tools/eslint/node_modules/is-whitespace-character/package.json
@@ -0,0 +1,111 @@
+{
+ "_from": "is-whitespace-character@^1.0.0",
+ "_id": "is-whitespace-character@1.0.0",
+ "_inBundle": false,
+ "_integrity": "sha1-u/SoN2Tq0NRRvsKlUhjpGWGtwnU=",
+ "_location": "/is-whitespace-character",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "is-whitespace-character@^1.0.0",
+ "name": "is-whitespace-character",
+ "escapedName": "is-whitespace-character",
+ "rawSpec": "^1.0.0",
+ "saveSpec": null,
+ "fetchSpec": "^1.0.0"
+ },
+ "_requiredBy": [
+ "/eslint-plugin-markdown/remark-parse"
+ ],
+ "_resolved": "https://registry.npmjs.org/is-whitespace-character/-/is-whitespace-character-1.0.0.tgz",
+ "_shasum": "bbf4a83764ead0d451bec2a55218e91961adc275",
+ "_spec": "is-whitespace-character@^1.0.0",
+ "_where": "j:\\temp\\_git\\node-fork\\tools\\eslint\\node_modules\\eslint-plugin-markdown\\node_modules\\remark-parse",
+ "author": {
+ "name": "Titus Wormer",
+ "email": "tituswormer@gmail.com",
+ "url": "http://wooorm.com"
+ },
+ "bugs": {
+ "url": "https://github.com/wooorm/is-whitespace-character/issues"
+ },
+ "bundleDependencies": false,
+ "contributors": [
+ {
+ "name": "Titus Wormer",
+ "email": "tituswormer@gmail.com",
+ "url": "http://wooorm.com"
+ }
+ ],
+ "dependencies": {},
+ "deprecated": false,
+ "description": "Check if a character is a whitespace character",
+ "devDependencies": {
+ "browserify": "^13.0.1",
+ "esmangle": "^1.0.1",
+ "nyc": "^7.0.0",
+ "remark-cli": "^1.0.0",
+ "remark-comment-config": "^4.0.0",
+ "remark-github": "^5.0.0",
+ "remark-lint": "^4.0.0",
+ "remark-validate-links": "^4.0.0",
+ "tape": "^4.0.0",
+ "xo": "^0.16.0"
+ },
+ "files": [
+ "index.js"
+ ],
+ "homepage": "https://github.com/wooorm/is-whitespace-character#readme",
+ "keywords": [
+ "string",
+ "character",
+ "char",
+ "code",
+ "whitespace",
+ "white",
+ "space"
+ ],
+ "license": "MIT",
+ "name": "is-whitespace-character",
+ "nyc": {
+ "check-coverage": true,
+ "lines": 100,
+ "functions": 100,
+ "branches": 100
+ },
+ "remarkConfig": {
+ "output": true,
+ "plugins": [
+ "comment-config",
+ "github",
+ "lint",
+ "validate-links"
+ ],
+ "settings": {
+ "bullet": "*"
+ }
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/wooorm/is-whitespace-character.git"
+ },
+ "scripts": {
+ "build": "npm run build-md && npm run build-bundle && npm run build-mangle",
+ "build-bundle": "browserify index.js --bare -s isWhitespaceCharacter > is-whitespace-character.js",
+ "build-mangle": "esmangle < is-whitespace-character.js > is-whitespace-character.min.js",
+ "build-md": "remark . --quiet --frail",
+ "lint": "xo",
+ "test": "npm run build && npm run lint && npm run test-coverage",
+ "test-api": "node test",
+ "test-coverage": "nyc --reporter lcov tape test.js"
+ },
+ "version": "1.0.0",
+ "xo": {
+ "space": true,
+ "ignores": [
+ "is-whitespace-character.js",
+ "is-whitespace-character.min.js"
+ ]
+ }
+}
diff --git a/tools/eslint/node_modules/is-whitespace-character/readme.md b/tools/eslint/node_modules/is-whitespace-character/readme.md
new file mode 100644
index 0000000000..c2ac49c213
--- /dev/null
+++ b/tools/eslint/node_modules/is-whitespace-character/readme.md
@@ -0,0 +1,63 @@
+# is-whitespace-character [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov]
+
+<!--lint disable heading-increment list-item-spacing-->
+
+Check if a character is a whitespace character: `\s`, which equals
+all Unicode Space Separators (including `[ \t\v\f]`), the BOM
+(`\uFEFF`), and line terminator (`[\n\r\u2028\u2029]`).
+
+## Installation
+
+[npm][npm-install]:
+
+```bash
+npm install is-whitespace-character
+```
+
+## Usage
+
+```javascript
+var whitespace = require('is-whitespace-character');
+
+whitespace(' '); // true
+whitespace('\n'); // true
+whitespace('\ufeff'); // true
+whitespace('_'); // false
+whitespace('a'); // true
+whitespace('💩'); // false
+```
+
+## API
+
+### `whitespaceCharacter(character)`
+
+Check whether the given character code (`number`), or the character
+code at the first position (`string`), is a whitespace character.
+
+## Related
+
+* [`is-alphabetical`](https://github.com/wooorm/is-alphabetical)
+* [`is-alphanumerical`](https://github.com/wooorm/is-alphanumerical)
+* [`is-decimal`](https://github.com/wooorm/is-decimal)
+* [`is-hexadecimal`](https://github.com/wooorm/is-hexadecimal)
+* [`is-word-character`](https://github.com/wooorm/is-word-character)
+
+## License
+
+[MIT][license] © [Titus Wormer][author]
+
+<!-- Definitions -->
+
+[travis-badge]: https://img.shields.io/travis/wooorm/is-whitespace-character.svg
+
+[travis]: https://travis-ci.org/wooorm/is-whitespace-character
+
+[codecov-badge]: https://img.shields.io/codecov/c/github/wooorm/is-whitespace-character.svg
+
+[codecov]: https://codecov.io/github/wooorm/is-whitespace-character
+
+[npm-install]: https://docs.npmjs.com/cli/install
+
+[license]: LICENSE
+
+[author]: http://wooorm.com
diff --git a/tools/eslint/node_modules/character-entities-html4/LICENSE b/tools/eslint/node_modules/is-word-character/LICENSE
index 32e7a3d93c..8d8660d36e 100644
--- a/tools/eslint/node_modules/character-entities-html4/LICENSE
+++ b/tools/eslint/node_modules/is-word-character/LICENSE
@@ -1,6 +1,6 @@
(The MIT License)
-Copyright (c) 2015 Titus Wormer <tituswormer@gmail.com>
+Copyright (c) 2016 Titus Wormer <tituswormer@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
diff --git a/tools/eslint/node_modules/is-word-character/history.md b/tools/eslint/node_modules/is-word-character/history.md
new file mode 100644
index 0000000000..674e111c47
--- /dev/null
+++ b/tools/eslint/node_modules/is-word-character/history.md
@@ -0,0 +1,6 @@
+<!--remark setext-->
+
+<!--lint disable no-multiple-toplevel-headings -->
+
+1.0.0 / 2016-07-12
+==================
diff --git a/tools/eslint/node_modules/is-word-character/index.js b/tools/eslint/node_modules/is-word-character/index.js
new file mode 100644
index 0000000000..c2f9c3fd05
--- /dev/null
+++ b/tools/eslint/node_modules/is-word-character/index.js
@@ -0,0 +1,33 @@
+/**
+ * @author Titus Wormer
+ * @copyright 2016 Titus Wormer
+ * @license MIT
+ * @module is-word-character
+ * @fileoverview Check if a character is a word character.
+ */
+
+'use strict';
+
+/* eslint-env commonjs */
+
+/* Expose. */
+module.exports = wordCharacter;
+
+/* Methods. */
+var fromCode = String.fromCharCode;
+
+/* Constants. */
+var re = /\w/;
+
+/**
+ * Check whether the given character code, or the character
+ * code at the first character, is a word character.
+ *
+ * @param {string|number} character
+ * @return {boolean} - Whether `character` is a word character.
+ */
+function wordCharacter(character) {
+ return re.test(
+ typeof character === 'number' ? fromCode(character) : character.charAt(0)
+ );
+}
diff --git a/tools/eslint/node_modules/is-word-character/package.json b/tools/eslint/node_modules/is-word-character/package.json
new file mode 100644
index 0000000000..61aee67a54
--- /dev/null
+++ b/tools/eslint/node_modules/is-word-character/package.json
@@ -0,0 +1,109 @@
+{
+ "_from": "is-word-character@^1.0.0",
+ "_id": "is-word-character@1.0.0",
+ "_inBundle": false,
+ "_integrity": "sha1-o6nl3a1wxcLuNvSpz8mlP0RTUkc=",
+ "_location": "/is-word-character",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "is-word-character@^1.0.0",
+ "name": "is-word-character",
+ "escapedName": "is-word-character",
+ "rawSpec": "^1.0.0",
+ "saveSpec": null,
+ "fetchSpec": "^1.0.0"
+ },
+ "_requiredBy": [
+ "/eslint-plugin-markdown/remark-parse"
+ ],
+ "_resolved": "https://registry.npmjs.org/is-word-character/-/is-word-character-1.0.0.tgz",
+ "_shasum": "a3a9e5ddad70c5c2ee36f4a9cfc9a53f44535247",
+ "_spec": "is-word-character@^1.0.0",
+ "_where": "j:\\temp\\_git\\node-fork\\tools\\eslint\\node_modules\\eslint-plugin-markdown\\node_modules\\remark-parse",
+ "author": {
+ "name": "Titus Wormer",
+ "email": "tituswormer@gmail.com",
+ "url": "http://wooorm.com"
+ },
+ "bugs": {
+ "url": "https://github.com/wooorm/is-word-character/issues"
+ },
+ "bundleDependencies": false,
+ "contributors": [
+ {
+ "name": "Titus Wormer",
+ "email": "tituswormer@gmail.com",
+ "url": "http://wooorm.com"
+ }
+ ],
+ "dependencies": {},
+ "deprecated": false,
+ "description": "Check if a character is a word character",
+ "devDependencies": {
+ "browserify": "^13.0.1",
+ "esmangle": "^1.0.1",
+ "nyc": "^7.0.0",
+ "remark-cli": "^1.0.0",
+ "remark-comment-config": "^4.0.0",
+ "remark-github": "^5.0.0",
+ "remark-lint": "^4.0.0",
+ "remark-validate-links": "^4.0.0",
+ "tape": "^4.0.0",
+ "xo": "^0.16.0"
+ },
+ "files": [
+ "index.js"
+ ],
+ "homepage": "https://github.com/wooorm/is-word-character#readme",
+ "keywords": [
+ "string",
+ "character",
+ "char",
+ "code",
+ "word"
+ ],
+ "license": "MIT",
+ "name": "is-word-character",
+ "nyc": {
+ "check-coverage": true,
+ "lines": 100,
+ "functions": 100,
+ "branches": 100
+ },
+ "remarkConfig": {
+ "output": true,
+ "plugins": [
+ "comment-config",
+ "github",
+ "lint",
+ "validate-links"
+ ],
+ "settings": {
+ "bullet": "*"
+ }
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/wooorm/is-word-character.git"
+ },
+ "scripts": {
+ "build": "npm run build-md && npm run build-bundle && npm run build-mangle",
+ "build-bundle": "browserify index.js --bare -s isWordCharacter > is-word-character.js",
+ "build-mangle": "esmangle < is-word-character.js > is-word-character.min.js",
+ "build-md": "remark . --quiet --frail",
+ "lint": "xo",
+ "test": "npm run build && npm run lint && npm run test-coverage",
+ "test-api": "node test",
+ "test-coverage": "nyc --reporter lcov tape test.js"
+ },
+ "version": "1.0.0",
+ "xo": {
+ "space": true,
+ "ignores": [
+ "is-word-character.js",
+ "is-word-character.min.js"
+ ]
+ }
+}
diff --git a/tools/eslint/node_modules/is-word-character/readme.md b/tools/eslint/node_modules/is-word-character/readme.md
new file mode 100644
index 0000000000..4a0a25fd29
--- /dev/null
+++ b/tools/eslint/node_modules/is-word-character/readme.md
@@ -0,0 +1,62 @@
+# is-word-character [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov]
+
+<!--lint disable heading-increment list-item-spacing-->
+
+Check if a character is a word character (`\w`, which equals
+`[a-zA-Z0-9_]`).
+
+## Installation
+
+[npm][npm-install]:
+
+```bash
+npm install is-word-character
+```
+
+## Usage
+
+```javascript
+var wordCharacter = require('is-word-character');
+
+wordCharacter('a'); // true
+wordCharacter('Z'); // true
+wordCharacter('0'); // true
+wordCharacter('_'); // true
+wordCharacter(' '); // false
+wordCharacter('💩'); // false
+```
+
+## API
+
+### `wordCharacter(character)`
+
+Check whether the given character code (`number`), or the character
+code at the first position (`string`), is a word character.
+
+## Related
+
+* [`is-alphabetical`](https://github.com/wooorm/is-alphabetical)
+* [`is-alphanumerical`](https://github.com/wooorm/is-alphanumerical)
+* [`is-decimal`](https://github.com/wooorm/is-decimal)
+* [`is-hexadecimal`](https://github.com/wooorm/is-hexadecimal)
+* [`is-whitespace-character`](https://github.com/wooorm/is-whitespace-character)
+
+## License
+
+[MIT][license] © [Titus Wormer][author]
+
+<!-- Definitions -->
+
+[travis-badge]: https://img.shields.io/travis/wooorm/is-word-character.svg
+
+[travis]: https://travis-ci.org/wooorm/is-word-character
+
+[codecov-badge]: https://img.shields.io/codecov/c/github/wooorm/is-word-character.svg
+
+[codecov]: https://codecov.io/github/wooorm/is-word-character
+
+[npm-install]: https://docs.npmjs.com/cli/install
+
+[license]: LICENSE
+
+[author]: http://wooorm.com
diff --git a/tools/eslint/node_modules/longest-streak/index.js b/tools/eslint/node_modules/longest-streak/index.js
deleted file mode 100644
index 719d516860..0000000000
--- a/tools/eslint/node_modules/longest-streak/index.js
+++ /dev/null
@@ -1,51 +0,0 @@
-'use strict';
-
-/**
- * Get the count of the longest repeating streak of
- * `character` in `value`.
- *
- * @example
- * longestStreak('` foo `` bar `', '`') // 2
- *
- * @param {string} value - Content, coerced to string.
- * @param {string} character - Single character to look
- * for.
- * @return {number} - Number of characters at the place
- * where `character` occurs in its longest streak in
- * `value`.
- * @throws {Error} - when `character` is not a single
- * character.
- */
-function longestStreak(value, character) {
- var count = 0;
- var maximum = 0;
- var index = -1;
- var length;
-
- value = String(value);
- length = value.length;
-
- if (typeof character !== 'string' || character.length !== 1) {
- throw new Error('Expected character');
- }
-
- while (++index < length) {
- if (value.charAt(index) === character) {
- count++;
-
- if (count > maximum) {
- maximum = count;
- }
- } else {
- count = 0;
- }
- }
-
- return maximum;
-}
-
-/*
- * Expose.
- */
-
-module.exports = longestStreak;
diff --git a/tools/eslint/node_modules/longest-streak/package.json b/tools/eslint/node_modules/longest-streak/package.json
deleted file mode 100644
index e9af0ed2d7..0000000000
--- a/tools/eslint/node_modules/longest-streak/package.json
+++ /dev/null
@@ -1,83 +0,0 @@
-{
- "_from": "longest-streak@^1.0.0",
- "_id": "longest-streak@1.0.0",
- "_inBundle": false,
- "_integrity": "sha1-0GWXxNTDG1LMsfXY+P5xSOr9aWU=",
- "_location": "/longest-streak",
- "_phantomChildren": {},
- "_requested": {
- "type": "range",
- "registry": true,
- "raw": "longest-streak@^1.0.0",
- "name": "longest-streak",
- "escapedName": "longest-streak",
- "rawSpec": "^1.0.0",
- "saveSpec": null,
- "fetchSpec": "^1.0.0"
- },
- "_requiredBy": [
- "/remark-stringify"
- ],
- "_resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-1.0.0.tgz",
- "_shasum": "d06597c4d4c31b52ccb1f5d8f8fe7148eafd6965",
- "_spec": "longest-streak@^1.0.0",
- "_where": "/Users/trott/io.js/tools/eslint-tmp/node_modules/eslint/node_modules/remark-stringify",
- "author": {
- "name": "Titus Wormer",
- "email": "tituswormer@gmail.com"
- },
- "bugs": {
- "url": "https://github.com/wooorm/longest-streak/issues"
- },
- "bundleDependencies": false,
- "deprecated": false,
- "description": "Count the longest repeating streak of a character",
- "devDependencies": {
- "browserify": "^10.0.0",
- "eslint": "^0.24.0",
- "esmangle": "^1.0.0",
- "istanbul": "^0.3.0",
- "jscs": "^1.0.0",
- "jscs-jsdoc": "^1.0.0",
- "mdast": "^0.26.0",
- "mdast-github": "^0.3.1",
- "mdast-lint": "^0.4.1",
- "mdast-yaml-config": "^0.2.0",
- "mocha": "^2.0.0"
- },
- "files": [
- "index.js",
- "LICENSE"
- ],
- "homepage": "https://github.com/wooorm/longest-streak#readme",
- "keywords": [
- "count",
- "length",
- "longest",
- "repeating",
- "streak",
- "character"
- ],
- "license": "MIT",
- "name": "longest-streak",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/wooorm/longest-streak.git"
- },
- "scripts": {
- "build": "npm run build-md && npm run build-bundle",
- "build-bundle": "browserify index.js --bare -s longestStreak > longest-streak.js",
- "build-md": "mdast . LICENSE --output --quiet",
- "lint": "npm run lint-api && npm run lint-style",
- "lint-api": "eslint .",
- "lint-style": "jscs --reporter inline .",
- "make": "npm run lint && npm run test-coverage",
- "postbuild-bundle": "esmangle longest-streak.js > longest-streak.min.js",
- "test": "npm run test-api",
- "test-api": "mocha --check-leaks test.js",
- "test-coverage": "istanbul cover _mocha -- --check-leaks test.js",
- "test-coveralls": "istanbul cover _mocha --report lcovonly -- --check-leaks test.js",
- "test-travis": "npm run test-coveralls"
- },
- "version": "1.0.0"
-}
diff --git a/tools/eslint/node_modules/longest-streak/readme.md b/tools/eslint/node_modules/longest-streak/readme.md
deleted file mode 100644
index 780c53cf7b..0000000000
--- a/tools/eslint/node_modules/longest-streak/readme.md
+++ /dev/null
@@ -1,52 +0,0 @@
-# longest-streak [![Build Status](https://img.shields.io/travis/wooorm/longest-streak.svg?style=flat)](https://travis-ci.org/wooorm/longest-streak) [![Coverage Status](https://img.shields.io/coveralls/wooorm/longest-streak.svg?style=flat)](https://coveralls.io/r/wooorm/longest-streak?branch=master)
-
-Count the longest repeating streak of a character.
-
-## Installation
-
-[npm](https://docs.npmjs.com/cli/install):
-
-```bash
-npm install longest-streak
-```
-
-**longest-streak** is also available for [bower](http://bower.io/#install-packages),
-[component](https://github.com/componentjs/component), [duo](http://duojs.org/#getting-started),
-and for AMD, CommonJS, and globals ([uncompressed](longest-streak.js) and
-[compressed](longest-streak.min.js)).
-
-## Usage
-
-Dependencies.
-
-```javascript
-var longestStreak = require('longest-streak');
-```
-
-Process:
-
-```javascript
-longestStreak('` foo `` bar `', '`') // 2
-```
-
-## API
-
-### longestStreak(value, character)
-
-Get the count of the longest repeating streak of `character` in `value`.
-
-Parameters:
-
-* `value` (`string`) — Content, coerced to string.
-* `character` (`string`) — Single character to look for.
-
-Returns: `number` — Number of characters at the place where `character`
-occurs in its longest streak in `value`.
-
-Throws:
-
-* `Error` — when `character` is not a single character string.
-
-## License
-
-[MIT](LICENSE) @ [Titus Wormer](http://wooorm.com)
diff --git a/tools/eslint/node_modules/markdown-table/LICENSE b/tools/eslint/node_modules/markdown-escapes/LICENSE
index ce731a9cb0..8d8660d36e 100644
--- a/tools/eslint/node_modules/markdown-table/LICENSE
+++ b/tools/eslint/node_modules/markdown-escapes/LICENSE
@@ -1,6 +1,6 @@
(The MIT License)
-Copyright (c) 2014-2015 Titus Wormer <tituswormer@gmail.com>
+Copyright (c) 2016 Titus Wormer <tituswormer@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
diff --git a/tools/eslint/node_modules/markdown-escapes/history.md b/tools/eslint/node_modules/markdown-escapes/history.md
new file mode 100644
index 0000000000..f20d503569
--- /dev/null
+++ b/tools/eslint/node_modules/markdown-escapes/history.md
@@ -0,0 +1,6 @@
+<!--remark setext-->
+
+<!--lint disable no-multiple-toplevel-headings -->
+
+1.0.0 / 2016-07-16
+==================
diff --git a/tools/eslint/node_modules/markdown-escapes/index.js b/tools/eslint/node_modules/markdown-escapes/index.js
new file mode 100644
index 0000000000..38f81193e8
--- /dev/null
+++ b/tools/eslint/node_modules/markdown-escapes/index.js
@@ -0,0 +1,75 @@
+/**
+ * @author Titus Wormer
+ * @copyright 2016 Titus Wormer
+ * @license MIT
+ * @module markdown-escapes
+ * @fileoverview List of escapable characters in markdown.
+ */
+
+'use strict';
+
+/* eslint-env commonjs */
+
+/* Expose. */
+module.exports = escapes;
+
+/* Characters. */
+var defaults = [
+ '\\',
+ '`',
+ '*',
+ '{',
+ '}',
+ '[',
+ ']',
+ '(',
+ ')',
+ '#',
+ '+',
+ '-',
+ '.',
+ '!',
+ '_',
+ '>'
+];
+
+var gfm = defaults.concat(['~', '|']);
+
+var commonmark = gfm.concat([
+ '\n',
+ '"',
+ '$',
+ '%',
+ '&',
+ '\'',
+ ',',
+ '/',
+ ':',
+ ';',
+ '<',
+ '=',
+ '?',
+ '@',
+ '^'
+]);
+
+/* Expose characters. */
+escapes.default = defaults;
+escapes.gfm = gfm;
+escapes.commonmark = commonmark;
+
+/**
+ * Get markdown escapes.
+ *
+ * @param {Object?} [options] - Configuration.
+ * @return {Array.<string>} - Escapes.
+ */
+function escapes(options) {
+ var settings = options || {};
+
+ if (settings.commonmark) {
+ return commonmark;
+ }
+
+ return settings.gfm ? gfm : defaults;
+}
diff --git a/tools/eslint/node_modules/markdown-escapes/package.json b/tools/eslint/node_modules/markdown-escapes/package.json
new file mode 100644
index 0000000000..2ed7bc0ffd
--- /dev/null
+++ b/tools/eslint/node_modules/markdown-escapes/package.json
@@ -0,0 +1,109 @@
+{
+ "_from": "markdown-escapes@^1.0.0",
+ "_id": "markdown-escapes@1.0.0",
+ "_inBundle": false,
+ "_integrity": "sha1-yMoZ8dlNaCRZ4Kk8htsnp+9xayM=",
+ "_location": "/markdown-escapes",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "markdown-escapes@^1.0.0",
+ "name": "markdown-escapes",
+ "escapedName": "markdown-escapes",
+ "rawSpec": "^1.0.0",
+ "saveSpec": null,
+ "fetchSpec": "^1.0.0"
+ },
+ "_requiredBy": [
+ "/eslint-plugin-markdown/remark-parse"
+ ],
+ "_resolved": "https://registry.npmjs.org/markdown-escapes/-/markdown-escapes-1.0.0.tgz",
+ "_shasum": "c8ca19f1d94d682459e0a93c86db27a7ef716b23",
+ "_spec": "markdown-escapes@^1.0.0",
+ "_where": "j:\\temp\\_git\\node-fork\\tools\\eslint\\node_modules\\eslint-plugin-markdown\\node_modules\\remark-parse",
+ "author": {
+ "name": "Titus Wormer",
+ "email": "tituswormer@gmail.com",
+ "url": "http://wooorm.com"
+ },
+ "bugs": {
+ "url": "https://github.com/wooorm/markdown-escapes/issues"
+ },
+ "bundleDependencies": false,
+ "contributors": [
+ {
+ "name": "Titus Wormer",
+ "email": "tituswormer@gmail.com",
+ "url": "http://wooorm.com"
+ }
+ ],
+ "dependencies": {},
+ "deprecated": false,
+ "description": "List of escapable characters in markdown",
+ "devDependencies": {
+ "browserify": "^13.0.1",
+ "esmangle": "^1.0.1",
+ "nyc": "^7.0.0",
+ "remark-cli": "^1.0.0",
+ "remark-comment-config": "^4.0.0",
+ "remark-github": "^5.0.0",
+ "remark-lint": "^4.0.0",
+ "remark-validate-links": "^4.0.0",
+ "tape": "^4.0.0",
+ "xo": "^0.16.0"
+ },
+ "files": [
+ "index.js"
+ ],
+ "homepage": "https://github.com/wooorm/markdown-escapes#readme",
+ "keywords": [
+ "markdown",
+ "escape",
+ "pedantic",
+ "gfm",
+ "commonmark"
+ ],
+ "license": "MIT",
+ "name": "markdown-escapes",
+ "nyc": {
+ "check-coverage": true,
+ "lines": 100,
+ "functions": 100,
+ "branches": 100
+ },
+ "remarkConfig": {
+ "output": true,
+ "plugins": [
+ "comment-config",
+ "github",
+ "lint",
+ "validate-links"
+ ],
+ "settings": {
+ "bullet": "*"
+ }
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/wooorm/markdown-escapes.git"
+ },
+ "scripts": {
+ "build": "npm run build-md && npm run build-bundle && npm run build-mangle",
+ "build-bundle": "browserify index.js --bare -s markdownEscapes > markdown-escapes.js",
+ "build-mangle": "esmangle < markdown-escapes.js > markdown-escapes.min.js",
+ "build-md": "remark . --quiet --frail",
+ "lint": "xo",
+ "test": "npm run build && npm run lint && npm run test-coverage",
+ "test-api": "node test",
+ "test-coverage": "nyc --reporter lcov tape test.js"
+ },
+ "version": "1.0.0",
+ "xo": {
+ "space": true,
+ "ignores": [
+ "markdown-escapes.js",
+ "markdown-escapes.min.js"
+ ]
+ }
+}
diff --git a/tools/eslint/node_modules/markdown-escapes/readme.md b/tools/eslint/node_modules/markdown-escapes/readme.md
new file mode 100644
index 0000000000..8ab33f397d
--- /dev/null
+++ b/tools/eslint/node_modules/markdown-escapes/readme.md
@@ -0,0 +1,71 @@
+# markdown-escapes [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov]
+
+<!--lint disable heading-increment no-duplicate-headings-->
+
+List of escapable characters in markdown.
+
+## Installation
+
+[npm][npm-install]:
+
+```bash
+npm install markdown-escapes
+```
+
+## Usage
+
+```javascript
+var escapes = require('markdown-escapes');
+
+// Access by property:
+escapes.commonmark;
+// ['\\', '`', ..., '@', '^']
+
+// Access by options object:
+escapes({gfm: true});
+// ['\\', '`', ..., '~', '|']
+```
+
+## API
+
+### `escapes([options])`
+
+Get escapes. Supports `options.commonmark` and `options.gfm`, which
+when `true` returns the extra escape characters supported by those
+flavours.
+
+###### Returns
+
+`Array.<string>`.
+
+### `escapes.default`
+
+List of default escapable characters.
+
+### `escapes.gfm`
+
+List of escapable characters in GFM (which includes all `default`s).
+
+### `escapes.commonmark`
+
+List of escapable characters in CommonMark (which includes all `gfm`s).
+
+## License
+
+[MIT][license] © [Titus Wormer][author]
+
+<!-- Definitions -->
+
+[travis-badge]: https://img.shields.io/travis/wooorm/markdown-escapes.svg
+
+[travis]: https://travis-ci.org/wooorm/markdown-escapes
+
+[codecov-badge]: https://img.shields.io/codecov/c/github/wooorm/markdown-escapes.svg
+
+[codecov]: https://codecov.io/github/wooorm/markdown-escapes
+
+[npm-install]: https://docs.npmjs.com/cli/install
+
+[license]: LICENSE
+
+[author]: http://wooorm.com
diff --git a/tools/eslint/node_modules/markdown-table/Readme.md b/tools/eslint/node_modules/markdown-table/Readme.md
deleted file mode 100644
index 9931cc11d2..0000000000
--- a/tools/eslint/node_modules/markdown-table/Readme.md
+++ /dev/null
@@ -1,132 +0,0 @@
-# markdown-table [![Build Status](https://img.shields.io/travis/wooorm/markdown-table.svg?style=flat)](https://travis-ci.org/wooorm/markdown-table) [![Coverage Status](https://img.shields.io/coveralls/wooorm/markdown-table.svg?style=flat)](https://coveralls.io/r/wooorm/markdown-table?branch=master)
-
-Generate fancy [Markdown](https://help.github.com/articles/github-flavored-markdown/#tables)/ASCII tables.
-
-## Installation
-
-[npm](https://docs.npmjs.com/cli/install):
-
-```bash
-$ npm install markdown-table
-```
-
-[Component.js](https://github.com/componentjs/component):
-
-```bash
-$ component install wooorm/markdown-table
-```
-
-[Bower](http://bower.io/#install-packages):
-
-```bash
-$ bower install markdown-table
-```
-
-[Duo](http://duojs.org/#getting-started):
-
-```javascript
-var table = require('wooorm/markdown-table');
-```
-
-## Usage
-
-```javascript
-var table = require('markdown-table');
-
-/**
- * Normal usage (defaults to left-alignment):
- */
-
-table([
- ['Branch', 'Commit'],
- ['master', '0123456789abcdef'],
- ['staging', 'fedcba9876543210']
-]);
-/*
- * | Branch | Commit |
- * | ------- | ---------------- |
- * | master | 0123456789abcdef |
- * | staging | fedcba9876543210 |
- */
-
-/**
- * With alignment:
- */
-
-table([
- ['Beep', 'No.', 'Boop'],
- ['beep', '1024', 'xyz'],
- ['boop', '3388450', 'tuv'],
- ['foo', '10106', 'qrstuv'],
- ['bar', '45', 'lmno']
-], {
- 'align': ['l', 'c', 'r']
-});
-/*
- * | Beep | No. | Boop |
- * | :--- | :-----: | -----: |
- * | beep | 1024 | xyz |
- * | boop | 3388450 | tuv |
- * | foo | 10106 | qrstuv |
- * | bar | 45 | lmno |
- */
-
-/**
- * Alignment on dots:
- */
-
-table([
- ['No.'],
- ['0.1.2'],
- ['11.22.33'],
- ['5.6.'],
- ['1.22222'],
-], {
- 'align': '.'
-});
-/*
- * | No. |
- * | :---------: |
- * | 0.1.2 |
- * | 11.22.33 |
- * | 5.6. |
- * | 1.22222 |
- */
-```
-
-## API
-
-### markdownTable(table, options?)
-
-Turns a given matrix of strings (an array of arrays of strings) into a table.
-
-The following options are available:
-
-- `options.align` — String or array of strings, the strings being either `"l"` (left), `"r"` (right), `c` (center), or `.` (dot). Other values are treated as `""`, which doesn’t place the colon but does left align. _Only the lowercased first character is used, so `Right` is fine_;
-- `options.delimiter` — Value to insert between cells. Carefull, non-pipe values will break GitHub Flavored Markdown;
-- `options.start` — Value to insert at the beginning of every row.
-- `options.end` — Value to insert at the end of every row.
-- `options.rule` — Whether to display a rule between the header and the body of the table. Carefull, will break GitHub Flavored Markdown when `false`;
-- `options.stringLength` — The method to detect the length of a cell (see below).
-
-### options.stringLength(cell)
-
-ANSI-sequences mess up tables on terminals. To fix this, you have to pass in a `stringLength` option to detect the “visible” length of a cell.
-
-```javascript
-var chalk = require('chalk');
-
-function stringLength(cell) {
- return chalk.stripColor(cell).length;
-}
-```
-
-See the [tests for an example](test.js#L368-L375).
-
-## Inspiration
-
-The original idea and basic implementation was inspired by James Halliday's [text-table](https://github.com/substack/text-table) library.
-
-## License
-
-[MIT](LICENSE) © [Titus Wormer](http://wooorm.com)
diff --git a/tools/eslint/node_modules/markdown-table/index.js b/tools/eslint/node_modules/markdown-table/index.js
deleted file mode 100644
index 8b64246a2d..0000000000
--- a/tools/eslint/node_modules/markdown-table/index.js
+++ /dev/null
@@ -1,284 +0,0 @@
-'use strict';
-
-/*
- * Useful expressions.
- */
-
-var EXPRESSION_DOT = /\./;
-var EXPRESSION_LAST_DOT = /\.[^.]*$/;
-
-/*
- * Allowed alignment values.
- */
-
-var LEFT = 'l';
-var RIGHT = 'r';
-var CENTER = 'c';
-var DOT = '.';
-var NULL = '';
-
-var ALLIGNMENT = [LEFT, RIGHT, CENTER, DOT, NULL];
-
-/*
- * Characters.
- */
-
-var COLON = ':';
-var DASH = '-';
-var PIPE = '|';
-var SPACE = ' ';
-var NEW_LINE = '\n';
-
-/**
- * Get the length of `value`.
- *
- * @param {string} value
- * @return {number}
- */
-function lengthNoop(value) {
- return String(value).length;
-}
-
-/**
- * Get a string consisting of `length` `character`s.
- *
- * @param {number} length
- * @param {string} [character=' ']
- * @return {string}
- */
-function pad(length, character) {
- return Array(length + 1).join(character || SPACE);
-}
-
-/**
- * Get the position of the last dot in `value`.
- *
- * @param {string} value
- * @return {number}
- */
-function dotindex(value) {
- var match = EXPRESSION_LAST_DOT.exec(value);
-
- return match ? match.index + 1 : value.length;
-}
-
-/**
- * Create a table from a matrix of strings.
- *
- * @param {Array.<Array.<string>>} table
- * @param {Object?} options
- * @param {boolean?} [options.rule=true]
- * @param {string?} [options.delimiter=" | "]
- * @param {string?} [options.start="| "]
- * @param {string?} [options.end=" |"]
- * @param {Array.<string>?} options.align
- * @param {function(string)?} options.stringLength
- * @return {string} Pretty table
- */
-function markdownTable(table, options) {
- var settings = options || {};
- var delimiter = settings.delimiter;
- var start = settings.start;
- var end = settings.end;
- var alignment = settings.align;
- var calculateStringLength = settings.stringLength || lengthNoop;
- var cellCount = 0;
- var rowIndex = -1;
- var rowLength = table.length;
- var sizes = [];
- var align;
- var rule;
- var rows;
- var row;
- var cells;
- var index;
- var position;
- var size;
- var value;
- var spacing;
- var before;
- var after;
-
- alignment = alignment ? alignment.concat() : [];
-
- if (delimiter === null || delimiter === undefined) {
- delimiter = SPACE + PIPE + SPACE;
- }
-
- if (start === null || start === undefined) {
- start = PIPE + SPACE;
- }
-
- if (end === null || end === undefined) {
- end = SPACE + PIPE;
- }
-
- while (++rowIndex < rowLength) {
- row = table[rowIndex];
-
- index = -1;
-
- if (row.length > cellCount) {
- cellCount = row.length;
- }
-
- while (++index < cellCount) {
- position = row[index] ? dotindex(row[index]) : null;
-
- if (!sizes[index]) {
- sizes[index] = 3;
- }
-
- if (position > sizes[index]) {
- sizes[index] = position;
- }
- }
- }
-
- if (typeof alignment === 'string') {
- alignment = pad(cellCount, alignment).split('');
- }
-
- /*
- * Make sure only valid alignments are used.
- */
-
- index = -1;
-
- while (++index < cellCount) {
- align = alignment[index];
-
- if (typeof align === 'string') {
- align = align.charAt(0).toLowerCase();
- }
-
- if (ALLIGNMENT.indexOf(align) === -1) {
- align = NULL;
- }
-
- alignment[index] = align;
- }
-
- rowIndex = -1;
- rows = [];
-
- while (++rowIndex < rowLength) {
- row = table[rowIndex];
-
- index = -1;
- cells = [];
-
- while (++index < cellCount) {
- value = row[index];
-
- if (value === null || value === undefined) {
- value = '';
- } else {
- value = String(value);
- }
-
- if (alignment[index] !== DOT) {
- cells[index] = value;
- } else {
- position = dotindex(value);
-
- size = sizes[index] +
- (EXPRESSION_DOT.test(value) ? 0 : 1) -
- (calculateStringLength(value) - position);
-
- cells[index] = value + pad(size - 1);
- }
- }
-
- rows[rowIndex] = cells;
- }
-
- sizes = [];
- rowIndex = -1;
-
- while (++rowIndex < rowLength) {
- cells = rows[rowIndex];
-
- index = -1;
-
- while (++index < cellCount) {
- value = cells[index];
-
- if (!sizes[index]) {
- sizes[index] = 3;
- }
-
- size = calculateStringLength(value);
-
- if (size > sizes[index]) {
- sizes[index] = size;
- }
- }
- }
-
- rowIndex = -1;
-
- while (++rowIndex < rowLength) {
- cells = rows[rowIndex];
-
- index = -1;
-
- while (++index < cellCount) {
- value = cells[index];
-
- position = sizes[index] - (calculateStringLength(value) || 0);
- spacing = pad(position);
-
- if (alignment[index] === RIGHT || alignment[index] === DOT) {
- value = spacing + value;
- } else if (alignment[index] !== CENTER) {
- value = value + spacing;
- } else {
- position = position / 2;
-
- if (position % 1 === 0) {
- before = position;
- after = position;
- } else {
- before = position + 0.5;
- after = position - 0.5;
- }
-
- value = pad(before) + value + pad(after);
- }
-
- cells[index] = value;
- }
-
- rows[rowIndex] = cells.join(delimiter);
- }
-
- if (settings.rule !== false) {
- index = -1;
- rule = [];
-
- while (++index < cellCount) {
- align = alignment[index];
-
- /*
- * When `align` is left, don't add colons.
- */
-
- value = align === RIGHT || align === NULL ? DASH : COLON;
- value += pad(sizes[index] - 2, DASH);
- value += align !== LEFT && align !== NULL ? COLON : DASH;
-
- rule[index] = value;
- }
-
- rows.splice(1, 0, rule.join(delimiter));
- }
-
- return start + rows.join(end + NEW_LINE + start) + end;
-}
-
-/*
- * Expose `markdownTable`.
- */
-
-module.exports = markdownTable;
diff --git a/tools/eslint/node_modules/markdown-table/package.json b/tools/eslint/node_modules/markdown-table/package.json
deleted file mode 100644
index 49117592fc..0000000000
--- a/tools/eslint/node_modules/markdown-table/package.json
+++ /dev/null
@@ -1,72 +0,0 @@
-{
- "_from": "markdown-table@^0.4.0",
- "_id": "markdown-table@0.4.0",
- "_inBundle": false,
- "_integrity": "sha1-iQwsGzv+g/sA5BKbjkz+ZFJw+dE=",
- "_location": "/markdown-table",
- "_phantomChildren": {},
- "_requested": {
- "type": "range",
- "registry": true,
- "raw": "markdown-table@^0.4.0",
- "name": "markdown-table",
- "escapedName": "markdown-table",
- "rawSpec": "^0.4.0",
- "saveSpec": null,
- "fetchSpec": "^0.4.0"
- },
- "_requiredBy": [
- "/remark-stringify"
- ],
- "_resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-0.4.0.tgz",
- "_shasum": "890c2c1b3bfe83fb00e4129b8e4cfe645270f9d1",
- "_spec": "markdown-table@^0.4.0",
- "_where": "/Users/trott/io.js/tools/eslint-tmp/node_modules/eslint/node_modules/remark-stringify",
- "author": {
- "name": "Titus Wormer",
- "email": "tituswormer@gmail.com"
- },
- "bugs": {
- "url": "https://github.com/wooorm/markdown-table/issues"
- },
- "bundleDependencies": false,
- "deprecated": false,
- "description": "Markdown/ASCII tables",
- "devDependencies": {
- "chalk": "^1.0.0",
- "eslint": "^0.18.0",
- "istanbul": "^0.3.0",
- "jscs": "^1.0.0",
- "jscs-jsdoc": "^0.4.0",
- "mocha": "^2.0.0"
- },
- "homepage": "https://github.com/wooorm/markdown-table#readme",
- "keywords": [
- "text",
- "markdown",
- "table",
- "align",
- "ascii",
- "rows",
- "tabular"
- ],
- "license": "MIT",
- "name": "markdown-table",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/wooorm/markdown-table.git"
- },
- "scripts": {
- "lint": "npm run lint-api && npm run lint-test && npm run lint-style",
- "lint-api": "eslint index.js",
- "lint-style": "jscs --reporter inline index.js test.js",
- "lint-test": "eslint --env mocha test.js",
- "make": "npm run lint && npm run test-coverage",
- "test": "npm run test-api",
- "test-api": "_mocha --check-leaks test.js",
- "test-coverage": "istanbul cover _mocha -- -- test.js",
- "test-coveralls": "istanbul cover _mocha --report lcovonly -- --check-leaks test.js",
- "test-travis": "npm run test-coveralls"
- },
- "version": "0.4.0"
-}
diff --git a/tools/eslint/node_modules/parse5/README.md b/tools/eslint/node_modules/parse5/README.md
deleted file mode 100644
index 7b36f89336..0000000000
--- a/tools/eslint/node_modules/parse5/README.md
+++ /dev/null
@@ -1,40 +0,0 @@
-<p align="center">
- <a href="https://github.com/inikulin/parse5">
- <img src="https://raw.github.com/inikulin/parse5/master/docs/logo.png" alt="parse5" />
- </a>
-</p>
-
-<p align="center">
-<i>WHATWG HTML5 specification-compliant, fast and ready for production HTML parsing/serialization toolset for Node.js</i>
-</p>
-
-<p align="center">
- <a href="https://travis-ci.org/inikulin/parse5"><img alt="Build Status" src="https://api.travis-ci.org/inikulin/parse5.svg"></a>
- <a href="https://www.npmjs.com/package/parse5"><img alt="NPM Version" src="https://img.shields.io/npm/v/parse5.svg"></a>
- <a href="https://npmjs.org/package/parse5"><img alt="Downloads" src="http://img.shields.io/npm/dm/parse5.svg"></a>
- <a href="https://npmjs.org/package/parse5"><img alt="Downloads total" src="http://img.shields.io/npm/dt/parse5.svg"></a>
-</p>
-
-<p align="center">
-<b><i>parse5</i></b> provides nearly everything you may need when dealing with HTML. It's the fastest spec-compliant HTML parser
-for Node to date. It parses HTML the way the latest version of your browser does. It has proven itself reliable in such projects
-as <a href="https://github.com/tmpvar/jsdom">jsdom</a>, <a href="https://github.com/angular/angular">Angular2</a>, <a href="https://www.polymer-project.org">Polymer</a> and many more.
-</p>
-
-----
-
-<p align="center">
- <a href="https://github.com/inikulin/parse5/wiki/Documentation">Documentation</a>
-</p>
-
-<p align="center">
- <a href="https://github.com/inikulin/parse5/wiki/Documentation#version-history">Version history</a>
-</p>
-
-<p align="center">
- <a href="http://astexplorer.net/#/1CHlCXc4n4">Online playground</a>
-</p>
-
-<p align="center">
- <a href="https://github.com/inikulin/parse5/issues">Issue tracker</a>
-</p>
diff --git a/tools/eslint/node_modules/parse5/lib/common/doctype.js b/tools/eslint/node_modules/parse5/lib/common/doctype.js
deleted file mode 100644
index 2c6927a873..0000000000
--- a/tools/eslint/node_modules/parse5/lib/common/doctype.js
+++ /dev/null
@@ -1,137 +0,0 @@
-'use strict';
-
-//Const
-var VALID_DOCTYPE_NAME = 'html',
- QUIRKS_MODE_SYSTEM_ID = 'http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd',
- QUIRKS_MODE_PUBLIC_ID_PREFIXES = [
- '+//silmaril//dtd html pro v0r11 19970101//en',
- '-//advasoft ltd//dtd html 3.0 aswedit + extensions//en',
- '-//as//dtd html 3.0 aswedit + extensions//en',
- '-//ietf//dtd html 2.0 level 1//en',
- '-//ietf//dtd html 2.0 level 2//en',
- '-//ietf//dtd html 2.0 strict level 1//en',
- '-//ietf//dtd html 2.0 strict level 2//en',
- '-//ietf//dtd html 2.0 strict//en',
- '-//ietf//dtd html 2.0//en',
- '-//ietf//dtd html 2.1e//en',
- '-//ietf//dtd html 3.0//en',
- '-//ietf//dtd html 3.0//en//',
- '-//ietf//dtd html 3.2 final//en',
- '-//ietf//dtd html 3.2//en',
- '-//ietf//dtd html 3//en',
- '-//ietf//dtd html level 0//en',
- '-//ietf//dtd html level 0//en//2.0',
- '-//ietf//dtd html level 1//en',
- '-//ietf//dtd html level 1//en//2.0',
- '-//ietf//dtd html level 2//en',
- '-//ietf//dtd html level 2//en//2.0',
- '-//ietf//dtd html level 3//en',
- '-//ietf//dtd html level 3//en//3.0',
- '-//ietf//dtd html strict level 0//en',
- '-//ietf//dtd html strict level 0//en//2.0',
- '-//ietf//dtd html strict level 1//en',
- '-//ietf//dtd html strict level 1//en//2.0',
- '-//ietf//dtd html strict level 2//en',
- '-//ietf//dtd html strict level 2//en//2.0',
- '-//ietf//dtd html strict level 3//en',
- '-//ietf//dtd html strict level 3//en//3.0',
- '-//ietf//dtd html strict//en',
- '-//ietf//dtd html strict//en//2.0',
- '-//ietf//dtd html strict//en//3.0',
- '-//ietf//dtd html//en',
- '-//ietf//dtd html//en//2.0',
- '-//ietf//dtd html//en//3.0',
- '-//metrius//dtd metrius presentational//en',
- '-//microsoft//dtd internet explorer 2.0 html strict//en',
- '-//microsoft//dtd internet explorer 2.0 html//en',
- '-//microsoft//dtd internet explorer 2.0 tables//en',
- '-//microsoft//dtd internet explorer 3.0 html strict//en',
- '-//microsoft//dtd internet explorer 3.0 html//en',
- '-//microsoft//dtd internet explorer 3.0 tables//en',
- '-//netscape comm. corp.//dtd html//en',
- '-//netscape comm. corp.//dtd strict html//en',
- '-//o\'reilly and associates//dtd html 2.0//en',
- '-//o\'reilly and associates//dtd html extended 1.0//en',
- '-//spyglass//dtd html 2.0 extended//en',
- '-//sq//dtd html 2.0 hotmetal + extensions//en',
- '-//sun microsystems corp.//dtd hotjava html//en',
- '-//sun microsystems corp.//dtd hotjava strict html//en',
- '-//w3c//dtd html 3 1995-03-24//en',
- '-//w3c//dtd html 3.2 draft//en',
- '-//w3c//dtd html 3.2 final//en',
- '-//w3c//dtd html 3.2//en',
- '-//w3c//dtd html 3.2s draft//en',
- '-//w3c//dtd html 4.0 frameset//en',
- '-//w3c//dtd html 4.0 transitional//en',
- '-//w3c//dtd html experimental 19960712//en',
- '-//w3c//dtd html experimental 970421//en',
- '-//w3c//dtd w3 html//en',
- '-//w3o//dtd w3 html 3.0//en',
- '-//w3o//dtd w3 html 3.0//en//',
- '-//webtechs//dtd mozilla html 2.0//en',
- '-//webtechs//dtd mozilla html//en'
- ],
- QUIRKS_MODE_NO_SYSTEM_ID_PUBLIC_ID_PREFIXES = [
- '-//w3c//dtd html 4.01 frameset//',
- '-//w3c//dtd html 4.01 transitional//'
- ],
- QUIRKS_MODE_PUBLIC_IDS = [
- '-//w3o//dtd w3 html strict 3.0//en//',
- '-/w3c/dtd html 4.0 transitional/en',
- 'html'
- ];
-
-
-//Utils
-function enquoteDoctypeId(id) {
- var quote = id.indexOf('"') !== -1 ? '\'' : '"';
-
- return quote + id + quote;
-}
-
-
-//API
-exports.isQuirks = function (name, publicId, systemId) {
- if (name !== VALID_DOCTYPE_NAME)
- return true;
-
- if (systemId && systemId.toLowerCase() === QUIRKS_MODE_SYSTEM_ID)
- return true;
-
- if (publicId !== null) {
- publicId = publicId.toLowerCase();
-
- if (QUIRKS_MODE_PUBLIC_IDS.indexOf(publicId) > -1)
- return true;
-
- var prefixes = QUIRKS_MODE_PUBLIC_ID_PREFIXES;
-
- if (systemId === null)
- prefixes = prefixes.concat(QUIRKS_MODE_NO_SYSTEM_ID_PUBLIC_ID_PREFIXES);
-
- for (var i = 0; i < prefixes.length; i++) {
- if (publicId.indexOf(prefixes[i]) === 0)
- return true;
- }
- }
-
- return false;
-};
-
-exports.serializeContent = function (name, publicId, systemId) {
- var str = '!DOCTYPE ';
-
- if (name)
- str += name;
-
- if (publicId !== null)
- str += ' PUBLIC ' + enquoteDoctypeId(publicId);
-
- else if (systemId !== null)
- str += ' SYSTEM';
-
- if (systemId !== null)
- str += ' ' + enquoteDoctypeId(systemId);
-
- return str;
-};
diff --git a/tools/eslint/node_modules/parse5/lib/common/foreign_content.js b/tools/eslint/node_modules/parse5/lib/common/foreign_content.js
deleted file mode 100644
index 4dedbbffce..0000000000
--- a/tools/eslint/node_modules/parse5/lib/common/foreign_content.js
+++ /dev/null
@@ -1,260 +0,0 @@
-'use strict';
-
-var Tokenizer = require('../tokenizer'),
- HTML = require('./html');
-
-//Aliases
-var $ = HTML.TAG_NAMES,
- NS = HTML.NAMESPACES,
- ATTRS = HTML.ATTRS;
-
-
-//MIME types
-var MIME_TYPES = {
- TEXT_HTML: 'text/html',
- APPLICATION_XML: 'application/xhtml+xml'
-};
-
-//Attributes
-var DEFINITION_URL_ATTR = 'definitionurl',
- ADJUSTED_DEFINITION_URL_ATTR = 'definitionURL',
- SVG_ATTRS_ADJUSTMENT_MAP = {
- 'attributename': 'attributeName',
- 'attributetype': 'attributeType',
- 'basefrequency': 'baseFrequency',
- 'baseprofile': 'baseProfile',
- 'calcmode': 'calcMode',
- 'clippathunits': 'clipPathUnits',
- 'diffuseconstant': 'diffuseConstant',
- 'edgemode': 'edgeMode',
- 'filterunits': 'filterUnits',
- 'glyphref': 'glyphRef',
- 'gradienttransform': 'gradientTransform',
- 'gradientunits': 'gradientUnits',
- 'kernelmatrix': 'kernelMatrix',
- 'kernelunitlength': 'kernelUnitLength',
- 'keypoints': 'keyPoints',
- 'keysplines': 'keySplines',
- 'keytimes': 'keyTimes',
- 'lengthadjust': 'lengthAdjust',
- 'limitingconeangle': 'limitingConeAngle',
- 'markerheight': 'markerHeight',
- 'markerunits': 'markerUnits',
- 'markerwidth': 'markerWidth',
- 'maskcontentunits': 'maskContentUnits',
- 'maskunits': 'maskUnits',
- 'numoctaves': 'numOctaves',
- 'pathlength': 'pathLength',
- 'patterncontentunits': 'patternContentUnits',
- 'patterntransform': 'patternTransform',
- 'patternunits': 'patternUnits',
- 'pointsatx': 'pointsAtX',
- 'pointsaty': 'pointsAtY',
- 'pointsatz': 'pointsAtZ',
- 'preservealpha': 'preserveAlpha',
- 'preserveaspectratio': 'preserveAspectRatio',
- 'primitiveunits': 'primitiveUnits',
- 'refx': 'refX',
- 'refy': 'refY',
- 'repeatcount': 'repeatCount',
- 'repeatdur': 'repeatDur',
- 'requiredextensions': 'requiredExtensions',
- 'requiredfeatures': 'requiredFeatures',
- 'specularconstant': 'specularConstant',
- 'specularexponent': 'specularExponent',
- 'spreadmethod': 'spreadMethod',
- 'startoffset': 'startOffset',
- 'stddeviation': 'stdDeviation',
- 'stitchtiles': 'stitchTiles',
- 'surfacescale': 'surfaceScale',
- 'systemlanguage': 'systemLanguage',
- 'tablevalues': 'tableValues',
- 'targetx': 'targetX',
- 'targety': 'targetY',
- 'textlength': 'textLength',
- 'viewbox': 'viewBox',
- 'viewtarget': 'viewTarget',
- 'xchannelselector': 'xChannelSelector',
- 'ychannelselector': 'yChannelSelector',
- 'zoomandpan': 'zoomAndPan'
- },
- XML_ATTRS_ADJUSTMENT_MAP = {
- 'xlink:actuate': {prefix: 'xlink', name: 'actuate', namespace: NS.XLINK},
- 'xlink:arcrole': {prefix: 'xlink', name: 'arcrole', namespace: NS.XLINK},
- 'xlink:href': {prefix: 'xlink', name: 'href', namespace: NS.XLINK},
- 'xlink:role': {prefix: 'xlink', name: 'role', namespace: NS.XLINK},
- 'xlink:show': {prefix: 'xlink', name: 'show', namespace: NS.XLINK},
- 'xlink:title': {prefix: 'xlink', name: 'title', namespace: NS.XLINK},
- 'xlink:type': {prefix: 'xlink', name: 'type', namespace: NS.XLINK},
- 'xml:base': {prefix: 'xml', name: 'base', namespace: NS.XML},
- 'xml:lang': {prefix: 'xml', name: 'lang', namespace: NS.XML},
- 'xml:space': {prefix: 'xml', name: 'space', namespace: NS.XML},
- 'xmlns': {prefix: '', name: 'xmlns', namespace: NS.XMLNS},
- 'xmlns:xlink': {prefix: 'xmlns', name: 'xlink', namespace: NS.XMLNS}
-
- };
-
-//SVG tag names adjustment map
-var SVG_TAG_NAMES_ADJUSTMENT_MAP = exports.SVG_TAG_NAMES_ADJUSTMENT_MAP = {
- 'altglyph': 'altGlyph',
- 'altglyphdef': 'altGlyphDef',
- 'altglyphitem': 'altGlyphItem',
- 'animatecolor': 'animateColor',
- 'animatemotion': 'animateMotion',
- 'animatetransform': 'animateTransform',
- 'clippath': 'clipPath',
- 'feblend': 'feBlend',
- 'fecolormatrix': 'feColorMatrix',
- 'fecomponenttransfer': 'feComponentTransfer',
- 'fecomposite': 'feComposite',
- 'feconvolvematrix': 'feConvolveMatrix',
- 'fediffuselighting': 'feDiffuseLighting',
- 'fedisplacementmap': 'feDisplacementMap',
- 'fedistantlight': 'feDistantLight',
- 'feflood': 'feFlood',
- 'fefunca': 'feFuncA',
- 'fefuncb': 'feFuncB',
- 'fefuncg': 'feFuncG',
- 'fefuncr': 'feFuncR',
- 'fegaussianblur': 'feGaussianBlur',
- 'feimage': 'feImage',
- 'femerge': 'feMerge',
- 'femergenode': 'feMergeNode',
- 'femorphology': 'feMorphology',
- 'feoffset': 'feOffset',
- 'fepointlight': 'fePointLight',
- 'fespecularlighting': 'feSpecularLighting',
- 'fespotlight': 'feSpotLight',
- 'fetile': 'feTile',
- 'feturbulence': 'feTurbulence',
- 'foreignobject': 'foreignObject',
- 'glyphref': 'glyphRef',
- 'lineargradient': 'linearGradient',
- 'radialgradient': 'radialGradient',
- 'textpath': 'textPath'
-};
-
-//Tags that causes exit from foreign content
-var EXITS_FOREIGN_CONTENT = {};
-
-EXITS_FOREIGN_CONTENT[$.B] = true;
-EXITS_FOREIGN_CONTENT[$.BIG] = true;
-EXITS_FOREIGN_CONTENT[$.BLOCKQUOTE] = true;
-EXITS_FOREIGN_CONTENT[$.BODY] = true;
-EXITS_FOREIGN_CONTENT[$.BR] = true;
-EXITS_FOREIGN_CONTENT[$.CENTER] = true;
-EXITS_FOREIGN_CONTENT[$.CODE] = true;
-EXITS_FOREIGN_CONTENT[$.DD] = true;
-EXITS_FOREIGN_CONTENT[$.DIV] = true;
-EXITS_FOREIGN_CONTENT[$.DL] = true;
-EXITS_FOREIGN_CONTENT[$.DT] = true;
-EXITS_FOREIGN_CONTENT[$.EM] = true;
-EXITS_FOREIGN_CONTENT[$.EMBED] = true;
-EXITS_FOREIGN_CONTENT[$.H1] = true;
-EXITS_FOREIGN_CONTENT[$.H2] = true;
-EXITS_FOREIGN_CONTENT[$.H3] = true;
-EXITS_FOREIGN_CONTENT[$.H4] = true;
-EXITS_FOREIGN_CONTENT[$.H5] = true;
-EXITS_FOREIGN_CONTENT[$.H6] = true;
-EXITS_FOREIGN_CONTENT[$.HEAD] = true;
-EXITS_FOREIGN_CONTENT[$.HR] = true;
-EXITS_FOREIGN_CONTENT[$.I] = true;
-EXITS_FOREIGN_CONTENT[$.IMG] = true;
-EXITS_FOREIGN_CONTENT[$.LI] = true;
-EXITS_FOREIGN_CONTENT[$.LISTING] = true;
-EXITS_FOREIGN_CONTENT[$.MENU] = true;
-EXITS_FOREIGN_CONTENT[$.META] = true;
-EXITS_FOREIGN_CONTENT[$.NOBR] = true;
-EXITS_FOREIGN_CONTENT[$.OL] = true;
-EXITS_FOREIGN_CONTENT[$.P] = true;
-EXITS_FOREIGN_CONTENT[$.PRE] = true;
-EXITS_FOREIGN_CONTENT[$.RUBY] = true;
-EXITS_FOREIGN_CONTENT[$.S] = true;
-EXITS_FOREIGN_CONTENT[$.SMALL] = true;
-EXITS_FOREIGN_CONTENT[$.SPAN] = true;
-EXITS_FOREIGN_CONTENT[$.STRONG] = true;
-EXITS_FOREIGN_CONTENT[$.STRIKE] = true;
-EXITS_FOREIGN_CONTENT[$.SUB] = true;
-EXITS_FOREIGN_CONTENT[$.SUP] = true;
-EXITS_FOREIGN_CONTENT[$.TABLE] = true;
-EXITS_FOREIGN_CONTENT[$.TT] = true;
-EXITS_FOREIGN_CONTENT[$.U] = true;
-EXITS_FOREIGN_CONTENT[$.UL] = true;
-EXITS_FOREIGN_CONTENT[$.VAR] = true;
-
-//Check exit from foreign content
-exports.causesExit = function (startTagToken) {
- var tn = startTagToken.tagName;
- var isFontWithAttrs = tn === $.FONT && (Tokenizer.getTokenAttr(startTagToken, ATTRS.COLOR) !== null ||
- Tokenizer.getTokenAttr(startTagToken, ATTRS.SIZE) !== null ||
- Tokenizer.getTokenAttr(startTagToken, ATTRS.FACE) !== null);
-
- return isFontWithAttrs ? true : EXITS_FOREIGN_CONTENT[tn];
-};
-
-//Token adjustments
-exports.adjustTokenMathMLAttrs = function (token) {
- for (var i = 0; i < token.attrs.length; i++) {
- if (token.attrs[i].name === DEFINITION_URL_ATTR) {
- token.attrs[i].name = ADJUSTED_DEFINITION_URL_ATTR;
- break;
- }
- }
-};
-
-exports.adjustTokenSVGAttrs = function (token) {
- for (var i = 0; i < token.attrs.length; i++) {
- var adjustedAttrName = SVG_ATTRS_ADJUSTMENT_MAP[token.attrs[i].name];
-
- if (adjustedAttrName)
- token.attrs[i].name = adjustedAttrName;
- }
-};
-
-exports.adjustTokenXMLAttrs = function (token) {
- for (var i = 0; i < token.attrs.length; i++) {
- var adjustedAttrEntry = XML_ATTRS_ADJUSTMENT_MAP[token.attrs[i].name];
-
- if (adjustedAttrEntry) {
- token.attrs[i].prefix = adjustedAttrEntry.prefix;
- token.attrs[i].name = adjustedAttrEntry.name;
- token.attrs[i].namespace = adjustedAttrEntry.namespace;
- }
- }
-};
-
-exports.adjustTokenSVGTagName = function (token) {
- var adjustedTagName = SVG_TAG_NAMES_ADJUSTMENT_MAP[token.tagName];
-
- if (adjustedTagName)
- token.tagName = adjustedTagName;
-};
-
-//Integration points
-function isMathMLTextIntegrationPoint(tn, ns) {
- return ns === NS.MATHML && (tn === $.MI || tn === $.MO || tn === $.MN || tn === $.MS || tn === $.MTEXT);
-}
-
-function isHtmlIntegrationPoint(tn, ns, attrs) {
- if (ns === NS.MATHML && tn === $.ANNOTATION_XML) {
- for (var i = 0; i < attrs.length; i++) {
- if (attrs[i].name === ATTRS.ENCODING) {
- var value = attrs[i].value.toLowerCase();
-
- return value === MIME_TYPES.TEXT_HTML || value === MIME_TYPES.APPLICATION_XML;
- }
- }
- }
-
- return ns === NS.SVG && (tn === $.FOREIGN_OBJECT || tn === $.DESC || tn === $.TITLE);
-}
-
-exports.isIntegrationPoint = function (tn, ns, attrs, foreignNS) {
- if ((!foreignNS || foreignNS === NS.HTML) && isHtmlIntegrationPoint(tn, ns, attrs))
- return true;
-
- if ((!foreignNS || foreignNS === NS.MATHML) && isMathMLTextIntegrationPoint(tn, ns))
- return true;
-
- return false;
-};
diff --git a/tools/eslint/node_modules/parse5/lib/common/html.js b/tools/eslint/node_modules/parse5/lib/common/html.js
deleted file mode 100644
index d826eaa36d..0000000000
--- a/tools/eslint/node_modules/parse5/lib/common/html.js
+++ /dev/null
@@ -1,266 +0,0 @@
-'use strict';
-
-var NS = exports.NAMESPACES = {
- HTML: 'http://www.w3.org/1999/xhtml',
- MATHML: 'http://www.w3.org/1998/Math/MathML',
- SVG: 'http://www.w3.org/2000/svg',
- XLINK: 'http://www.w3.org/1999/xlink',
- XML: 'http://www.w3.org/XML/1998/namespace',
- XMLNS: 'http://www.w3.org/2000/xmlns/'
-};
-
-exports.ATTRS = {
- TYPE: 'type',
- ACTION: 'action',
- ENCODING: 'encoding',
- PROMPT: 'prompt',
- NAME: 'name',
- COLOR: 'color',
- FACE: 'face',
- SIZE: 'size'
-};
-
-var $ = exports.TAG_NAMES = {
- A: 'a',
- ADDRESS: 'address',
- ANNOTATION_XML: 'annotation-xml',
- APPLET: 'applet',
- AREA: 'area',
- ARTICLE: 'article',
- ASIDE: 'aside',
-
- B: 'b',
- BASE: 'base',
- BASEFONT: 'basefont',
- BGSOUND: 'bgsound',
- BIG: 'big',
- BLOCKQUOTE: 'blockquote',
- BODY: 'body',
- BR: 'br',
- BUTTON: 'button',
-
- CAPTION: 'caption',
- CENTER: 'center',
- CODE: 'code',
- COL: 'col',
- COLGROUP: 'colgroup',
-
- DD: 'dd',
- DESC: 'desc',
- DETAILS: 'details',
- DIALOG: 'dialog',
- DIR: 'dir',
- DIV: 'div',
- DL: 'dl',
- DT: 'dt',
-
- EM: 'em',
- EMBED: 'embed',
-
- FIELDSET: 'fieldset',
- FIGCAPTION: 'figcaption',
- FIGURE: 'figure',
- FONT: 'font',
- FOOTER: 'footer',
- FOREIGN_OBJECT: 'foreignObject',
- FORM: 'form',
- FRAME: 'frame',
- FRAMESET: 'frameset',
-
- H1: 'h1',
- H2: 'h2',
- H3: 'h3',
- H4: 'h4',
- H5: 'h5',
- H6: 'h6',
- HEAD: 'head',
- HEADER: 'header',
- HGROUP: 'hgroup',
- HR: 'hr',
- HTML: 'html',
-
- I: 'i',
- IMG: 'img',
- IMAGE: 'image',
- INPUT: 'input',
- IFRAME: 'iframe',
-
- KEYGEN: 'keygen',
-
- LABEL: 'label',
- LI: 'li',
- LINK: 'link',
- LISTING: 'listing',
-
- MAIN: 'main',
- MALIGNMARK: 'malignmark',
- MARQUEE: 'marquee',
- MATH: 'math',
- MENU: 'menu',
- MENUITEM: 'menuitem',
- META: 'meta',
- MGLYPH: 'mglyph',
- MI: 'mi',
- MO: 'mo',
- MN: 'mn',
- MS: 'ms',
- MTEXT: 'mtext',
-
- NAV: 'nav',
- NOBR: 'nobr',
- NOFRAMES: 'noframes',
- NOEMBED: 'noembed',
- NOSCRIPT: 'noscript',
-
- OBJECT: 'object',
- OL: 'ol',
- OPTGROUP: 'optgroup',
- OPTION: 'option',
-
- P: 'p',
- PARAM: 'param',
- PLAINTEXT: 'plaintext',
- PRE: 'pre',
-
- RB: 'rb',
- RP: 'rp',
- RT: 'rt',
- RTC: 'rtc',
- RUBY: 'ruby',
-
- S: 's',
- SCRIPT: 'script',
- SECTION: 'section',
- SELECT: 'select',
- SOURCE: 'source',
- SMALL: 'small',
- SPAN: 'span',
- STRIKE: 'strike',
- STRONG: 'strong',
- STYLE: 'style',
- SUB: 'sub',
- SUMMARY: 'summary',
- SUP: 'sup',
-
- TABLE: 'table',
- TBODY: 'tbody',
- TEMPLATE: 'template',
- TEXTAREA: 'textarea',
- TFOOT: 'tfoot',
- TD: 'td',
- TH: 'th',
- THEAD: 'thead',
- TITLE: 'title',
- TR: 'tr',
- TRACK: 'track',
- TT: 'tt',
-
- U: 'u',
- UL: 'ul',
-
- SVG: 'svg',
-
- VAR: 'var',
-
- WBR: 'wbr',
-
- XMP: 'xmp'
-};
-
-var SPECIAL_ELEMENTS = exports.SPECIAL_ELEMENTS = {};
-
-SPECIAL_ELEMENTS[NS.HTML] = {};
-SPECIAL_ELEMENTS[NS.HTML][$.ADDRESS] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.APPLET] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.AREA] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.ARTICLE] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.ASIDE] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.BASE] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.BASEFONT] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.BGSOUND] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.BLOCKQUOTE] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.BODY] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.BR] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.BUTTON] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.CAPTION] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.CENTER] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.COL] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.COLGROUP] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.DD] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.DETAILS] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.DIR] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.DIV] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.DL] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.DT] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.EMBED] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.FIELDSET] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.FIGCAPTION] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.FIGURE] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.FOOTER] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.FORM] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.FRAME] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.FRAMESET] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.H1] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.H2] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.H3] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.H4] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.H5] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.H6] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.HEAD] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.HEADER] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.HGROUP] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.HR] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.HTML] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.IFRAME] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.IMG] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.INPUT] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.LI] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.LINK] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.LISTING] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.MAIN] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.MARQUEE] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.MENU] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.META] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.NAV] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.NOEMBED] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.NOFRAMES] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.NOSCRIPT] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.OBJECT] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.OL] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.P] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.PARAM] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.PLAINTEXT] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.PRE] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.SCRIPT] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.SECTION] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.SELECT] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.SOURCE] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.STYLE] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.SUMMARY] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.TABLE] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.TBODY] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.TD] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.TEMPLATE] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.TEXTAREA] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.TFOOT] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.TH] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.THEAD] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.TITLE] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.TR] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.TRACK] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.UL] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.WBR] = true;
-SPECIAL_ELEMENTS[NS.HTML][$.XMP] = true;
-
-SPECIAL_ELEMENTS[NS.MATHML] = {};
-SPECIAL_ELEMENTS[NS.MATHML][$.MI] = true;
-SPECIAL_ELEMENTS[NS.MATHML][$.MO] = true;
-SPECIAL_ELEMENTS[NS.MATHML][$.MN] = true;
-SPECIAL_ELEMENTS[NS.MATHML][$.MS] = true;
-SPECIAL_ELEMENTS[NS.MATHML][$.MTEXT] = true;
-SPECIAL_ELEMENTS[NS.MATHML][$.ANNOTATION_XML] = true;
-
-SPECIAL_ELEMENTS[NS.SVG] = {};
-SPECIAL_ELEMENTS[NS.SVG][$.TITLE] = true;
-SPECIAL_ELEMENTS[NS.SVG][$.FOREIGN_OBJECT] = true;
-SPECIAL_ELEMENTS[NS.SVG][$.DESC] = true;
diff --git a/tools/eslint/node_modules/parse5/lib/common/merge_options.js b/tools/eslint/node_modules/parse5/lib/common/merge_options.js
deleted file mode 100644
index c35934a96a..0000000000
--- a/tools/eslint/node_modules/parse5/lib/common/merge_options.js
+++ /dev/null
@@ -1,13 +0,0 @@
-'use strict';
-
-module.exports = function mergeOptions(defaults, options) {
- options = options || {};
-
- return [defaults, options].reduce(function (merged, optObj) {
- Object.keys(optObj).forEach(function (key) {
- merged[key] = optObj[key];
- });
-
- return merged;
- }, {});
-};
diff --git a/tools/eslint/node_modules/parse5/lib/common/unicode.js b/tools/eslint/node_modules/parse5/lib/common/unicode.js
deleted file mode 100644
index 8777e97ab7..0000000000
--- a/tools/eslint/node_modules/parse5/lib/common/unicode.js
+++ /dev/null
@@ -1,47 +0,0 @@
-'use strict';
-
-exports.REPLACEMENT_CHARACTER = '\uFFFD';
-
-exports.CODE_POINTS = {
- EOF: -1,
- NULL: 0x00,
- TABULATION: 0x09,
- CARRIAGE_RETURN: 0x0D,
- LINE_FEED: 0x0A,
- FORM_FEED: 0x0C,
- SPACE: 0x20,
- EXCLAMATION_MARK: 0x21,
- QUOTATION_MARK: 0x22,
- NUMBER_SIGN: 0x23,
- AMPERSAND: 0x26,
- APOSTROPHE: 0x27,
- HYPHEN_MINUS: 0x2D,
- SOLIDUS: 0x2F,
- DIGIT_0: 0x30,
- DIGIT_9: 0x39,
- SEMICOLON: 0x3B,
- LESS_THAN_SIGN: 0x3C,
- EQUALS_SIGN: 0x3D,
- GREATER_THAN_SIGN: 0x3E,
- QUESTION_MARK: 0x3F,
- LATIN_CAPITAL_A: 0x41,
- LATIN_CAPITAL_F: 0x46,
- LATIN_CAPITAL_X: 0x58,
- LATIN_CAPITAL_Z: 0x5A,
- GRAVE_ACCENT: 0x60,
- LATIN_SMALL_A: 0x61,
- LATIN_SMALL_F: 0x66,
- LATIN_SMALL_X: 0x78,
- LATIN_SMALL_Z: 0x7A,
- REPLACEMENT_CHARACTER: 0xFFFD
-};
-
-exports.CODE_POINT_SEQUENCES = {
- DASH_DASH_STRING: [0x2D, 0x2D], //--
- DOCTYPE_STRING: [0x44, 0x4F, 0x43, 0x54, 0x59, 0x50, 0x45], //DOCTYPE
- CDATA_START_STRING: [0x5B, 0x43, 0x44, 0x41, 0x54, 0x41, 0x5B], //[CDATA[
- CDATA_END_STRING: [0x5D, 0x5D, 0x3E], //]]>
- SCRIPT_STRING: [0x73, 0x63, 0x72, 0x69, 0x70, 0x74], //script
- PUBLIC_STRING: [0x50, 0x55, 0x42, 0x4C, 0x49, 0x43], //PUBLIC
- SYSTEM_STRING: [0x53, 0x59, 0x53, 0x54, 0x45, 0x4D] //SYSTEM
-};
diff --git a/tools/eslint/node_modules/parse5/lib/index.js b/tools/eslint/node_modules/parse5/lib/index.js
deleted file mode 100644
index 28663c2193..0000000000
--- a/tools/eslint/node_modules/parse5/lib/index.js
+++ /dev/null
@@ -1,108 +0,0 @@
-'use strict';
-
-var Parser = require('./parser'),
- Serializer = require('./serializer');
-
-/** @namespace parse5 */
-
-/**
- * Parses an HTML string.
- * @function parse
- * @memberof parse5
- * @instance
- * @param {string} html - Input HTML string.
- * @param {ParserOptions} [options] - Parsing options.
- * @returns {ASTNode<Document>} document
- * @example
- * var parse5 = require('parse5');
- *
- * var document = parse5.parse('<!DOCTYPE html><html><head></head><body>Hi there!</body></html>');
- */
-exports.parse = function parse(html, options) {
- var parser = new Parser(options);
-
- return parser.parse(html);
-};
-
-/**
- * Parses an HTML fragment.
- * @function parseFragment
- * @memberof parse5
- * @instance
- * @param {ASTNode} [fragmentContext] - Parsing context element. If specified, given fragment
- * will be parsed as if it was set to the context element's `innerHTML` property.
- * @param {string} html - Input HTML fragment string.
- * @param {ParserOptions} [options] - Parsing options.
- * @returns {ASTNode<DocumentFragment>} documentFragment
- * @example
- * var parse5 = require('parse5');
- *
- * var documentFragment = parse5.parseFragment('<table></table>');
- *
- * // Parses the html fragment in the context of the parsed <table> element.
- * var trFragment = parser.parseFragment(documentFragment.childNodes[0], '<tr><td>Shake it, baby</td></tr>');
- */
-exports.parseFragment = function parseFragment(fragmentContext, html, options) {
- if (typeof fragmentContext === 'string') {
- options = html;
- html = fragmentContext;
- fragmentContext = null;
- }
-
- var parser = new Parser(options);
-
- return parser.parseFragment(html, fragmentContext);
-};
-
-/**
- * Serializes an AST node to an HTML string.
- * @function serialize
- * @memberof parse5
- * @instance
- * @param {ASTNode} node - Node to serialize.
- * @param {SerializerOptions} [options] - Serialization options.
- * @returns {String} html
- * @example
- * var parse5 = require('parse5');
- *
- * var document = parse5.parse('<!DOCTYPE html><html><head></head><body>Hi there!</body></html>');
- *
- * // Serializes a document.
- * var html = parse5.serialize(document);
- *
- * // Serializes the <body> element content.
- * var bodyInnerHtml = parse5.serialize(document.childNodes[0].childNodes[1]);
- */
-exports.serialize = function (node, options) {
- var serializer = new Serializer(node, options);
-
- return serializer.serialize();
-};
-
-/**
- * Provides built-in tree adapters that can be used for parsing and serialization.
- * @var treeAdapters
- * @memberof parse5
- * @instance
- * @property {TreeAdapter} default - Default tree format for parse5.
- * @property {TreeAdapter} htmlparser2 - Quite popular [htmlparser2](https://github.com/fb55/htmlparser2) tree format
- * (e.g. used by [cheerio](https://github.com/MatthewMueller/cheerio) and [jsdom](https://github.com/tmpvar/jsdom)).
- * @example
- * var parse5 = require('parse5');
- *
- * // Uses the default tree adapter for parsing.
- * var document = parse5.parse('<div></div>', { treeAdapter: parse5.treeAdapters.default });
- *
- * // Uses the htmlparser2 tree adapter with the SerializerStream.
- * var serializer = new parse5.SerializerStream(node, { treeAdapter: parse5.treeAdapters.htmlparser2 });
- */
-exports.treeAdapters = {
- default: require('./tree_adapters/default'),
- htmlparser2: require('./tree_adapters/htmlparser2')
-};
-
-
-// Streaming
-exports.ParserStream = require('./parser/stream');
-exports.SerializerStream = require('./serializer/stream');
-exports.SAXParser = require('./sax');
diff --git a/tools/eslint/node_modules/parse5/lib/location_info/parser_mixin.js b/tools/eslint/node_modules/parse5/lib/location_info/parser_mixin.js
deleted file mode 100644
index c92baf5606..0000000000
--- a/tools/eslint/node_modules/parse5/lib/location_info/parser_mixin.js
+++ /dev/null
@@ -1,217 +0,0 @@
-'use strict';
-
-var OpenElementStack = require('../parser/open_element_stack'),
- Tokenizer = require('../tokenizer'),
- HTML = require('../common/html');
-
-
-//Aliases
-var $ = HTML.TAG_NAMES;
-
-
-function setEndLocation(element, closingToken, treeAdapter) {
- var loc = element.__location;
-
- if (!loc)
- return;
-
- /**
- * @typedef {Object} ElementLocationInfo
- * @extends StartTagLocationInfo
- *
- * @property {StartTagLocationInfo} startTag - Element's start tag location info.
- * @property {LocationInfo} endTag - Element's end tag location info.
- */
- if (!loc.startTag) {
- loc.startTag = {
- line: loc.line,
- col: loc.col,
- startOffset: loc.startOffset,
- endOffset: loc.endOffset
- };
- if (loc.attrs)
- loc.startTag.attrs = loc.attrs;
- }
-
- if (closingToken.location) {
- var ctLocation = closingToken.location,
- tn = treeAdapter.getTagName(element),
- // NOTE: For cases like <p> <p> </p> - First 'p' closes without a closing tag and
- // for cases like <td> <p> </td> - 'p' closes without a closing tag
- isClosingEndTag = closingToken.type === Tokenizer.END_TAG_TOKEN &&
- tn === closingToken.tagName;
-
- if (isClosingEndTag) {
- loc.endTag = {
- line: ctLocation.line,
- col: ctLocation.col,
- startOffset: ctLocation.startOffset,
- endOffset: ctLocation.endOffset
- };
- }
-
- if (isClosingEndTag)
- loc.endOffset = ctLocation.endOffset;
- else
- loc.endOffset = ctLocation.startOffset;
- }
-}
-
-
-exports.assign = function (parser) {
- //NOTE: obtain Parser proto this way to avoid module circular references
- var parserProto = Object.getPrototypeOf(parser),
- treeAdapter = parser.treeAdapter,
- attachableElementLocation = null,
- lastFosterParentingLocation = null,
- currentToken = null;
-
-
- //NOTE: patch _bootstrap method
- parser._bootstrap = function (document, fragmentContext) {
- parserProto._bootstrap.call(this, document, fragmentContext);
-
- attachableElementLocation = null;
- lastFosterParentingLocation = null;
- currentToken = null;
-
- //OpenElementStack
- parser.openElements.pop = function () {
- setEndLocation(this.current, currentToken, treeAdapter);
- OpenElementStack.prototype.pop.call(this);
- };
-
- parser.openElements.popAllUpToHtmlElement = function () {
- for (var i = this.stackTop; i > 0; i--)
- setEndLocation(this.items[i], currentToken, treeAdapter);
-
- OpenElementStack.prototype.popAllUpToHtmlElement.call(this);
- };
-
- parser.openElements.remove = function (element) {
- setEndLocation(element, currentToken, treeAdapter);
- OpenElementStack.prototype.remove.call(this, element);
- };
- };
-
-
- //Token processing
- parser._processTokenInForeignContent = function (token) {
- currentToken = token;
- parserProto._processTokenInForeignContent.call(this, token);
- };
-
- parser._processToken = function (token) {
- currentToken = token;
- parserProto._processToken.call(this, token);
-
- //NOTE: <body> and <html> are never popped from the stack, so we need to updated
- //their end location explicitly.
- if (token.type === Tokenizer.END_TAG_TOKEN &&
- (token.tagName === $.HTML ||
- token.tagName === $.BODY && this.openElements.hasInScope($.BODY))) {
- for (var i = this.openElements.stackTop; i >= 0; i--) {
- var element = this.openElements.items[i];
-
- if (this.treeAdapter.getTagName(element) === token.tagName) {
- setEndLocation(element, token, treeAdapter);
- break;
- }
- }
- }
- };
-
-
- //Doctype
- parser._setDocumentType = function (token) {
- parserProto._setDocumentType.call(this, token);
-
- var documentChildren = this.treeAdapter.getChildNodes(this.document),
- cnLength = documentChildren.length;
-
- for (var i = 0; i < cnLength; i++) {
- var node = documentChildren[i];
-
- if (this.treeAdapter.isDocumentTypeNode(node)) {
- node.__location = token.location;
- break;
- }
- }
- };
-
-
- //Elements
- parser._attachElementToTree = function (element) {
- //NOTE: _attachElementToTree is called from _appendElement, _insertElement and _insertTemplate methods.
- //So we will use token location stored in this methods for the element.
- element.__location = attachableElementLocation || null;
- attachableElementLocation = null;
- parserProto._attachElementToTree.call(this, element);
- };
-
- parser._appendElement = function (token, namespaceURI) {
- attachableElementLocation = token.location;
- parserProto._appendElement.call(this, token, namespaceURI);
- };
-
- parser._insertElement = function (token, namespaceURI) {
- attachableElementLocation = token.location;
- parserProto._insertElement.call(this, token, namespaceURI);
- };
-
- parser._insertTemplate = function (token) {
- attachableElementLocation = token.location;
- parserProto._insertTemplate.call(this, token);
-
- var tmplContent = this.treeAdapter.getTemplateContent(this.openElements.current);
-
- tmplContent.__location = null;
- };
-
- parser._insertFakeRootElement = function () {
- parserProto._insertFakeRootElement.call(this);
- this.openElements.current.__location = null;
- };
-
-
- //Comments
- parser._appendCommentNode = function (token, parent) {
- parserProto._appendCommentNode.call(this, token, parent);
-
- var children = this.treeAdapter.getChildNodes(parent),
- commentNode = children[children.length - 1];
-
- commentNode.__location = token.location;
- };
-
-
- //Text
- parser._findFosterParentingLocation = function () {
- //NOTE: store last foster parenting location, so we will be able to find inserted text
- //in case of foster parenting
- lastFosterParentingLocation = parserProto._findFosterParentingLocation.call(this);
- return lastFosterParentingLocation;
- };
-
- parser._insertCharacters = function (token) {
- parserProto._insertCharacters.call(this, token);
-
- var hasFosterParent = this._shouldFosterParentOnInsertion(),
- parent = hasFosterParent && lastFosterParentingLocation.parent ||
- this.openElements.currentTmplContent ||
- this.openElements.current,
- siblings = this.treeAdapter.getChildNodes(parent),
- textNodeIdx = hasFosterParent && lastFosterParentingLocation.beforeElement ?
- siblings.indexOf(lastFosterParentingLocation.beforeElement) - 1 :
- siblings.length - 1,
- textNode = siblings[textNodeIdx];
-
- //NOTE: if we have location assigned by another token, then just update end position
- if (textNode.__location)
- textNode.__location.endOffset = token.location.endOffset;
-
- else
- textNode.__location = token.location;
- };
-};
-
diff --git a/tools/eslint/node_modules/parse5/lib/location_info/tokenizer_mixin.js b/tools/eslint/node_modules/parse5/lib/location_info/tokenizer_mixin.js
deleted file mode 100644
index bbdebd7cfc..0000000000
--- a/tools/eslint/node_modules/parse5/lib/location_info/tokenizer_mixin.js
+++ /dev/null
@@ -1,169 +0,0 @@
-'use strict';
-
-var UNICODE = require('../common/unicode');
-
-//Aliases
-var $ = UNICODE.CODE_POINTS;
-
-
-exports.assign = function (tokenizer) {
- //NOTE: obtain Tokenizer proto this way to avoid module circular references
- var tokenizerProto = Object.getPrototypeOf(tokenizer),
- tokenStartOffset = -1,
- tokenCol = -1,
- tokenLine = 1,
- isEol = false,
- lineStartPosStack = [0],
- lineStartPos = 0,
- col = -1,
- line = 1;
-
- function attachLocationInfo(token) {
- /**
- * @typedef {Object} LocationInfo
- *
- * @property {Number} line - One-based line index
- * @property {Number} col - One-based column index
- * @property {Number} startOffset - Zero-based first character index
- * @property {Number} endOffset - Zero-based last character index
- */
- token.location = {
- line: tokenLine,
- col: tokenCol,
- startOffset: tokenStartOffset,
- endOffset: -1
- };
- }
-
- //NOTE: patch consumption method to track line/col information
- tokenizer._consume = function () {
- var cp = tokenizerProto._consume.call(this);
-
- //NOTE: LF should be in the last column of the line
- if (isEol) {
- isEol = false;
- line++;
- lineStartPosStack.push(this.preprocessor.sourcePos);
- lineStartPos = this.preprocessor.sourcePos;
- }
-
- if (cp === $.LINE_FEED)
- isEol = true;
-
- col = this.preprocessor.sourcePos - lineStartPos + 1;
-
- return cp;
- };
-
- tokenizer._unconsume = function () {
- tokenizerProto._unconsume.call(this);
- isEol = false;
-
- while (lineStartPos > this.preprocessor.sourcePos && lineStartPosStack.length > 1) {
- lineStartPos = lineStartPosStack.pop();
- line--;
- }
-
- col = this.preprocessor.sourcePos - lineStartPos + 1;
- };
-
- //NOTE: patch token creation methods and attach location objects
- tokenizer._createStartTagToken = function () {
- tokenizerProto._createStartTagToken.call(this);
- attachLocationInfo(this.currentToken);
- };
-
- tokenizer._createEndTagToken = function () {
- tokenizerProto._createEndTagToken.call(this);
- attachLocationInfo(this.currentToken);
- };
-
- tokenizer._createCommentToken = function () {
- tokenizerProto._createCommentToken.call(this);
- attachLocationInfo(this.currentToken);
- };
-
- tokenizer._createDoctypeToken = function (initialName) {
- tokenizerProto._createDoctypeToken.call(this, initialName);
- attachLocationInfo(this.currentToken);
- };
-
- tokenizer._createCharacterToken = function (type, ch) {
- tokenizerProto._createCharacterToken.call(this, type, ch);
- attachLocationInfo(this.currentCharacterToken);
- };
-
- tokenizer._createAttr = function (attrNameFirstCh) {
- tokenizerProto._createAttr.call(this, attrNameFirstCh);
- this.currentAttrLocation = {
- line: line,
- col: col,
- startOffset: this.preprocessor.sourcePos,
- endOffset: -1
- };
- };
-
- tokenizer._leaveAttrName = function (toState) {
- tokenizerProto._leaveAttrName.call(this, toState);
- this._attachCurrentAttrLocationInfo();
- };
-
- tokenizer._leaveAttrValue = function (toState) {
- tokenizerProto._leaveAttrValue.call(this, toState);
- this._attachCurrentAttrLocationInfo();
- };
-
- tokenizer._attachCurrentAttrLocationInfo = function () {
- this.currentAttrLocation.endOffset = this.preprocessor.sourcePos;
-
- if (!this.currentToken.location.attrs)
- this.currentToken.location.attrs = {};
-
- /**
- * @typedef {Object} StartTagLocationInfo
- * @extends LocationInfo
- *
- * @property {Dictionary<String, LocationInfo>} attrs - Start tag attributes' location info.
- */
- this.currentToken.location.attrs[this.currentAttr.name] = this.currentAttrLocation;
- };
-
- //NOTE: patch token emission methods to determine end location
- tokenizer._emitCurrentToken = function () {
- //NOTE: if we have pending character token make it's end location equal to the
- //current token's start location.
- if (this.currentCharacterToken)
- this.currentCharacterToken.location.endOffset = this.currentToken.location.startOffset;
-
- this.currentToken.location.endOffset = this.preprocessor.sourcePos + 1;
- tokenizerProto._emitCurrentToken.call(this);
- };
-
- tokenizer._emitCurrentCharacterToken = function () {
- //NOTE: if we have character token and it's location wasn't set in the _emitCurrentToken(),
- //then set it's location at the current preprocessor position.
- //We don't need to increment preprocessor position, since character token
- //emission is always forced by the start of the next character token here.
- //So, we already have advanced position.
- if (this.currentCharacterToken && this.currentCharacterToken.location.endOffset === -1)
- this.currentCharacterToken.location.endOffset = this.preprocessor.sourcePos;
-
- tokenizerProto._emitCurrentCharacterToken.call(this);
- };
-
- //NOTE: patch initial states for each mode to obtain token start position
- Object.keys(tokenizerProto.MODE)
-
- .map(function (modeName) {
- return tokenizerProto.MODE[modeName];
- })
-
- .forEach(function (state) {
- tokenizer[state] = function (cp) {
- tokenStartOffset = this.preprocessor.sourcePos;
- tokenLine = line;
- tokenCol = col;
- tokenizerProto[state].call(this, cp);
- };
- });
-};
diff --git a/tools/eslint/node_modules/parse5/lib/parser/formatting_element_list.js b/tools/eslint/node_modules/parse5/lib/parser/formatting_element_list.js
deleted file mode 100644
index e1711910e3..0000000000
--- a/tools/eslint/node_modules/parse5/lib/parser/formatting_element_list.js
+++ /dev/null
@@ -1,167 +0,0 @@
-'use strict';
-
-//Const
-var NOAH_ARK_CAPACITY = 3;
-
-//List of formatting elements
-var FormattingElementList = module.exports = function (treeAdapter) {
- this.length = 0;
- this.entries = [];
- this.treeAdapter = treeAdapter;
- this.bookmark = null;
-};
-
-//Entry types
-FormattingElementList.MARKER_ENTRY = 'MARKER_ENTRY';
-FormattingElementList.ELEMENT_ENTRY = 'ELEMENT_ENTRY';
-
-//Noah Ark's condition
-//OPTIMIZATION: at first we try to find possible candidates for exclusion using
-//lightweight heuristics without thorough attributes check.
-FormattingElementList.prototype._getNoahArkConditionCandidates = function (newElement) {
- var candidates = [];
-
- if (this.length >= NOAH_ARK_CAPACITY) {
- var neAttrsLength = this.treeAdapter.getAttrList(newElement).length,
- neTagName = this.treeAdapter.getTagName(newElement),
- neNamespaceURI = this.treeAdapter.getNamespaceURI(newElement);
-
- for (var i = this.length - 1; i >= 0; i--) {
- var entry = this.entries[i];
-
- if (entry.type === FormattingElementList.MARKER_ENTRY)
- break;
-
- var element = entry.element,
- elementAttrs = this.treeAdapter.getAttrList(element),
- isCandidate = this.treeAdapter.getTagName(element) === neTagName &&
- this.treeAdapter.getNamespaceURI(element) === neNamespaceURI &&
- elementAttrs.length === neAttrsLength;
-
- if (isCandidate)
- candidates.push({idx: i, attrs: elementAttrs});
- }
- }
-
- return candidates.length < NOAH_ARK_CAPACITY ? [] : candidates;
-};
-
-FormattingElementList.prototype._ensureNoahArkCondition = function (newElement) {
- var candidates = this._getNoahArkConditionCandidates(newElement),
- cLength = candidates.length;
-
- if (cLength) {
- var neAttrs = this.treeAdapter.getAttrList(newElement),
- neAttrsLength = neAttrs.length,
- neAttrsMap = {};
-
- //NOTE: build attrs map for the new element so we can perform fast lookups
- for (var i = 0; i < neAttrsLength; i++) {
- var neAttr = neAttrs[i];
-
- neAttrsMap[neAttr.name] = neAttr.value;
- }
-
- for (i = 0; i < neAttrsLength; i++) {
- for (var j = 0; j < cLength; j++) {
- var cAttr = candidates[j].attrs[i];
-
- if (neAttrsMap[cAttr.name] !== cAttr.value) {
- candidates.splice(j, 1);
- cLength--;
- }
-
- if (candidates.length < NOAH_ARK_CAPACITY)
- return;
- }
- }
-
- //NOTE: remove bottommost candidates until Noah's Ark condition will not be met
- for (i = cLength - 1; i >= NOAH_ARK_CAPACITY - 1; i--) {
- this.entries.splice(candidates[i].idx, 1);
- this.length--;
- }
- }
-};
-
-//Mutations
-FormattingElementList.prototype.insertMarker = function () {
- this.entries.push({type: FormattingElementList.MARKER_ENTRY});
- this.length++;
-};
-
-FormattingElementList.prototype.pushElement = function (element, token) {
- this._ensureNoahArkCondition(element);
-
- this.entries.push({
- type: FormattingElementList.ELEMENT_ENTRY,
- element: element,
- token: token
- });
-
- this.length++;
-};
-
-FormattingElementList.prototype.insertElementAfterBookmark = function (element, token) {
- var bookmarkIdx = this.length - 1;
-
- for (; bookmarkIdx >= 0; bookmarkIdx--) {
- if (this.entries[bookmarkIdx] === this.bookmark)
- break;
- }
-
- this.entries.splice(bookmarkIdx + 1, 0, {
- type: FormattingElementList.ELEMENT_ENTRY,
- element: element,
- token: token
- });
-
- this.length++;
-};
-
-FormattingElementList.prototype.removeEntry = function (entry) {
- for (var i = this.length - 1; i >= 0; i--) {
- if (this.entries[i] === entry) {
- this.entries.splice(i, 1);
- this.length--;
- break;
- }
- }
-};
-
-FormattingElementList.prototype.clearToLastMarker = function () {
- while (this.length) {
- var entry = this.entries.pop();
-
- this.length--;
-
- if (entry.type === FormattingElementList.MARKER_ENTRY)
- break;
- }
-};
-
-//Search
-FormattingElementList.prototype.getElementEntryInScopeWithTagName = function (tagName) {
- for (var i = this.length - 1; i >= 0; i--) {
- var entry = this.entries[i];
-
- if (entry.type === FormattingElementList.MARKER_ENTRY)
- return null;
-
- if (this.treeAdapter.getTagName(entry.element) === tagName)
- return entry;
- }
-
- return null;
-};
-
-FormattingElementList.prototype.getElementEntry = function (element) {
- for (var i = this.length - 1; i >= 0; i--) {
- var entry = this.entries[i];
-
- if (entry.type === FormattingElementList.ELEMENT_ENTRY && entry.element === element)
- return entry;
- }
-
- return null;
-};
diff --git a/tools/eslint/node_modules/parse5/lib/parser/index.js b/tools/eslint/node_modules/parse5/lib/parser/index.js
deleted file mode 100644
index bdf192050d..0000000000
--- a/tools/eslint/node_modules/parse5/lib/parser/index.js
+++ /dev/null
@@ -1,2817 +0,0 @@
-'use strict';
-
-var Tokenizer = require('../tokenizer'),
- OpenElementStack = require('./open_element_stack'),
- FormattingElementList = require('./formatting_element_list'),
- locationInfoMixin = require('../location_info/parser_mixin'),
- defaultTreeAdapter = require('../tree_adapters/default'),
- doctype = require('../common/doctype'),
- foreignContent = require('../common/foreign_content'),
- mergeOptions = require('../common/merge_options'),
- UNICODE = require('../common/unicode'),
- HTML = require('../common/html');
-
-//Aliases
-var $ = HTML.TAG_NAMES,
- NS = HTML.NAMESPACES,
- ATTRS = HTML.ATTRS;
-
-/**
- * @typedef {Object} ParserOptions
- *
- * @property {Boolean} [locationInfo=false] - Enables source code location information for the nodes.
- * When enabled, each node (except root node) has the `__location` property. In case the node is not an empty element,
- * `__location` will be {@link ElementLocationInfo} object, otherwise it's {@link LocationInfo}.
- * If the element was implicitly created by the parser it's `__location` property will be `null`.
- *
- * @property {TreeAdapter} [treeAdapter=parse5.treeAdapters.default] - Specifies the resulting tree format.
- */
-var DEFAULT_OPTIONS = {
- locationInfo: false,
- treeAdapter: defaultTreeAdapter
-};
-
-//Misc constants
-var HIDDEN_INPUT_TYPE = 'hidden';
-
-//Adoption agency loops iteration count
-var AA_OUTER_LOOP_ITER = 8,
- AA_INNER_LOOP_ITER = 3;
-
-//Insertion modes
-var INITIAL_MODE = 'INITIAL_MODE',
- BEFORE_HTML_MODE = 'BEFORE_HTML_MODE',
- BEFORE_HEAD_MODE = 'BEFORE_HEAD_MODE',
- IN_HEAD_MODE = 'IN_HEAD_MODE',
- AFTER_HEAD_MODE = 'AFTER_HEAD_MODE',
- IN_BODY_MODE = 'IN_BODY_MODE',
- TEXT_MODE = 'TEXT_MODE',
- IN_TABLE_MODE = 'IN_TABLE_MODE',
- IN_TABLE_TEXT_MODE = 'IN_TABLE_TEXT_MODE',
- IN_CAPTION_MODE = 'IN_CAPTION_MODE',
- IN_COLUMN_GROUP_MODE = 'IN_COLUMN_GROUP_MODE',
- IN_TABLE_BODY_MODE = 'IN_TABLE_BODY_MODE',
- IN_ROW_MODE = 'IN_ROW_MODE',
- IN_CELL_MODE = 'IN_CELL_MODE',
- IN_SELECT_MODE = 'IN_SELECT_MODE',
- IN_SELECT_IN_TABLE_MODE = 'IN_SELECT_IN_TABLE_MODE',
- IN_TEMPLATE_MODE = 'IN_TEMPLATE_MODE',
- AFTER_BODY_MODE = 'AFTER_BODY_MODE',
- IN_FRAMESET_MODE = 'IN_FRAMESET_MODE',
- AFTER_FRAMESET_MODE = 'AFTER_FRAMESET_MODE',
- AFTER_AFTER_BODY_MODE = 'AFTER_AFTER_BODY_MODE',
- AFTER_AFTER_FRAMESET_MODE = 'AFTER_AFTER_FRAMESET_MODE';
-
-//Insertion mode reset map
-var INSERTION_MODE_RESET_MAP = {};
-
-INSERTION_MODE_RESET_MAP[$.TR] = IN_ROW_MODE;
-INSERTION_MODE_RESET_MAP[$.TBODY] =
-INSERTION_MODE_RESET_MAP[$.THEAD] =
-INSERTION_MODE_RESET_MAP[$.TFOOT] = IN_TABLE_BODY_MODE;
-INSERTION_MODE_RESET_MAP[$.CAPTION] = IN_CAPTION_MODE;
-INSERTION_MODE_RESET_MAP[$.COLGROUP] = IN_COLUMN_GROUP_MODE;
-INSERTION_MODE_RESET_MAP[$.TABLE] = IN_TABLE_MODE;
-INSERTION_MODE_RESET_MAP[$.BODY] = IN_BODY_MODE;
-INSERTION_MODE_RESET_MAP[$.FRAMESET] = IN_FRAMESET_MODE;
-
-//Template insertion mode switch map
-var TEMPLATE_INSERTION_MODE_SWITCH_MAP = {};
-
-TEMPLATE_INSERTION_MODE_SWITCH_MAP[$.CAPTION] =
-TEMPLATE_INSERTION_MODE_SWITCH_MAP[$.COLGROUP] =
-TEMPLATE_INSERTION_MODE_SWITCH_MAP[$.TBODY] =
-TEMPLATE_INSERTION_MODE_SWITCH_MAP[$.TFOOT] =
-TEMPLATE_INSERTION_MODE_SWITCH_MAP[$.THEAD] = IN_TABLE_MODE;
-TEMPLATE_INSERTION_MODE_SWITCH_MAP[$.COL] = IN_COLUMN_GROUP_MODE;
-TEMPLATE_INSERTION_MODE_SWITCH_MAP[$.TR] = IN_TABLE_BODY_MODE;
-TEMPLATE_INSERTION_MODE_SWITCH_MAP[$.TD] =
-TEMPLATE_INSERTION_MODE_SWITCH_MAP[$.TH] = IN_ROW_MODE;
-
-//Token handlers map for insertion modes
-var _ = {};
-
-_[INITIAL_MODE] = {};
-_[INITIAL_MODE][Tokenizer.CHARACTER_TOKEN] =
-_[INITIAL_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = tokenInInitialMode;
-_[INITIAL_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = ignoreToken;
-_[INITIAL_MODE][Tokenizer.COMMENT_TOKEN] = appendComment;
-_[INITIAL_MODE][Tokenizer.DOCTYPE_TOKEN] = doctypeInInitialMode;
-_[INITIAL_MODE][Tokenizer.START_TAG_TOKEN] =
-_[INITIAL_MODE][Tokenizer.END_TAG_TOKEN] =
-_[INITIAL_MODE][Tokenizer.EOF_TOKEN] = tokenInInitialMode;
-
-_[BEFORE_HTML_MODE] = {};
-_[BEFORE_HTML_MODE][Tokenizer.CHARACTER_TOKEN] =
-_[BEFORE_HTML_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = tokenBeforeHtml;
-_[BEFORE_HTML_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = ignoreToken;
-_[BEFORE_HTML_MODE][Tokenizer.COMMENT_TOKEN] = appendComment;
-_[BEFORE_HTML_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken;
-_[BEFORE_HTML_MODE][Tokenizer.START_TAG_TOKEN] = startTagBeforeHtml;
-_[BEFORE_HTML_MODE][Tokenizer.END_TAG_TOKEN] = endTagBeforeHtml;
-_[BEFORE_HTML_MODE][Tokenizer.EOF_TOKEN] = tokenBeforeHtml;
-
-_[BEFORE_HEAD_MODE] = {};
-_[BEFORE_HEAD_MODE][Tokenizer.CHARACTER_TOKEN] =
-_[BEFORE_HEAD_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = tokenBeforeHead;
-_[BEFORE_HEAD_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = ignoreToken;
-_[BEFORE_HEAD_MODE][Tokenizer.COMMENT_TOKEN] = appendComment;
-_[BEFORE_HEAD_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken;
-_[BEFORE_HEAD_MODE][Tokenizer.START_TAG_TOKEN] = startTagBeforeHead;
-_[BEFORE_HEAD_MODE][Tokenizer.END_TAG_TOKEN] = endTagBeforeHead;
-_[BEFORE_HEAD_MODE][Tokenizer.EOF_TOKEN] = tokenBeforeHead;
-
-_[IN_HEAD_MODE] = {};
-_[IN_HEAD_MODE][Tokenizer.CHARACTER_TOKEN] =
-_[IN_HEAD_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = tokenInHead;
-_[IN_HEAD_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = insertCharacters;
-_[IN_HEAD_MODE][Tokenizer.COMMENT_TOKEN] = appendComment;
-_[IN_HEAD_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken;
-_[IN_HEAD_MODE][Tokenizer.START_TAG_TOKEN] = startTagInHead;
-_[IN_HEAD_MODE][Tokenizer.END_TAG_TOKEN] = endTagInHead;
-_[IN_HEAD_MODE][Tokenizer.EOF_TOKEN] = tokenInHead;
-
-_[AFTER_HEAD_MODE] = {};
-_[AFTER_HEAD_MODE][Tokenizer.CHARACTER_TOKEN] =
-_[AFTER_HEAD_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = tokenAfterHead;
-_[AFTER_HEAD_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = insertCharacters;
-_[AFTER_HEAD_MODE][Tokenizer.COMMENT_TOKEN] = appendComment;
-_[AFTER_HEAD_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken;
-_[AFTER_HEAD_MODE][Tokenizer.START_TAG_TOKEN] = startTagAfterHead;
-_[AFTER_HEAD_MODE][Tokenizer.END_TAG_TOKEN] = endTagAfterHead;
-_[AFTER_HEAD_MODE][Tokenizer.EOF_TOKEN] = tokenAfterHead;
-
-_[IN_BODY_MODE] = {};
-_[IN_BODY_MODE][Tokenizer.CHARACTER_TOKEN] = characterInBody;
-_[IN_BODY_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = ignoreToken;
-_[IN_BODY_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = whitespaceCharacterInBody;
-_[IN_BODY_MODE][Tokenizer.COMMENT_TOKEN] = appendComment;
-_[IN_BODY_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken;
-_[IN_BODY_MODE][Tokenizer.START_TAG_TOKEN] = startTagInBody;
-_[IN_BODY_MODE][Tokenizer.END_TAG_TOKEN] = endTagInBody;
-_[IN_BODY_MODE][Tokenizer.EOF_TOKEN] = eofInBody;
-
-_[TEXT_MODE] = {};
-_[TEXT_MODE][Tokenizer.CHARACTER_TOKEN] =
-_[TEXT_MODE][Tokenizer.NULL_CHARACTER_TOKEN] =
-_[TEXT_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = insertCharacters;
-_[TEXT_MODE][Tokenizer.COMMENT_TOKEN] =
-_[TEXT_MODE][Tokenizer.DOCTYPE_TOKEN] =
-_[TEXT_MODE][Tokenizer.START_TAG_TOKEN] = ignoreToken;
-_[TEXT_MODE][Tokenizer.END_TAG_TOKEN] = endTagInText;
-_[TEXT_MODE][Tokenizer.EOF_TOKEN] = eofInText;
-
-_[IN_TABLE_MODE] = {};
-_[IN_TABLE_MODE][Tokenizer.CHARACTER_TOKEN] =
-_[IN_TABLE_MODE][Tokenizer.NULL_CHARACTER_TOKEN] =
-_[IN_TABLE_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = characterInTable;
-_[IN_TABLE_MODE][Tokenizer.COMMENT_TOKEN] = appendComment;
-_[IN_TABLE_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken;
-_[IN_TABLE_MODE][Tokenizer.START_TAG_TOKEN] = startTagInTable;
-_[IN_TABLE_MODE][Tokenizer.END_TAG_TOKEN] = endTagInTable;
-_[IN_TABLE_MODE][Tokenizer.EOF_TOKEN] = eofInBody;
-
-_[IN_TABLE_TEXT_MODE] = {};
-_[IN_TABLE_TEXT_MODE][Tokenizer.CHARACTER_TOKEN] = characterInTableText;
-_[IN_TABLE_TEXT_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = ignoreToken;
-_[IN_TABLE_TEXT_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = whitespaceCharacterInTableText;
-_[IN_TABLE_TEXT_MODE][Tokenizer.COMMENT_TOKEN] =
-_[IN_TABLE_TEXT_MODE][Tokenizer.DOCTYPE_TOKEN] =
-_[IN_TABLE_TEXT_MODE][Tokenizer.START_TAG_TOKEN] =
-_[IN_TABLE_TEXT_MODE][Tokenizer.END_TAG_TOKEN] =
-_[IN_TABLE_TEXT_MODE][Tokenizer.EOF_TOKEN] = tokenInTableText;
-
-_[IN_CAPTION_MODE] = {};
-_[IN_CAPTION_MODE][Tokenizer.CHARACTER_TOKEN] = characterInBody;
-_[IN_CAPTION_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = ignoreToken;
-_[IN_CAPTION_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = whitespaceCharacterInBody;
-_[IN_CAPTION_MODE][Tokenizer.COMMENT_TOKEN] = appendComment;
-_[IN_CAPTION_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken;
-_[IN_CAPTION_MODE][Tokenizer.START_TAG_TOKEN] = startTagInCaption;
-_[IN_CAPTION_MODE][Tokenizer.END_TAG_TOKEN] = endTagInCaption;
-_[IN_CAPTION_MODE][Tokenizer.EOF_TOKEN] = eofInBody;
-
-_[IN_COLUMN_GROUP_MODE] = {};
-_[IN_COLUMN_GROUP_MODE][Tokenizer.CHARACTER_TOKEN] =
-_[IN_COLUMN_GROUP_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = tokenInColumnGroup;
-_[IN_COLUMN_GROUP_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = insertCharacters;
-_[IN_COLUMN_GROUP_MODE][Tokenizer.COMMENT_TOKEN] = appendComment;
-_[IN_COLUMN_GROUP_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken;
-_[IN_COLUMN_GROUP_MODE][Tokenizer.START_TAG_TOKEN] = startTagInColumnGroup;
-_[IN_COLUMN_GROUP_MODE][Tokenizer.END_TAG_TOKEN] = endTagInColumnGroup;
-_[IN_COLUMN_GROUP_MODE][Tokenizer.EOF_TOKEN] = eofInBody;
-
-_[IN_TABLE_BODY_MODE] = {};
-_[IN_TABLE_BODY_MODE][Tokenizer.CHARACTER_TOKEN] =
-_[IN_TABLE_BODY_MODE][Tokenizer.NULL_CHARACTER_TOKEN] =
-_[IN_TABLE_BODY_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = characterInTable;
-_[IN_TABLE_BODY_MODE][Tokenizer.COMMENT_TOKEN] = appendComment;
-_[IN_TABLE_BODY_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken;
-_[IN_TABLE_BODY_MODE][Tokenizer.START_TAG_TOKEN] = startTagInTableBody;
-_[IN_TABLE_BODY_MODE][Tokenizer.END_TAG_TOKEN] = endTagInTableBody;
-_[IN_TABLE_BODY_MODE][Tokenizer.EOF_TOKEN] = eofInBody;
-
-_[IN_ROW_MODE] = {};
-_[IN_ROW_MODE][Tokenizer.CHARACTER_TOKEN] =
-_[IN_ROW_MODE][Tokenizer.NULL_CHARACTER_TOKEN] =
-_[IN_ROW_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = characterInTable;
-_[IN_ROW_MODE][Tokenizer.COMMENT_TOKEN] = appendComment;
-_[IN_ROW_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken;
-_[IN_ROW_MODE][Tokenizer.START_TAG_TOKEN] = startTagInRow;
-_[IN_ROW_MODE][Tokenizer.END_TAG_TOKEN] = endTagInRow;
-_[IN_ROW_MODE][Tokenizer.EOF_TOKEN] = eofInBody;
-
-_[IN_CELL_MODE] = {};
-_[IN_CELL_MODE][Tokenizer.CHARACTER_TOKEN] = characterInBody;
-_[IN_CELL_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = ignoreToken;
-_[IN_CELL_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = whitespaceCharacterInBody;
-_[IN_CELL_MODE][Tokenizer.COMMENT_TOKEN] = appendComment;
-_[IN_CELL_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken;
-_[IN_CELL_MODE][Tokenizer.START_TAG_TOKEN] = startTagInCell;
-_[IN_CELL_MODE][Tokenizer.END_TAG_TOKEN] = endTagInCell;
-_[IN_CELL_MODE][Tokenizer.EOF_TOKEN] = eofInBody;
-
-_[IN_SELECT_MODE] = {};
-_[IN_SELECT_MODE][Tokenizer.CHARACTER_TOKEN] = insertCharacters;
-_[IN_SELECT_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = ignoreToken;
-_[IN_SELECT_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = insertCharacters;
-_[IN_SELECT_MODE][Tokenizer.COMMENT_TOKEN] = appendComment;
-_[IN_SELECT_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken;
-_[IN_SELECT_MODE][Tokenizer.START_TAG_TOKEN] = startTagInSelect;
-_[IN_SELECT_MODE][Tokenizer.END_TAG_TOKEN] = endTagInSelect;
-_[IN_SELECT_MODE][Tokenizer.EOF_TOKEN] = eofInBody;
-
-_[IN_SELECT_IN_TABLE_MODE] = {};
-_[IN_SELECT_IN_TABLE_MODE][Tokenizer.CHARACTER_TOKEN] = insertCharacters;
-_[IN_SELECT_IN_TABLE_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = ignoreToken;
-_[IN_SELECT_IN_TABLE_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = insertCharacters;
-_[IN_SELECT_IN_TABLE_MODE][Tokenizer.COMMENT_TOKEN] = appendComment;
-_[IN_SELECT_IN_TABLE_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken;
-_[IN_SELECT_IN_TABLE_MODE][Tokenizer.START_TAG_TOKEN] = startTagInSelectInTable;
-_[IN_SELECT_IN_TABLE_MODE][Tokenizer.END_TAG_TOKEN] = endTagInSelectInTable;
-_[IN_SELECT_IN_TABLE_MODE][Tokenizer.EOF_TOKEN] = eofInBody;
-
-_[IN_TEMPLATE_MODE] = {};
-_[IN_TEMPLATE_MODE][Tokenizer.CHARACTER_TOKEN] = characterInBody;
-_[IN_TEMPLATE_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = ignoreToken;
-_[IN_TEMPLATE_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = whitespaceCharacterInBody;
-_[IN_TEMPLATE_MODE][Tokenizer.COMMENT_TOKEN] = appendComment;
-_[IN_TEMPLATE_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken;
-_[IN_TEMPLATE_MODE][Tokenizer.START_TAG_TOKEN] = startTagInTemplate;
-_[IN_TEMPLATE_MODE][Tokenizer.END_TAG_TOKEN] = endTagInTemplate;
-_[IN_TEMPLATE_MODE][Tokenizer.EOF_TOKEN] = eofInTemplate;
-
-_[AFTER_BODY_MODE] = {};
-_[AFTER_BODY_MODE][Tokenizer.CHARACTER_TOKEN] =
-_[AFTER_BODY_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = tokenAfterBody;
-_[AFTER_BODY_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = whitespaceCharacterInBody;
-_[AFTER_BODY_MODE][Tokenizer.COMMENT_TOKEN] = appendCommentToRootHtmlElement;
-_[AFTER_BODY_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken;
-_[AFTER_BODY_MODE][Tokenizer.START_TAG_TOKEN] = startTagAfterBody;
-_[AFTER_BODY_MODE][Tokenizer.END_TAG_TOKEN] = endTagAfterBody;
-_[AFTER_BODY_MODE][Tokenizer.EOF_TOKEN] = stopParsing;
-
-_[IN_FRAMESET_MODE] = {};
-_[IN_FRAMESET_MODE][Tokenizer.CHARACTER_TOKEN] =
-_[IN_FRAMESET_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = ignoreToken;
-_[IN_FRAMESET_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = insertCharacters;
-_[IN_FRAMESET_MODE][Tokenizer.COMMENT_TOKEN] = appendComment;
-_[IN_FRAMESET_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken;
-_[IN_FRAMESET_MODE][Tokenizer.START_TAG_TOKEN] = startTagInFrameset;
-_[IN_FRAMESET_MODE][Tokenizer.END_TAG_TOKEN] = endTagInFrameset;
-_[IN_FRAMESET_MODE][Tokenizer.EOF_TOKEN] = stopParsing;
-
-_[AFTER_FRAMESET_MODE] = {};
-_[AFTER_FRAMESET_MODE][Tokenizer.CHARACTER_TOKEN] =
-_[AFTER_FRAMESET_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = ignoreToken;
-_[AFTER_FRAMESET_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = insertCharacters;
-_[AFTER_FRAMESET_MODE][Tokenizer.COMMENT_TOKEN] = appendComment;
-_[AFTER_FRAMESET_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken;
-_[AFTER_FRAMESET_MODE][Tokenizer.START_TAG_TOKEN] = startTagAfterFrameset;
-_[AFTER_FRAMESET_MODE][Tokenizer.END_TAG_TOKEN] = endTagAfterFrameset;
-_[AFTER_FRAMESET_MODE][Tokenizer.EOF_TOKEN] = stopParsing;
-
-_[AFTER_AFTER_BODY_MODE] = {};
-_[AFTER_AFTER_BODY_MODE][Tokenizer.CHARACTER_TOKEN] = tokenAfterAfterBody;
-_[AFTER_AFTER_BODY_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = tokenAfterAfterBody;
-_[AFTER_AFTER_BODY_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = whitespaceCharacterInBody;
-_[AFTER_AFTER_BODY_MODE][Tokenizer.COMMENT_TOKEN] = appendCommentToDocument;
-_[AFTER_AFTER_BODY_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken;
-_[AFTER_AFTER_BODY_MODE][Tokenizer.START_TAG_TOKEN] = startTagAfterAfterBody;
-_[AFTER_AFTER_BODY_MODE][Tokenizer.END_TAG_TOKEN] = tokenAfterAfterBody;
-_[AFTER_AFTER_BODY_MODE][Tokenizer.EOF_TOKEN] = stopParsing;
-
-_[AFTER_AFTER_FRAMESET_MODE] = {};
-_[AFTER_AFTER_FRAMESET_MODE][Tokenizer.CHARACTER_TOKEN] =
-_[AFTER_AFTER_FRAMESET_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = ignoreToken;
-_[AFTER_AFTER_FRAMESET_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = whitespaceCharacterInBody;
-_[AFTER_AFTER_FRAMESET_MODE][Tokenizer.COMMENT_TOKEN] = appendCommentToDocument;
-_[AFTER_AFTER_FRAMESET_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken;
-_[AFTER_AFTER_FRAMESET_MODE][Tokenizer.START_TAG_TOKEN] = startTagAfterAfterFrameset;
-_[AFTER_AFTER_FRAMESET_MODE][Tokenizer.END_TAG_TOKEN] = ignoreToken;
-_[AFTER_AFTER_FRAMESET_MODE][Tokenizer.EOF_TOKEN] = stopParsing;
-
-
-//Parser
-var Parser = module.exports = function (options) {
- this.options = mergeOptions(DEFAULT_OPTIONS, options);
-
- this.treeAdapter = this.options.treeAdapter;
- this.pendingScript = null;
-
- if (this.options.locationInfo)
- locationInfoMixin.assign(this);
-};
-
-// API
-Parser.prototype.parse = function (html) {
- var document = this.treeAdapter.createDocument();
-
- this._bootstrap(document, null);
- this.tokenizer.write(html, true);
- this._runParsingLoop(null, null);
-
- return document;
-};
-
-Parser.prototype.parseFragment = function (html, fragmentContext) {
- //NOTE: use <template> element as a fragment context if context element was not provided,
- //so we will parse in "forgiving" manner
- if (!fragmentContext)
- fragmentContext = this.treeAdapter.createElement($.TEMPLATE, NS.HTML, []);
-
- //NOTE: create fake element which will be used as 'document' for fragment parsing.
- //This is important for jsdom there 'document' can't be recreated, therefore
- //fragment parsing causes messing of the main `document`.
- var documentMock = this.treeAdapter.createElement('documentmock', NS.HTML, []);
-
- this._bootstrap(documentMock, fragmentContext);
-
- if (this.treeAdapter.getTagName(fragmentContext) === $.TEMPLATE)
- this._pushTmplInsertionMode(IN_TEMPLATE_MODE);
-
- this._initTokenizerForFragmentParsing();
- this._insertFakeRootElement();
- this._resetInsertionMode();
- this._findFormInFragmentContext();
- this.tokenizer.write(html, true);
- this._runParsingLoop(null, null);
-
- var rootElement = this.treeAdapter.getFirstChild(documentMock),
- fragment = this.treeAdapter.createDocumentFragment();
-
- this._adoptNodes(rootElement, fragment);
-
- return fragment;
-};
-
-//Bootstrap parser
-Parser.prototype._bootstrap = function (document, fragmentContext) {
- this.tokenizer = new Tokenizer(this.options);
-
- this.stopped = false;
-
- this.insertionMode = INITIAL_MODE;
- this.originalInsertionMode = '';
-
- this.document = document;
- this.fragmentContext = fragmentContext;
-
- this.headElement = null;
- this.formElement = null;
-
- this.openElements = new OpenElementStack(this.document, this.treeAdapter);
- this.activeFormattingElements = new FormattingElementList(this.treeAdapter);
-
- this.tmplInsertionModeStack = [];
- this.tmplInsertionModeStackTop = -1;
- this.currentTmplInsertionMode = null;
-
- this.pendingCharacterTokens = [];
- this.hasNonWhitespacePendingCharacterToken = false;
-
- this.framesetOk = true;
- this.skipNextNewLine = false;
- this.fosterParentingEnabled = false;
-};
-
-//Parsing loop
-Parser.prototype._runParsingLoop = function (writeCallback, scriptHandler) {
- while (!this.stopped) {
- this._setupTokenizerCDATAMode();
-
- var token = this.tokenizer.getNextToken();
-
- if (token.type === Tokenizer.HIBERNATION_TOKEN)
- break;
-
- if (this.skipNextNewLine) {
- this.skipNextNewLine = false;
-
- if (token.type === Tokenizer.WHITESPACE_CHARACTER_TOKEN && token.chars[0] === '\n') {
- if (token.chars.length === 1)
- continue;
-
- token.chars = token.chars.substr(1);
- }
- }
-
- this._processInputToken(token);
-
- if (scriptHandler && this.pendingScript)
- break;
- }
-
- if (scriptHandler && this.pendingScript) {
- var script = this.pendingScript;
-
- this.pendingScript = null;
-
- scriptHandler(script);
-
- return;
- }
-
- if (writeCallback)
- writeCallback();
-};
-
-//Text parsing
-Parser.prototype._setupTokenizerCDATAMode = function () {
- var current = this._getAdjustedCurrentElement();
-
- this.tokenizer.allowCDATA = current && current !== this.document &&
- this.treeAdapter.getNamespaceURI(current) !== NS.HTML &&
- !this._isIntegrationPoint(current);
-};
-
-Parser.prototype._switchToTextParsing = function (currentToken, nextTokenizerState) {
- this._insertElement(currentToken, NS.HTML);
- this.tokenizer.state = nextTokenizerState;
- this.originalInsertionMode = this.insertionMode;
- this.insertionMode = TEXT_MODE;
-};
-
-//Fragment parsing
-Parser.prototype._getAdjustedCurrentElement = function () {
- return this.openElements.stackTop === 0 && this.fragmentContext ?
- this.fragmentContext :
- this.openElements.current;
-};
-
-Parser.prototype._findFormInFragmentContext = function () {
- var node = this.fragmentContext;
-
- do {
- if (this.treeAdapter.getTagName(node) === $.FORM) {
- this.formElement = node;
- break;
- }
-
- node = this.treeAdapter.getParentNode(node);
- } while (node);
-};
-
-Parser.prototype._initTokenizerForFragmentParsing = function () {
- if (this.treeAdapter.getNamespaceURI(this.fragmentContext) === NS.HTML) {
- var tn = this.treeAdapter.getTagName(this.fragmentContext);
-
- if (tn === $.TITLE || tn === $.TEXTAREA)
- this.tokenizer.state = Tokenizer.MODE.RCDATA;
-
- else if (tn === $.STYLE || tn === $.XMP || tn === $.IFRAME ||
- tn === $.NOEMBED || tn === $.NOFRAMES || tn === $.NOSCRIPT)
- this.tokenizer.state = Tokenizer.MODE.RAWTEXT;
-
- else if (tn === $.SCRIPT)
- this.tokenizer.state = Tokenizer.MODE.SCRIPT_DATA;
-
- else if (tn === $.PLAINTEXT)
- this.tokenizer.state = Tokenizer.MODE.PLAINTEXT;
- }
-};
-
-//Tree mutation
-Parser.prototype._setDocumentType = function (token) {
- this.treeAdapter.setDocumentType(this.document, token.name, token.publicId, token.systemId);
-};
-
-Parser.prototype._attachElementToTree = function (element) {
- if (this._shouldFosterParentOnInsertion())
- this._fosterParentElement(element);
-
- else {
- var parent = this.openElements.currentTmplContent || this.openElements.current;
-
- this.treeAdapter.appendChild(parent, element);
- }
-};
-
-Parser.prototype._appendElement = function (token, namespaceURI) {
- var element = this.treeAdapter.createElement(token.tagName, namespaceURI, token.attrs);
-
- this._attachElementToTree(element);
-};
-
-Parser.prototype._insertElement = function (token, namespaceURI) {
- var element = this.treeAdapter.createElement(token.tagName, namespaceURI, token.attrs);
-
- this._attachElementToTree(element);
- this.openElements.push(element);
-};
-
-Parser.prototype._insertFakeElement = function (tagName) {
- var element = this.treeAdapter.createElement(tagName, NS.HTML, []);
-
- this._attachElementToTree(element);
- this.openElements.push(element);
-};
-
-Parser.prototype._insertTemplate = function (token) {
- var tmpl = this.treeAdapter.createElement(token.tagName, NS.HTML, token.attrs),
- content = this.treeAdapter.createDocumentFragment();
-
- this.treeAdapter.setTemplateContent(tmpl, content);
- this._attachElementToTree(tmpl);
- this.openElements.push(tmpl);
-};
-
-Parser.prototype._insertFakeRootElement = function () {
- var element = this.treeAdapter.createElement($.HTML, NS.HTML, []);
-
- this.treeAdapter.appendChild(this.openElements.current, element);
- this.openElements.push(element);
-};
-
-Parser.prototype._appendCommentNode = function (token, parent) {
- var commentNode = this.treeAdapter.createCommentNode(token.data);
-
- this.treeAdapter.appendChild(parent, commentNode);
-};
-
-Parser.prototype._insertCharacters = function (token) {
- if (this._shouldFosterParentOnInsertion())
- this._fosterParentText(token.chars);
-
- else {
- var parent = this.openElements.currentTmplContent || this.openElements.current;
-
- this.treeAdapter.insertText(parent, token.chars);
- }
-};
-
-Parser.prototype._adoptNodes = function (donor, recipient) {
- while (true) {
- var child = this.treeAdapter.getFirstChild(donor);
-
- if (!child)
- break;
-
- this.treeAdapter.detachNode(child);
- this.treeAdapter.appendChild(recipient, child);
- }
-};
-
-//Token processing
-Parser.prototype._shouldProcessTokenInForeignContent = function (token) {
- var current = this._getAdjustedCurrentElement();
-
- if (!current || current === this.document)
- return false;
-
- var ns = this.treeAdapter.getNamespaceURI(current);
-
- if (ns === NS.HTML)
- return false;
-
- if (this.treeAdapter.getTagName(current) === $.ANNOTATION_XML && ns === NS.MATHML &&
- token.type === Tokenizer.START_TAG_TOKEN && token.tagName === $.SVG)
- return false;
-
- var isCharacterToken = token.type === Tokenizer.CHARACTER_TOKEN ||
- token.type === Tokenizer.NULL_CHARACTER_TOKEN ||
- token.type === Tokenizer.WHITESPACE_CHARACTER_TOKEN,
- isMathMLTextStartTag = token.type === Tokenizer.START_TAG_TOKEN &&
- token.tagName !== $.MGLYPH &&
- token.tagName !== $.MALIGNMARK;
-
- if ((isMathMLTextStartTag || isCharacterToken) && this._isIntegrationPoint(current, NS.MATHML))
- return false;
-
- if ((token.type === Tokenizer.START_TAG_TOKEN || isCharacterToken) && this._isIntegrationPoint(current, NS.HTML))
- return false;
-
- return token.type !== Tokenizer.EOF_TOKEN;
-};
-
-Parser.prototype._processToken = function (token) {
- _[this.insertionMode][token.type](this, token);
-};
-
-Parser.prototype._processTokenInBodyMode = function (token) {
- _[IN_BODY_MODE][token.type](this, token);
-};
-
-Parser.prototype._processTokenInForeignContent = function (token) {
- if (token.type === Tokenizer.CHARACTER_TOKEN)
- characterInForeignContent(this, token);
-
- else if (token.type === Tokenizer.NULL_CHARACTER_TOKEN)
- nullCharacterInForeignContent(this, token);
-
- else if (token.type === Tokenizer.WHITESPACE_CHARACTER_TOKEN)
- insertCharacters(this, token);
-
- else if (token.type === Tokenizer.COMMENT_TOKEN)
- appendComment(this, token);
-
- else if (token.type === Tokenizer.START_TAG_TOKEN)
- startTagInForeignContent(this, token);
-
- else if (token.type === Tokenizer.END_TAG_TOKEN)
- endTagInForeignContent(this, token);
-};
-
-Parser.prototype._processInputToken = function (token) {
- if (this._shouldProcessTokenInForeignContent(token))
- this._processTokenInForeignContent(token);
-
- else
- this._processToken(token);
-};
-
-//Integration points
-Parser.prototype._isIntegrationPoint = function (element, foreignNS) {
- var tn = this.treeAdapter.getTagName(element),
- ns = this.treeAdapter.getNamespaceURI(element),
- attrs = this.treeAdapter.getAttrList(element);
-
- return foreignContent.isIntegrationPoint(tn, ns, attrs, foreignNS);
-};
-
-//Active formatting elements reconstruction
-Parser.prototype._reconstructActiveFormattingElements = function () {
- var listLength = this.activeFormattingElements.length;
-
- if (listLength) {
- var unopenIdx = listLength,
- entry = null;
-
- do {
- unopenIdx--;
- entry = this.activeFormattingElements.entries[unopenIdx];
-
- if (entry.type === FormattingElementList.MARKER_ENTRY || this.openElements.contains(entry.element)) {
- unopenIdx++;
- break;
- }
- } while (unopenIdx > 0);
-
- for (var i = unopenIdx; i < listLength; i++) {
- entry = this.activeFormattingElements.entries[i];
- this._insertElement(entry.token, this.treeAdapter.getNamespaceURI(entry.element));
- entry.element = this.openElements.current;
- }
- }
-};
-
-//Close elements
-Parser.prototype._closeTableCell = function () {
- this.openElements.generateImpliedEndTags();
- this.openElements.popUntilTableCellPopped();
- this.activeFormattingElements.clearToLastMarker();
- this.insertionMode = IN_ROW_MODE;
-};
-
-Parser.prototype._closePElement = function () {
- this.openElements.generateImpliedEndTagsWithExclusion($.P);
- this.openElements.popUntilTagNamePopped($.P);
-};
-
-//Insertion modes
-Parser.prototype._resetInsertionMode = function () {
- for (var i = this.openElements.stackTop, last = false; i >= 0; i--) {
- var element = this.openElements.items[i];
-
- if (i === 0) {
- last = true;
-
- if (this.fragmentContext)
- element = this.fragmentContext;
- }
-
- var tn = this.treeAdapter.getTagName(element),
- newInsertionMode = INSERTION_MODE_RESET_MAP[tn];
-
- if (newInsertionMode) {
- this.insertionMode = newInsertionMode;
- break;
- }
-
- else if (!last && (tn === $.TD || tn === $.TH)) {
- this.insertionMode = IN_CELL_MODE;
- break;
- }
-
- else if (!last && tn === $.HEAD) {
- this.insertionMode = IN_HEAD_MODE;
- break;
- }
-
- else if (tn === $.SELECT) {
- this._resetInsertionModeForSelect(i);
- break;
- }
-
- else if (tn === $.TEMPLATE) {
- this.insertionMode = this.currentTmplInsertionMode;
- break;
- }
-
- else if (tn === $.HTML) {
- this.insertionMode = this.headElement ? AFTER_HEAD_MODE : BEFORE_HEAD_MODE;
- break;
- }
-
- else if (last) {
- this.insertionMode = IN_BODY_MODE;
- break;
- }
- }
-};
-
-Parser.prototype._resetInsertionModeForSelect = function (selectIdx) {
- if (selectIdx > 0) {
- for (var i = selectIdx - 1; i > 0; i--) {
- var ancestor = this.openElements.items[i],
- tn = this.treeAdapter.getTagName(ancestor);
-
- if (tn === $.TEMPLATE)
- break;
-
- else if (tn === $.TABLE) {
- this.insertionMode = IN_SELECT_IN_TABLE_MODE;
- return;
- }
- }
- }
-
- this.insertionMode = IN_SELECT_MODE;
-};
-
-Parser.prototype._pushTmplInsertionMode = function (mode) {
- this.tmplInsertionModeStack.push(mode);
- this.tmplInsertionModeStackTop++;
- this.currentTmplInsertionMode = mode;
-};
-
-Parser.prototype._popTmplInsertionMode = function () {
- this.tmplInsertionModeStack.pop();
- this.tmplInsertionModeStackTop--;
- this.currentTmplInsertionMode = this.tmplInsertionModeStack[this.tmplInsertionModeStackTop];
-};
-
-//Foster parenting
-Parser.prototype._isElementCausesFosterParenting = function (element) {
- var tn = this.treeAdapter.getTagName(element);
-
- return tn === $.TABLE || tn === $.TBODY || tn === $.TFOOT || tn === $.THEAD || tn === $.TR;
-};
-
-Parser.prototype._shouldFosterParentOnInsertion = function () {
- return this.fosterParentingEnabled && this._isElementCausesFosterParenting(this.openElements.current);
-};
-
-Parser.prototype._findFosterParentingLocation = function () {
- var location = {
- parent: null,
- beforeElement: null
- };
-
- for (var i = this.openElements.stackTop; i >= 0; i--) {
- var openElement = this.openElements.items[i],
- tn = this.treeAdapter.getTagName(openElement),
- ns = this.treeAdapter.getNamespaceURI(openElement);
-
- if (tn === $.TEMPLATE && ns === NS.HTML) {
- location.parent = this.treeAdapter.getTemplateContent(openElement);
- break;
- }
-
- else if (tn === $.TABLE) {
- location.parent = this.treeAdapter.getParentNode(openElement);
-
- if (location.parent)
- location.beforeElement = openElement;
- else
- location.parent = this.openElements.items[i - 1];
-
- break;
- }
- }
-
- if (!location.parent)
- location.parent = this.openElements.items[0];
-
- return location;
-};
-
-Parser.prototype._fosterParentElement = function (element) {
- var location = this._findFosterParentingLocation();
-
- if (location.beforeElement)
- this.treeAdapter.insertBefore(location.parent, element, location.beforeElement);
- else
- this.treeAdapter.appendChild(location.parent, element);
-};
-
-Parser.prototype._fosterParentText = function (chars) {
- var location = this._findFosterParentingLocation();
-
- if (location.beforeElement)
- this.treeAdapter.insertTextBefore(location.parent, chars, location.beforeElement);
- else
- this.treeAdapter.insertText(location.parent, chars);
-};
-
-//Special elements
-Parser.prototype._isSpecialElement = function (element) {
- var tn = this.treeAdapter.getTagName(element),
- ns = this.treeAdapter.getNamespaceURI(element);
-
- return HTML.SPECIAL_ELEMENTS[ns][tn];
-};
-
-//Adoption agency algorithm
-//(see: http://www.whatwg.org/specs/web-apps/current-work/multipage/tree-construction.html#adoptionAgency)
-//------------------------------------------------------------------
-
-//Steps 5-8 of the algorithm
-function aaObtainFormattingElementEntry(p, token) {
- var formattingElementEntry = p.activeFormattingElements.getElementEntryInScopeWithTagName(token.tagName);
-
- if (formattingElementEntry) {
- if (!p.openElements.contains(formattingElementEntry.element)) {
- p.activeFormattingElements.removeEntry(formattingElementEntry);
- formattingElementEntry = null;
- }
-
- else if (!p.openElements.hasInScope(token.tagName))
- formattingElementEntry = null;
- }
-
- else
- genericEndTagInBody(p, token);
-
- return formattingElementEntry;
-}
-
-//Steps 9 and 10 of the algorithm
-function aaObtainFurthestBlock(p, formattingElementEntry) {
- var furthestBlock = null;
-
- for (var i = p.openElements.stackTop; i >= 0; i--) {
- var element = p.openElements.items[i];
-
- if (element === formattingElementEntry.element)
- break;
-
- if (p._isSpecialElement(element))
- furthestBlock = element;
- }
-
- if (!furthestBlock) {
- p.openElements.popUntilElementPopped(formattingElementEntry.element);
- p.activeFormattingElements.removeEntry(formattingElementEntry);
- }
-
- return furthestBlock;
-}
-
-//Step 13 of the algorithm
-function aaInnerLoop(p, furthestBlock, formattingElement) {
- var lastElement = furthestBlock,
- nextElement = p.openElements.getCommonAncestor(furthestBlock);
-
- for (var i = 0, element = nextElement; element !== formattingElement; i++, element = nextElement) {
- //NOTE: store next element for the next loop iteration (it may be deleted from the stack by step 9.5)
- nextElement = p.openElements.getCommonAncestor(element);
-
- var elementEntry = p.activeFormattingElements.getElementEntry(element),
- counterOverflow = elementEntry && i >= AA_INNER_LOOP_ITER,
- shouldRemoveFromOpenElements = !elementEntry || counterOverflow;
-
- if (shouldRemoveFromOpenElements) {
- if (counterOverflow)
- p.activeFormattingElements.removeEntry(elementEntry);
-
- p.openElements.remove(element);
- }
-
- else {
- element = aaRecreateElementFromEntry(p, elementEntry);
-
- if (lastElement === furthestBlock)
- p.activeFormattingElements.bookmark = elementEntry;
-
- p.treeAdapter.detachNode(lastElement);
- p.treeAdapter.appendChild(element, lastElement);
- lastElement = element;
- }
- }
-
- return lastElement;
-}
-
-//Step 13.7 of the algorithm
-function aaRecreateElementFromEntry(p, elementEntry) {
- var ns = p.treeAdapter.getNamespaceURI(elementEntry.element),
- newElement = p.treeAdapter.createElement(elementEntry.token.tagName, ns, elementEntry.token.attrs);
-
- p.openElements.replace(elementEntry.element, newElement);
- elementEntry.element = newElement;
-
- return newElement;
-}
-
-//Step 14 of the algorithm
-function aaInsertLastNodeInCommonAncestor(p, commonAncestor, lastElement) {
- if (p._isElementCausesFosterParenting(commonAncestor))
- p._fosterParentElement(lastElement);
-
- else {
- var tn = p.treeAdapter.getTagName(commonAncestor),
- ns = p.treeAdapter.getNamespaceURI(commonAncestor);
-
- if (tn === $.TEMPLATE && ns === NS.HTML)
- commonAncestor = p.treeAdapter.getTemplateContent(commonAncestor);
-
- p.treeAdapter.appendChild(commonAncestor, lastElement);
- }
-}
-
-//Steps 15-19 of the algorithm
-function aaReplaceFormattingElement(p, furthestBlock, formattingElementEntry) {
- var ns = p.treeAdapter.getNamespaceURI(formattingElementEntry.element),
- token = formattingElementEntry.token,
- newElement = p.treeAdapter.createElement(token.tagName, ns, token.attrs);
-
- p._adoptNodes(furthestBlock, newElement);
- p.treeAdapter.appendChild(furthestBlock, newElement);
-
- p.activeFormattingElements.insertElementAfterBookmark(newElement, formattingElementEntry.token);
- p.activeFormattingElements.removeEntry(formattingElementEntry);
-
- p.openElements.remove(formattingElementEntry.element);
- p.openElements.insertAfter(furthestBlock, newElement);
-}
-
-//Algorithm entry point
-function callAdoptionAgency(p, token) {
- var formattingElementEntry;
-
- for (var i = 0; i < AA_OUTER_LOOP_ITER; i++) {
- formattingElementEntry = aaObtainFormattingElementEntry(p, token, formattingElementEntry);
-
- if (!formattingElementEntry)
- break;
-
- var furthestBlock = aaObtainFurthestBlock(p, formattingElementEntry);
-
- if (!furthestBlock)
- break;
-
- p.activeFormattingElements.bookmark = formattingElementEntry;
-
- var lastElement = aaInnerLoop(p, furthestBlock, formattingElementEntry.element),
- commonAncestor = p.openElements.getCommonAncestor(formattingElementEntry.element);
-
- p.treeAdapter.detachNode(lastElement);
- aaInsertLastNodeInCommonAncestor(p, commonAncestor, lastElement);
- aaReplaceFormattingElement(p, furthestBlock, formattingElementEntry);
- }
-}
-
-
-//Generic token handlers
-//------------------------------------------------------------------
-function ignoreToken() {
- //NOTE: do nothing =)
-}
-
-function appendComment(p, token) {
- p._appendCommentNode(token, p.openElements.currentTmplContent || p.openElements.current);
-}
-
-function appendCommentToRootHtmlElement(p, token) {
- p._appendCommentNode(token, p.openElements.items[0]);
-}
-
-function appendCommentToDocument(p, token) {
- p._appendCommentNode(token, p.document);
-}
-
-function insertCharacters(p, token) {
- p._insertCharacters(token);
-}
-
-function stopParsing(p) {
- p.stopped = true;
-}
-
-//12.2.5.4.1 The "initial" insertion mode
-//------------------------------------------------------------------
-function doctypeInInitialMode(p, token) {
- p._setDocumentType(token);
-
- if (token.forceQuirks || doctype.isQuirks(token.name, token.publicId, token.systemId))
- p.treeAdapter.setQuirksMode(p.document);
-
- p.insertionMode = BEFORE_HTML_MODE;
-}
-
-function tokenInInitialMode(p, token) {
- p.treeAdapter.setQuirksMode(p.document);
- p.insertionMode = BEFORE_HTML_MODE;
- p._processToken(token);
-}
-
-
-//12.2.5.4.2 The "before html" insertion mode
-//------------------------------------------------------------------
-function startTagBeforeHtml(p, token) {
- if (token.tagName === $.HTML) {
- p._insertElement(token, NS.HTML);
- p.insertionMode = BEFORE_HEAD_MODE;
- }
-
- else
- tokenBeforeHtml(p, token);
-}
-
-function endTagBeforeHtml(p, token) {
- var tn = token.tagName;
-
- if (tn === $.HTML || tn === $.HEAD || tn === $.BODY || tn === $.BR)
- tokenBeforeHtml(p, token);
-}
-
-function tokenBeforeHtml(p, token) {
- p._insertFakeRootElement();
- p.insertionMode = BEFORE_HEAD_MODE;
- p._processToken(token);
-}
-
-
-//12.2.5.4.3 The "before head" insertion mode
-//------------------------------------------------------------------
-function startTagBeforeHead(p, token) {
- var tn = token.tagName;
-
- if (tn === $.HTML)
- startTagInBody(p, token);
-
- else if (tn === $.HEAD) {
- p._insertElement(token, NS.HTML);
- p.headElement = p.openElements.current;
- p.insertionMode = IN_HEAD_MODE;
- }
-
- else
- tokenBeforeHead(p, token);
-}
-
-function endTagBeforeHead(p, token) {
- var tn = token.tagName;
-
- if (tn === $.HEAD || tn === $.BODY || tn === $.HTML || tn === $.BR)
- tokenBeforeHead(p, token);
-}
-
-function tokenBeforeHead(p, token) {
- p._insertFakeElement($.HEAD);
- p.headElement = p.openElements.current;
- p.insertionMode = IN_HEAD_MODE;
- p._processToken(token);
-}
-
-
-//12.2.5.4.4 The "in head" insertion mode
-//------------------------------------------------------------------
-function startTagInHead(p, token) {
- var tn = token.tagName;
-
- if (tn === $.HTML)
- startTagInBody(p, token);
-
- else if (tn === $.BASE || tn === $.BASEFONT || tn === $.BGSOUND || tn === $.LINK || tn === $.META)
- p._appendElement(token, NS.HTML);
-
- else if (tn === $.TITLE)
- p._switchToTextParsing(token, Tokenizer.MODE.RCDATA);
-
- //NOTE: here we assume that we always act as an interactive user agent with enabled scripting, so we parse
- //<noscript> as a rawtext.
- else if (tn === $.NOSCRIPT || tn === $.NOFRAMES || tn === $.STYLE)
- p._switchToTextParsing(token, Tokenizer.MODE.RAWTEXT);
-
- else if (tn === $.SCRIPT)
- p._switchToTextParsing(token, Tokenizer.MODE.SCRIPT_DATA);
-
- else if (tn === $.TEMPLATE) {
- p._insertTemplate(token, NS.HTML);
- p.activeFormattingElements.insertMarker();
- p.framesetOk = false;
- p.insertionMode = IN_TEMPLATE_MODE;
- p._pushTmplInsertionMode(IN_TEMPLATE_MODE);
- }
-
- else if (tn !== $.HEAD)
- tokenInHead(p, token);
-}
-
-function endTagInHead(p, token) {
- var tn = token.tagName;
-
- if (tn === $.HEAD) {
- p.openElements.pop();
- p.insertionMode = AFTER_HEAD_MODE;
- }
-
- else if (tn === $.BODY || tn === $.BR || tn === $.HTML)
- tokenInHead(p, token);
-
- else if (tn === $.TEMPLATE && p.openElements.tmplCount > 0) {
- p.openElements.generateImpliedEndTags();
- p.openElements.popUntilTagNamePopped($.TEMPLATE);
- p.activeFormattingElements.clearToLastMarker();
- p._popTmplInsertionMode();
- p._resetInsertionMode();
- }
-}
-
-function tokenInHead(p, token) {
- p.openElements.pop();
- p.insertionMode = AFTER_HEAD_MODE;
- p._processToken(token);
-}
-
-
-//12.2.5.4.6 The "after head" insertion mode
-//------------------------------------------------------------------
-function startTagAfterHead(p, token) {
- var tn = token.tagName;
-
- if (tn === $.HTML)
- startTagInBody(p, token);
-
- else if (tn === $.BODY) {
- p._insertElement(token, NS.HTML);
- p.framesetOk = false;
- p.insertionMode = IN_BODY_MODE;
- }
-
- else if (tn === $.FRAMESET) {
- p._insertElement(token, NS.HTML);
- p.insertionMode = IN_FRAMESET_MODE;
- }
-
- else if (tn === $.BASE || tn === $.BASEFONT || tn === $.BGSOUND || tn === $.LINK || tn === $.META ||
- tn === $.NOFRAMES || tn === $.SCRIPT || tn === $.STYLE || tn === $.TEMPLATE || tn === $.TITLE) {
- p.openElements.push(p.headElement);
- startTagInHead(p, token);
- p.openElements.remove(p.headElement);
- }
-
- else if (tn !== $.HEAD)
- tokenAfterHead(p, token);
-}
-
-function endTagAfterHead(p, token) {
- var tn = token.tagName;
-
- if (tn === $.BODY || tn === $.HTML || tn === $.BR)
- tokenAfterHead(p, token);
-
- else if (tn === $.TEMPLATE)
- endTagInHead(p, token);
-}
-
-function tokenAfterHead(p, token) {
- p._insertFakeElement($.BODY);
- p.insertionMode = IN_BODY_MODE;
- p._processToken(token);
-}
-
-
-//12.2.5.4.7 The "in body" insertion mode
-//------------------------------------------------------------------
-function whitespaceCharacterInBody(p, token) {
- p._reconstructActiveFormattingElements();
- p._insertCharacters(token);
-}
-
-function characterInBody(p, token) {
- p._reconstructActiveFormattingElements();
- p._insertCharacters(token);
- p.framesetOk = false;
-}
-
-function htmlStartTagInBody(p, token) {
- if (p.openElements.tmplCount === 0)
- p.treeAdapter.adoptAttributes(p.openElements.items[0], token.attrs);
-}
-
-function bodyStartTagInBody(p, token) {
- var bodyElement = p.openElements.tryPeekProperlyNestedBodyElement();
-
- if (bodyElement && p.openElements.tmplCount === 0) {
- p.framesetOk = false;
- p.treeAdapter.adoptAttributes(bodyElement, token.attrs);
- }
-}
-
-function framesetStartTagInBody(p, token) {
- var bodyElement = p.openElements.tryPeekProperlyNestedBodyElement();
-
- if (p.framesetOk && bodyElement) {
- p.treeAdapter.detachNode(bodyElement);
- p.openElements.popAllUpToHtmlElement();
- p._insertElement(token, NS.HTML);
- p.insertionMode = IN_FRAMESET_MODE;
- }
-}
-
-function addressStartTagInBody(p, token) {
- if (p.openElements.hasInButtonScope($.P))
- p._closePElement();
-
- p._insertElement(token, NS.HTML);
-}
-
-function numberedHeaderStartTagInBody(p, token) {
- if (p.openElements.hasInButtonScope($.P))
- p._closePElement();
-
- var tn = p.openElements.currentTagName;
-
- if (tn === $.H1 || tn === $.H2 || tn === $.H3 || tn === $.H4 || tn === $.H5 || tn === $.H6)
- p.openElements.pop();
-
- p._insertElement(token, NS.HTML);
-}
-
-function preStartTagInBody(p, token) {
- if (p.openElements.hasInButtonScope($.P))
- p._closePElement();
-
- p._insertElement(token, NS.HTML);
- //NOTE: If the next token is a U+000A LINE FEED (LF) character token, then ignore that token and move
- //on to the next one. (Newlines at the start of pre blocks are ignored as an authoring convenience.)
- p.skipNextNewLine = true;
- p.framesetOk = false;
-}
-
-function formStartTagInBody(p, token) {
- var inTemplate = p.openElements.tmplCount > 0;
-
- if (!p.formElement || inTemplate) {
- if (p.openElements.hasInButtonScope($.P))
- p._closePElement();
-
- p._insertElement(token, NS.HTML);
-
- if (!inTemplate)
- p.formElement = p.openElements.current;
- }
-}
-
-function listItemStartTagInBody(p, token) {
- p.framesetOk = false;
-
- var tn = token.tagName;
-
- for (var i = p.openElements.stackTop; i >= 0; i--) {
- var element = p.openElements.items[i],
- elementTn = p.treeAdapter.getTagName(element),
- closeTn = null;
-
- if (tn === $.LI && elementTn === $.LI)
- closeTn = $.LI;
-
- else if ((tn === $.DD || tn === $.DT) && (elementTn === $.DD || elementTn === $.DT))
- closeTn = elementTn;
-
- if (closeTn) {
- p.openElements.generateImpliedEndTagsWithExclusion(closeTn);
- p.openElements.popUntilTagNamePopped(closeTn);
- break;
- }
-
- if (elementTn !== $.ADDRESS && elementTn !== $.DIV && elementTn !== $.P && p._isSpecialElement(element))
- break;
- }
-
- if (p.openElements.hasInButtonScope($.P))
- p._closePElement();
-
- p._insertElement(token, NS.HTML);
-}
-
-function plaintextStartTagInBody(p, token) {
- if (p.openElements.hasInButtonScope($.P))
- p._closePElement();
-
- p._insertElement(token, NS.HTML);
- p.tokenizer.state = Tokenizer.MODE.PLAINTEXT;
-}
-
-function buttonStartTagInBody(p, token) {
- if (p.openElements.hasInScope($.BUTTON)) {
- p.openElements.generateImpliedEndTags();
- p.openElements.popUntilTagNamePopped($.BUTTON);
- }
-
- p._reconstructActiveFormattingElements();
- p._insertElement(token, NS.HTML);
- p.framesetOk = false;
-}
-
-function aStartTagInBody(p, token) {
- var activeElementEntry = p.activeFormattingElements.getElementEntryInScopeWithTagName($.A);
-
- if (activeElementEntry) {
- callAdoptionAgency(p, token);
- p.openElements.remove(activeElementEntry.element);
- p.activeFormattingElements.removeEntry(activeElementEntry);
- }
-
- p._reconstructActiveFormattingElements();
- p._insertElement(token, NS.HTML);
- p.activeFormattingElements.pushElement(p.openElements.current, token);
-}
-
-function bStartTagInBody(p, token) {
- p._reconstructActiveFormattingElements();
- p._insertElement(token, NS.HTML);
- p.activeFormattingElements.pushElement(p.openElements.current, token);
-}
-
-function nobrStartTagInBody(p, token) {
- p._reconstructActiveFormattingElements();
-
- if (p.openElements.hasInScope($.NOBR)) {
- callAdoptionAgency(p, token);
- p._reconstructActiveFormattingElements();
- }
-
- p._insertElement(token, NS.HTML);
- p.activeFormattingElements.pushElement(p.openElements.current, token);
-}
-
-function appletStartTagInBody(p, token) {
- p._reconstructActiveFormattingElements();
- p._insertElement(token, NS.HTML);
- p.activeFormattingElements.insertMarker();
- p.framesetOk = false;
-}
-
-function tableStartTagInBody(p, token) {
- if (!p.treeAdapter.isQuirksMode(p.document) && p.openElements.hasInButtonScope($.P))
- p._closePElement();
-
- p._insertElement(token, NS.HTML);
- p.framesetOk = false;
- p.insertionMode = IN_TABLE_MODE;
-}
-
-function areaStartTagInBody(p, token) {
- p._reconstructActiveFormattingElements();
- p._appendElement(token, NS.HTML);
- p.framesetOk = false;
-}
-
-function inputStartTagInBody(p, token) {
- p._reconstructActiveFormattingElements();
- p._appendElement(token, NS.HTML);
-
- var inputType = Tokenizer.getTokenAttr(token, ATTRS.TYPE);
-
- if (!inputType || inputType.toLowerCase() !== HIDDEN_INPUT_TYPE)
- p.framesetOk = false;
-
-}
-
-function paramStartTagInBody(p, token) {
- p._appendElement(token, NS.HTML);
-}
-
-function hrStartTagInBody(p, token) {
- if (p.openElements.hasInButtonScope($.P))
- p._closePElement();
-
- if (p.openElements.currentTagName === $.MENUITEM)
- p.openElements.pop();
-
- p._appendElement(token, NS.HTML);
- p.framesetOk = false;
-}
-
-function imageStartTagInBody(p, token) {
- token.tagName = $.IMG;
- areaStartTagInBody(p, token);
-}
-
-function textareaStartTagInBody(p, token) {
- p._insertElement(token, NS.HTML);
- //NOTE: If the next token is a U+000A LINE FEED (LF) character token, then ignore that token and move
- //on to the next one. (Newlines at the start of textarea elements are ignored as an authoring convenience.)
- p.skipNextNewLine = true;
- p.tokenizer.state = Tokenizer.MODE.RCDATA;
- p.originalInsertionMode = p.insertionMode;
- p.framesetOk = false;
- p.insertionMode = TEXT_MODE;
-}
-
-function xmpStartTagInBody(p, token) {
- if (p.openElements.hasInButtonScope($.P))
- p._closePElement();
-
- p._reconstructActiveFormattingElements();
- p.framesetOk = false;
- p._switchToTextParsing(token, Tokenizer.MODE.RAWTEXT);
-}
-
-function iframeStartTagInBody(p, token) {
- p.framesetOk = false;
- p._switchToTextParsing(token, Tokenizer.MODE.RAWTEXT);
-}
-
-//NOTE: here we assume that we always act as an user agent with enabled plugins, so we parse
-//<noembed> as a rawtext.
-function noembedStartTagInBody(p, token) {
- p._switchToTextParsing(token, Tokenizer.MODE.RAWTEXT);
-}
-
-function selectStartTagInBody(p, token) {
- p._reconstructActiveFormattingElements();
- p._insertElement(token, NS.HTML);
- p.framesetOk = false;
-
- if (p.insertionMode === IN_TABLE_MODE ||
- p.insertionMode === IN_CAPTION_MODE ||
- p.insertionMode === IN_TABLE_BODY_MODE ||
- p.insertionMode === IN_ROW_MODE ||
- p.insertionMode === IN_CELL_MODE)
-
- p.insertionMode = IN_SELECT_IN_TABLE_MODE;
-
- else
- p.insertionMode = IN_SELECT_MODE;
-}
-
-function optgroupStartTagInBody(p, token) {
- if (p.openElements.currentTagName === $.OPTION)
- p.openElements.pop();
-
- p._reconstructActiveFormattingElements();
- p._insertElement(token, NS.HTML);
-}
-
-function rbStartTagInBody(p, token) {
- if (p.openElements.hasInScope($.RUBY))
- p.openElements.generateImpliedEndTags();
-
- p._insertElement(token, NS.HTML);
-}
-
-function rtStartTagInBody(p, token) {
- if (p.openElements.hasInScope($.RUBY))
- p.openElements.generateImpliedEndTagsWithExclusion($.RTC);
-
- p._insertElement(token, NS.HTML);
-}
-
-function menuitemStartTagInBody(p, token) {
- if (p.openElements.currentTagName === $.MENUITEM)
- p.openElements.pop();
-
- // TODO needs clarification, see https://github.com/whatwg/html/pull/907/files#r73505877
- p._reconstructActiveFormattingElements();
-
- p._insertElement(token, NS.HTML);
-}
-
-function menuStartTagInBody(p, token) {
- if (p.openElements.hasInButtonScope($.P))
- p._closePElement();
-
- if (p.openElements.currentTagName === $.MENUITEM)
- p.openElements.pop();
-
- p._insertElement(token, NS.HTML);
-}
-
-function mathStartTagInBody(p, token) {
- p._reconstructActiveFormattingElements();
-
- foreignContent.adjustTokenMathMLAttrs(token);
- foreignContent.adjustTokenXMLAttrs(token);
-
- if (token.selfClosing)
- p._appendElement(token, NS.MATHML);
- else
- p._insertElement(token, NS.MATHML);
-}
-
-function svgStartTagInBody(p, token) {
- p._reconstructActiveFormattingElements();
-
- foreignContent.adjustTokenSVGAttrs(token);
- foreignContent.adjustTokenXMLAttrs(token);
-
- if (token.selfClosing)
- p._appendElement(token, NS.SVG);
- else
- p._insertElement(token, NS.SVG);
-}
-
-function genericStartTagInBody(p, token) {
- p._reconstructActiveFormattingElements();
- p._insertElement(token, NS.HTML);
-}
-
-//OPTIMIZATION: Integer comparisons are low-cost, so we can use very fast tag name length filters here.
-//It's faster than using dictionary.
-function startTagInBody(p, token) {
- var tn = token.tagName;
-
- switch (tn.length) {
- case 1:
- if (tn === $.I || tn === $.S || tn === $.B || tn === $.U)
- bStartTagInBody(p, token);
-
- else if (tn === $.P)
- addressStartTagInBody(p, token);
-
- else if (tn === $.A)
- aStartTagInBody(p, token);
-
- else
- genericStartTagInBody(p, token);
-
- break;
-
- case 2:
- if (tn === $.DL || tn === $.OL || tn === $.UL)
- addressStartTagInBody(p, token);
-
- else if (tn === $.H1 || tn === $.H2 || tn === $.H3 || tn === $.H4 || tn === $.H5 || tn === $.H6)
- numberedHeaderStartTagInBody(p, token);
-
- else if (tn === $.LI || tn === $.DD || tn === $.DT)
- listItemStartTagInBody(p, token);
-
- else if (tn === $.EM || tn === $.TT)
- bStartTagInBody(p, token);
-
- else if (tn === $.BR)
- areaStartTagInBody(p, token);
-
- else if (tn === $.HR)
- hrStartTagInBody(p, token);
-
- else if (tn === $.RB)
- rbStartTagInBody(p, token);
-
- else if (tn === $.RT || tn === $.RP)
- rtStartTagInBody(p, token);
-
- else if (tn !== $.TH && tn !== $.TD && tn !== $.TR)
- genericStartTagInBody(p, token);
-
- break;
-
- case 3:
- if (tn === $.DIV || tn === $.DIR || tn === $.NAV)
- addressStartTagInBody(p, token);
-
- else if (tn === $.PRE)
- preStartTagInBody(p, token);
-
- else if (tn === $.BIG)
- bStartTagInBody(p, token);
-
- else if (tn === $.IMG || tn === $.WBR)
- areaStartTagInBody(p, token);
-
- else if (tn === $.XMP)
- xmpStartTagInBody(p, token);
-
- else if (tn === $.SVG)
- svgStartTagInBody(p, token);
-
- else if (tn === $.RTC)
- rbStartTagInBody(p, token);
-
- else if (tn !== $.COL)
- genericStartTagInBody(p, token);
-
- break;
-
- case 4:
- if (tn === $.HTML)
- htmlStartTagInBody(p, token);
-
- else if (tn === $.BASE || tn === $.LINK || tn === $.META)
- startTagInHead(p, token);
-
- else if (tn === $.BODY)
- bodyStartTagInBody(p, token);
-
- else if (tn === $.MAIN)
- addressStartTagInBody(p, token);
-
- else if (tn === $.FORM)
- formStartTagInBody(p, token);
-
- else if (tn === $.CODE || tn === $.FONT)
- bStartTagInBody(p, token);
-
- else if (tn === $.NOBR)
- nobrStartTagInBody(p, token);
-
- else if (tn === $.AREA)
- areaStartTagInBody(p, token);
-
- else if (tn === $.MATH)
- mathStartTagInBody(p, token);
-
- else if (tn === $.MENU)
- menuStartTagInBody(p, token);
-
- else if (tn !== $.HEAD)
- genericStartTagInBody(p, token);
-
- break;
-
- case 5:
- if (tn === $.STYLE || tn === $.TITLE)
- startTagInHead(p, token);
-
- else if (tn === $.ASIDE)
- addressStartTagInBody(p, token);
-
- else if (tn === $.SMALL)
- bStartTagInBody(p, token);
-
- else if (tn === $.TABLE)
- tableStartTagInBody(p, token);
-
- else if (tn === $.EMBED)
- areaStartTagInBody(p, token);
-
- else if (tn === $.INPUT)
- inputStartTagInBody(p, token);
-
- else if (tn === $.PARAM || tn === $.TRACK)
- paramStartTagInBody(p, token);
-
- else if (tn === $.IMAGE)
- imageStartTagInBody(p, token);
-
- else if (tn !== $.FRAME && tn !== $.TBODY && tn !== $.TFOOT && tn !== $.THEAD)
- genericStartTagInBody(p, token);
-
- break;
-
- case 6:
- if (tn === $.SCRIPT)
- startTagInHead(p, token);
-
- else if (tn === $.CENTER || tn === $.FIGURE || tn === $.FOOTER || tn === $.HEADER || tn === $.HGROUP)
- addressStartTagInBody(p, token);
-
- else if (tn === $.BUTTON)
- buttonStartTagInBody(p, token);
-
- else if (tn === $.STRIKE || tn === $.STRONG)
- bStartTagInBody(p, token);
-
- else if (tn === $.APPLET || tn === $.OBJECT)
- appletStartTagInBody(p, token);
-
- else if (tn === $.KEYGEN)
- areaStartTagInBody(p, token);
-
- else if (tn === $.SOURCE)
- paramStartTagInBody(p, token);
-
- else if (tn === $.IFRAME)
- iframeStartTagInBody(p, token);
-
- else if (tn === $.SELECT)
- selectStartTagInBody(p, token);
-
- else if (tn === $.OPTION)
- optgroupStartTagInBody(p, token);
-
- else
- genericStartTagInBody(p, token);
-
- break;
-
- case 7:
- if (tn === $.BGSOUND)
- startTagInHead(p, token);
-
- else if (tn === $.DETAILS || tn === $.ADDRESS || tn === $.ARTICLE || tn === $.SECTION || tn === $.SUMMARY)
- addressStartTagInBody(p, token);
-
- else if (tn === $.LISTING)
- preStartTagInBody(p, token);
-
- else if (tn === $.MARQUEE)
- appletStartTagInBody(p, token);
-
- else if (tn === $.NOEMBED)
- noembedStartTagInBody(p, token);
-
- else if (tn !== $.CAPTION)
- genericStartTagInBody(p, token);
-
- break;
-
- case 8:
- if (tn === $.BASEFONT)
- startTagInHead(p, token);
-
- else if (tn === $.MENUITEM)
- menuitemStartTagInBody(p, token);
-
- else if (tn === $.FRAMESET)
- framesetStartTagInBody(p, token);
-
- else if (tn === $.FIELDSET)
- addressStartTagInBody(p, token);
-
- else if (tn === $.TEXTAREA)
- textareaStartTagInBody(p, token);
-
- else if (tn === $.TEMPLATE)
- startTagInHead(p, token);
-
- else if (tn === $.NOSCRIPT)
- noembedStartTagInBody(p, token);
-
- else if (tn === $.OPTGROUP)
- optgroupStartTagInBody(p, token);
-
- else if (tn !== $.COLGROUP)
- genericStartTagInBody(p, token);
-
- break;
-
- case 9:
- if (tn === $.PLAINTEXT)
- plaintextStartTagInBody(p, token);
-
- else
- genericStartTagInBody(p, token);
-
- break;
-
- case 10:
- if (tn === $.BLOCKQUOTE || tn === $.FIGCAPTION)
- addressStartTagInBody(p, token);
-
- else
- genericStartTagInBody(p, token);
-
- break;
-
- default:
- genericStartTagInBody(p, token);
- }
-}
-
-function bodyEndTagInBody(p) {
- if (p.openElements.hasInScope($.BODY))
- p.insertionMode = AFTER_BODY_MODE;
-}
-
-function htmlEndTagInBody(p, token) {
- if (p.openElements.hasInScope($.BODY)) {
- p.insertionMode = AFTER_BODY_MODE;
- p._processToken(token);
- }
-}
-
-function addressEndTagInBody(p, token) {
- var tn = token.tagName;
-
- if (p.openElements.hasInScope(tn)) {
- p.openElements.generateImpliedEndTags();
- p.openElements.popUntilTagNamePopped(tn);
- }
-}
-
-function formEndTagInBody(p) {
- var inTemplate = p.openElements.tmplCount > 0,
- formElement = p.formElement;
-
- if (!inTemplate)
- p.formElement = null;
-
- if ((formElement || inTemplate) && p.openElements.hasInScope($.FORM)) {
- p.openElements.generateImpliedEndTags();
-
- if (inTemplate)
- p.openElements.popUntilTagNamePopped($.FORM);
-
- else
- p.openElements.remove(formElement);
- }
-}
-
-function pEndTagInBody(p) {
- if (!p.openElements.hasInButtonScope($.P))
- p._insertFakeElement($.P);
-
- p._closePElement();
-}
-
-function liEndTagInBody(p) {
- if (p.openElements.hasInListItemScope($.LI)) {
- p.openElements.generateImpliedEndTagsWithExclusion($.LI);
- p.openElements.popUntilTagNamePopped($.LI);
- }
-}
-
-function ddEndTagInBody(p, token) {
- var tn = token.tagName;
-
- if (p.openElements.hasInScope(tn)) {
- p.openElements.generateImpliedEndTagsWithExclusion(tn);
- p.openElements.popUntilTagNamePopped(tn);
- }
-}
-
-function numberedHeaderEndTagInBody(p) {
- if (p.openElements.hasNumberedHeaderInScope()) {
- p.openElements.generateImpliedEndTags();
- p.openElements.popUntilNumberedHeaderPopped();
- }
-}
-
-function appletEndTagInBody(p, token) {
- var tn = token.tagName;
-
- if (p.openElements.hasInScope(tn)) {
- p.openElements.generateImpliedEndTags();
- p.openElements.popUntilTagNamePopped(tn);
- p.activeFormattingElements.clearToLastMarker();
- }
-}
-
-function brEndTagInBody(p) {
- p._reconstructActiveFormattingElements();
- p._insertFakeElement($.BR);
- p.openElements.pop();
- p.framesetOk = false;
-}
-
-function genericEndTagInBody(p, token) {
- var tn = token.tagName;
-
- for (var i = p.openElements.stackTop; i > 0; i--) {
- var element = p.openElements.items[i];
-
- if (p.treeAdapter.getTagName(element) === tn) {
- p.openElements.generateImpliedEndTagsWithExclusion(tn);
- p.openElements.popUntilElementPopped(element);
- break;
- }
-
- if (p._isSpecialElement(element))
- break;
- }
-}
-
-//OPTIMIZATION: Integer comparisons are low-cost, so we can use very fast tag name length filters here.
-//It's faster than using dictionary.
-function endTagInBody(p, token) {
- var tn = token.tagName;
-
- switch (tn.length) {
- case 1:
- if (tn === $.A || tn === $.B || tn === $.I || tn === $.S || tn === $.U)
- callAdoptionAgency(p, token);
-
- else if (tn === $.P)
- pEndTagInBody(p, token);
-
- else
- genericEndTagInBody(p, token);
-
- break;
-
- case 2:
- if (tn === $.DL || tn === $.UL || tn === $.OL)
- addressEndTagInBody(p, token);
-
- else if (tn === $.LI)
- liEndTagInBody(p, token);
-
- else if (tn === $.DD || tn === $.DT)
- ddEndTagInBody(p, token);
-
- else if (tn === $.H1 || tn === $.H2 || tn === $.H3 || tn === $.H4 || tn === $.H5 || tn === $.H6)
- numberedHeaderEndTagInBody(p, token);
-
- else if (tn === $.BR)
- brEndTagInBody(p, token);
-
- else if (tn === $.EM || tn === $.TT)
- callAdoptionAgency(p, token);
-
- else
- genericEndTagInBody(p, token);
-
- break;
-
- case 3:
- if (tn === $.BIG)
- callAdoptionAgency(p, token);
-
- else if (tn === $.DIR || tn === $.DIV || tn === $.NAV)
- addressEndTagInBody(p, token);
-
- else
- genericEndTagInBody(p, token);
-
- break;
-
- case 4:
- if (tn === $.BODY)
- bodyEndTagInBody(p, token);
-
- else if (tn === $.HTML)
- htmlEndTagInBody(p, token);
-
- else if (tn === $.FORM)
- formEndTagInBody(p, token);
-
- else if (tn === $.CODE || tn === $.FONT || tn === $.NOBR)
- callAdoptionAgency(p, token);
-
- else if (tn === $.MAIN || tn === $.MENU)
- addressEndTagInBody(p, token);
-
- else
- genericEndTagInBody(p, token);
-
- break;
-
- case 5:
- if (tn === $.ASIDE)
- addressEndTagInBody(p, token);
-
- else if (tn === $.SMALL)
- callAdoptionAgency(p, token);
-
- else
- genericEndTagInBody(p, token);
-
- break;
-
- case 6:
- if (tn === $.CENTER || tn === $.FIGURE || tn === $.FOOTER || tn === $.HEADER || tn === $.HGROUP)
- addressEndTagInBody(p, token);
-
- else if (tn === $.APPLET || tn === $.OBJECT)
- appletEndTagInBody(p, token);
-
- else if (tn === $.STRIKE || tn === $.STRONG)
- callAdoptionAgency(p, token);
-
- else
- genericEndTagInBody(p, token);
-
- break;
-
- case 7:
- if (tn === $.ADDRESS || tn === $.ARTICLE || tn === $.DETAILS || tn === $.SECTION || tn === $.SUMMARY)
- addressEndTagInBody(p, token);
-
- else if (tn === $.MARQUEE)
- appletEndTagInBody(p, token);
-
- else
- genericEndTagInBody(p, token);
-
- break;
-
- case 8:
- if (tn === $.FIELDSET)
- addressEndTagInBody(p, token);
-
- else if (tn === $.TEMPLATE)
- endTagInHead(p, token);
-
- else
- genericEndTagInBody(p, token);
-
- break;
-
- case 10:
- if (tn === $.BLOCKQUOTE || tn === $.FIGCAPTION)
- addressEndTagInBody(p, token);
-
- else
- genericEndTagInBody(p, token);
-
- break;
-
- default :
- genericEndTagInBody(p, token);
- }
-}
-
-function eofInBody(p, token) {
- if (p.tmplInsertionModeStackTop > -1)
- eofInTemplate(p, token);
-
- else
- p.stopped = true;
-}
-
-//12.2.5.4.8 The "text" insertion mode
-//------------------------------------------------------------------
-function endTagInText(p, token) {
- if (token.tagName === $.SCRIPT)
- p.pendingScript = p.openElements.current;
-
- p.openElements.pop();
- p.insertionMode = p.originalInsertionMode;
-}
-
-
-function eofInText(p, token) {
- p.openElements.pop();
- p.insertionMode = p.originalInsertionMode;
- p._processToken(token);
-}
-
-
-//12.2.5.4.9 The "in table" insertion mode
-//------------------------------------------------------------------
-function characterInTable(p, token) {
- var curTn = p.openElements.currentTagName;
-
- if (curTn === $.TABLE || curTn === $.TBODY || curTn === $.TFOOT || curTn === $.THEAD || curTn === $.TR) {
- p.pendingCharacterTokens = [];
- p.hasNonWhitespacePendingCharacterToken = false;
- p.originalInsertionMode = p.insertionMode;
- p.insertionMode = IN_TABLE_TEXT_MODE;
- p._processToken(token);
- }
-
- else
- tokenInTable(p, token);
-}
-
-function captionStartTagInTable(p, token) {
- p.openElements.clearBackToTableContext();
- p.activeFormattingElements.insertMarker();
- p._insertElement(token, NS.HTML);
- p.insertionMode = IN_CAPTION_MODE;
-}
-
-function colgroupStartTagInTable(p, token) {
- p.openElements.clearBackToTableContext();
- p._insertElement(token, NS.HTML);
- p.insertionMode = IN_COLUMN_GROUP_MODE;
-}
-
-function colStartTagInTable(p, token) {
- p.openElements.clearBackToTableContext();
- p._insertFakeElement($.COLGROUP);
- p.insertionMode = IN_COLUMN_GROUP_MODE;
- p._processToken(token);
-}
-
-function tbodyStartTagInTable(p, token) {
- p.openElements.clearBackToTableContext();
- p._insertElement(token, NS.HTML);
- p.insertionMode = IN_TABLE_BODY_MODE;
-}
-
-function tdStartTagInTable(p, token) {
- p.openElements.clearBackToTableContext();
- p._insertFakeElement($.TBODY);
- p.insertionMode = IN_TABLE_BODY_MODE;
- p._processToken(token);
-}
-
-function tableStartTagInTable(p, token) {
- if (p.openElements.hasInTableScope($.TABLE)) {
- p.openElements.popUntilTagNamePopped($.TABLE);
- p._resetInsertionMode();
- p._processToken(token);
- }
-}
-
-function inputStartTagInTable(p, token) {
- var inputType = Tokenizer.getTokenAttr(token, ATTRS.TYPE);
-
- if (inputType && inputType.toLowerCase() === HIDDEN_INPUT_TYPE)
- p._appendElement(token, NS.HTML);
-
- else
- tokenInTable(p, token);
-}
-
-function formStartTagInTable(p, token) {
- if (!p.formElement && p.openElements.tmplCount === 0) {
- p._insertElement(token, NS.HTML);
- p.formElement = p.openElements.current;
- p.openElements.pop();
- }
-}
-
-function startTagInTable(p, token) {
- var tn = token.tagName;
-
- switch (tn.length) {
- case 2:
- if (tn === $.TD || tn === $.TH || tn === $.TR)
- tdStartTagInTable(p, token);
-
- else
- tokenInTable(p, token);
-
- break;
-
- case 3:
- if (tn === $.COL)
- colStartTagInTable(p, token);
-
- else
- tokenInTable(p, token);
-
- break;
-
- case 4:
- if (tn === $.FORM)
- formStartTagInTable(p, token);
-
- else
- tokenInTable(p, token);
-
- break;
-
- case 5:
- if (tn === $.TABLE)
- tableStartTagInTable(p, token);
-
- else if (tn === $.STYLE)
- startTagInHead(p, token);
-
- else if (tn === $.TBODY || tn === $.TFOOT || tn === $.THEAD)
- tbodyStartTagInTable(p, token);
-
- else if (tn === $.INPUT)
- inputStartTagInTable(p, token);
-
- else
- tokenInTable(p, token);
-
- break;
-
- case 6:
- if (tn === $.SCRIPT)
- startTagInHead(p, token);
-
- else
- tokenInTable(p, token);
-
- break;
-
- case 7:
- if (tn === $.CAPTION)
- captionStartTagInTable(p, token);
-
- else
- tokenInTable(p, token);
-
- break;
-
- case 8:
- if (tn === $.COLGROUP)
- colgroupStartTagInTable(p, token);
-
- else if (tn === $.TEMPLATE)
- startTagInHead(p, token);
-
- else
- tokenInTable(p, token);
-
- break;
-
- default:
- tokenInTable(p, token);
- }
-
-}
-
-function endTagInTable(p, token) {
- var tn = token.tagName;
-
- if (tn === $.TABLE) {
- if (p.openElements.hasInTableScope($.TABLE)) {
- p.openElements.popUntilTagNamePopped($.TABLE);
- p._resetInsertionMode();
- }
- }
-
- else if (tn === $.TEMPLATE)
- endTagInHead(p, token);
-
- else if (tn !== $.BODY && tn !== $.CAPTION && tn !== $.COL && tn !== $.COLGROUP && tn !== $.HTML &&
- tn !== $.TBODY && tn !== $.TD && tn !== $.TFOOT && tn !== $.TH && tn !== $.THEAD && tn !== $.TR)
- tokenInTable(p, token);
-}
-
-function tokenInTable(p, token) {
- var savedFosterParentingState = p.fosterParentingEnabled;
-
- p.fosterParentingEnabled = true;
- p._processTokenInBodyMode(token);
- p.fosterParentingEnabled = savedFosterParentingState;
-}
-
-
-//12.2.5.4.10 The "in table text" insertion mode
-//------------------------------------------------------------------
-function whitespaceCharacterInTableText(p, token) {
- p.pendingCharacterTokens.push(token);
-}
-
-function characterInTableText(p, token) {
- p.pendingCharacterTokens.push(token);
- p.hasNonWhitespacePendingCharacterToken = true;
-}
-
-function tokenInTableText(p, token) {
- var i = 0;
-
- if (p.hasNonWhitespacePendingCharacterToken) {
- for (; i < p.pendingCharacterTokens.length; i++)
- tokenInTable(p, p.pendingCharacterTokens[i]);
- }
-
- else {
- for (; i < p.pendingCharacterTokens.length; i++)
- p._insertCharacters(p.pendingCharacterTokens[i]);
- }
-
- p.insertionMode = p.originalInsertionMode;
- p._processToken(token);
-}
-
-
-//12.2.5.4.11 The "in caption" insertion mode
-//------------------------------------------------------------------
-function startTagInCaption(p, token) {
- var tn = token.tagName;
-
- if (tn === $.CAPTION || tn === $.COL || tn === $.COLGROUP || tn === $.TBODY ||
- tn === $.TD || tn === $.TFOOT || tn === $.TH || tn === $.THEAD || tn === $.TR) {
- if (p.openElements.hasInTableScope($.CAPTION)) {
- p.openElements.generateImpliedEndTags();
- p.openElements.popUntilTagNamePopped($.CAPTION);
- p.activeFormattingElements.clearToLastMarker();
- p.insertionMode = IN_TABLE_MODE;
- p._processToken(token);
- }
- }
-
- else
- startTagInBody(p, token);
-}
-
-function endTagInCaption(p, token) {
- var tn = token.tagName;
-
- if (tn === $.CAPTION || tn === $.TABLE) {
- if (p.openElements.hasInTableScope($.CAPTION)) {
- p.openElements.generateImpliedEndTags();
- p.openElements.popUntilTagNamePopped($.CAPTION);
- p.activeFormattingElements.clearToLastMarker();
- p.insertionMode = IN_TABLE_MODE;
-
- if (tn === $.TABLE)
- p._processToken(token);
- }
- }
-
- else if (tn !== $.BODY && tn !== $.COL && tn !== $.COLGROUP && tn !== $.HTML && tn !== $.TBODY &&
- tn !== $.TD && tn !== $.TFOOT && tn !== $.TH && tn !== $.THEAD && tn !== $.TR)
- endTagInBody(p, token);
-}
-
-
-//12.2.5.4.12 The "in column group" insertion mode
-//------------------------------------------------------------------
-function startTagInColumnGroup(p, token) {
- var tn = token.tagName;
-
- if (tn === $.HTML)
- startTagInBody(p, token);
-
- else if (tn === $.COL)
- p._appendElement(token, NS.HTML);
-
- else if (tn === $.TEMPLATE)
- startTagInHead(p, token);
-
- else
- tokenInColumnGroup(p, token);
-}
-
-function endTagInColumnGroup(p, token) {
- var tn = token.tagName;
-
- if (tn === $.COLGROUP) {
- if (p.openElements.currentTagName === $.COLGROUP) {
- p.openElements.pop();
- p.insertionMode = IN_TABLE_MODE;
- }
- }
-
- else if (tn === $.TEMPLATE)
- endTagInHead(p, token);
-
- else if (tn !== $.COL)
- tokenInColumnGroup(p, token);
-}
-
-function tokenInColumnGroup(p, token) {
- if (p.openElements.currentTagName === $.COLGROUP) {
- p.openElements.pop();
- p.insertionMode = IN_TABLE_MODE;
- p._processToken(token);
- }
-}
-
-//12.2.5.4.13 The "in table body" insertion mode
-//------------------------------------------------------------------
-function startTagInTableBody(p, token) {
- var tn = token.tagName;
-
- if (tn === $.TR) {
- p.openElements.clearBackToTableBodyContext();
- p._insertElement(token, NS.HTML);
- p.insertionMode = IN_ROW_MODE;
- }
-
- else if (tn === $.TH || tn === $.TD) {
- p.openElements.clearBackToTableBodyContext();
- p._insertFakeElement($.TR);
- p.insertionMode = IN_ROW_MODE;
- p._processToken(token);
- }
-
- else if (tn === $.CAPTION || tn === $.COL || tn === $.COLGROUP ||
- tn === $.TBODY || tn === $.TFOOT || tn === $.THEAD) {
-
- if (p.openElements.hasTableBodyContextInTableScope()) {
- p.openElements.clearBackToTableBodyContext();
- p.openElements.pop();
- p.insertionMode = IN_TABLE_MODE;
- p._processToken(token);
- }
- }
-
- else
- startTagInTable(p, token);
-}
-
-function endTagInTableBody(p, token) {
- var tn = token.tagName;
-
- if (tn === $.TBODY || tn === $.TFOOT || tn === $.THEAD) {
- if (p.openElements.hasInTableScope(tn)) {
- p.openElements.clearBackToTableBodyContext();
- p.openElements.pop();
- p.insertionMode = IN_TABLE_MODE;
- }
- }
-
- else if (tn === $.TABLE) {
- if (p.openElements.hasTableBodyContextInTableScope()) {
- p.openElements.clearBackToTableBodyContext();
- p.openElements.pop();
- p.insertionMode = IN_TABLE_MODE;
- p._processToken(token);
- }
- }
-
- else if (tn !== $.BODY && tn !== $.CAPTION && tn !== $.COL && tn !== $.COLGROUP ||
- tn !== $.HTML && tn !== $.TD && tn !== $.TH && tn !== $.TR)
- endTagInTable(p, token);
-}
-
-//12.2.5.4.14 The "in row" insertion mode
-//------------------------------------------------------------------
-function startTagInRow(p, token) {
- var tn = token.tagName;
-
- if (tn === $.TH || tn === $.TD) {
- p.openElements.clearBackToTableRowContext();
- p._insertElement(token, NS.HTML);
- p.insertionMode = IN_CELL_MODE;
- p.activeFormattingElements.insertMarker();
- }
-
- else if (tn === $.CAPTION || tn === $.COL || tn === $.COLGROUP || tn === $.TBODY ||
- tn === $.TFOOT || tn === $.THEAD || tn === $.TR) {
- if (p.openElements.hasInTableScope($.TR)) {
- p.openElements.clearBackToTableRowContext();
- p.openElements.pop();
- p.insertionMode = IN_TABLE_BODY_MODE;
- p._processToken(token);
- }
- }
-
- else
- startTagInTable(p, token);
-}
-
-function endTagInRow(p, token) {
- var tn = token.tagName;
-
- if (tn === $.TR) {
- if (p.openElements.hasInTableScope($.TR)) {
- p.openElements.clearBackToTableRowContext();
- p.openElements.pop();
- p.insertionMode = IN_TABLE_BODY_MODE;
- }
- }
-
- else if (tn === $.TABLE) {
- if (p.openElements.hasInTableScope($.TR)) {
- p.openElements.clearBackToTableRowContext();
- p.openElements.pop();
- p.insertionMode = IN_TABLE_BODY_MODE;
- p._processToken(token);
- }
- }
-
- else if (tn === $.TBODY || tn === $.TFOOT || tn === $.THEAD) {
- if (p.openElements.hasInTableScope(tn) || p.openElements.hasInTableScope($.TR)) {
- p.openElements.clearBackToTableRowContext();
- p.openElements.pop();
- p.insertionMode = IN_TABLE_BODY_MODE;
- p._processToken(token);
- }
- }
-
- else if (tn !== $.BODY && tn !== $.CAPTION && tn !== $.COL && tn !== $.COLGROUP ||
- tn !== $.HTML && tn !== $.TD && tn !== $.TH)
- endTagInTable(p, token);
-}
-
-
-//12.2.5.4.15 The "in cell" insertion mode
-//------------------------------------------------------------------
-function startTagInCell(p, token) {
- var tn = token.tagName;
-
- if (tn === $.CAPTION || tn === $.COL || tn === $.COLGROUP || tn === $.TBODY ||
- tn === $.TD || tn === $.TFOOT || tn === $.TH || tn === $.THEAD || tn === $.TR) {
-
- if (p.openElements.hasInTableScope($.TD) || p.openElements.hasInTableScope($.TH)) {
- p._closeTableCell();
- p._processToken(token);
- }
- }
-
- else
- startTagInBody(p, token);
-}
-
-function endTagInCell(p, token) {
- var tn = token.tagName;
-
- if (tn === $.TD || tn === $.TH) {
- if (p.openElements.hasInTableScope(tn)) {
- p.openElements.generateImpliedEndTags();
- p.openElements.popUntilTagNamePopped(tn);
- p.activeFormattingElements.clearToLastMarker();
- p.insertionMode = IN_ROW_MODE;
- }
- }
-
- else if (tn === $.TABLE || tn === $.TBODY || tn === $.TFOOT || tn === $.THEAD || tn === $.TR) {
- if (p.openElements.hasInTableScope(tn)) {
- p._closeTableCell();
- p._processToken(token);
- }
- }
-
- else if (tn !== $.BODY && tn !== $.CAPTION && tn !== $.COL && tn !== $.COLGROUP && tn !== $.HTML)
- endTagInBody(p, token);
-}
-
-//12.2.5.4.16 The "in select" insertion mode
-//------------------------------------------------------------------
-function startTagInSelect(p, token) {
- var tn = token.tagName;
-
- if (tn === $.HTML)
- startTagInBody(p, token);
-
- else if (tn === $.OPTION) {
- if (p.openElements.currentTagName === $.OPTION)
- p.openElements.pop();
-
- p._insertElement(token, NS.HTML);
- }
-
- else if (tn === $.OPTGROUP) {
- if (p.openElements.currentTagName === $.OPTION)
- p.openElements.pop();
-
- if (p.openElements.currentTagName === $.OPTGROUP)
- p.openElements.pop();
-
- p._insertElement(token, NS.HTML);
- }
-
- else if (tn === $.INPUT || tn === $.KEYGEN || tn === $.TEXTAREA || tn === $.SELECT) {
- if (p.openElements.hasInSelectScope($.SELECT)) {
- p.openElements.popUntilTagNamePopped($.SELECT);
- p._resetInsertionMode();
-
- if (tn !== $.SELECT)
- p._processToken(token);
- }
- }
-
- else if (tn === $.SCRIPT || tn === $.TEMPLATE)
- startTagInHead(p, token);
-}
-
-function endTagInSelect(p, token) {
- var tn = token.tagName;
-
- if (tn === $.OPTGROUP) {
- var prevOpenElement = p.openElements.items[p.openElements.stackTop - 1],
- prevOpenElementTn = prevOpenElement && p.treeAdapter.getTagName(prevOpenElement);
-
- if (p.openElements.currentTagName === $.OPTION && prevOpenElementTn === $.OPTGROUP)
- p.openElements.pop();
-
- if (p.openElements.currentTagName === $.OPTGROUP)
- p.openElements.pop();
- }
-
- else if (tn === $.OPTION) {
- if (p.openElements.currentTagName === $.OPTION)
- p.openElements.pop();
- }
-
- else if (tn === $.SELECT && p.openElements.hasInSelectScope($.SELECT)) {
- p.openElements.popUntilTagNamePopped($.SELECT);
- p._resetInsertionMode();
- }
-
- else if (tn === $.TEMPLATE)
- endTagInHead(p, token);
-}
-
-//12.2.5.4.17 The "in select in table" insertion mode
-//------------------------------------------------------------------
-function startTagInSelectInTable(p, token) {
- var tn = token.tagName;
-
- if (tn === $.CAPTION || tn === $.TABLE || tn === $.TBODY || tn === $.TFOOT ||
- tn === $.THEAD || tn === $.TR || tn === $.TD || tn === $.TH) {
- p.openElements.popUntilTagNamePopped($.SELECT);
- p._resetInsertionMode();
- p._processToken(token);
- }
-
- else
- startTagInSelect(p, token);
-}
-
-function endTagInSelectInTable(p, token) {
- var tn = token.tagName;
-
- if (tn === $.CAPTION || tn === $.TABLE || tn === $.TBODY || tn === $.TFOOT ||
- tn === $.THEAD || tn === $.TR || tn === $.TD || tn === $.TH) {
- if (p.openElements.hasInTableScope(tn)) {
- p.openElements.popUntilTagNamePopped($.SELECT);
- p._resetInsertionMode();
- p._processToken(token);
- }
- }
-
- else
- endTagInSelect(p, token);
-}
-
-//12.2.5.4.18 The "in template" insertion mode
-//------------------------------------------------------------------
-function startTagInTemplate(p, token) {
- var tn = token.tagName;
-
- if (tn === $.BASE || tn === $.BASEFONT || tn === $.BGSOUND || tn === $.LINK || tn === $.META ||
- tn === $.NOFRAMES || tn === $.SCRIPT || tn === $.STYLE || tn === $.TEMPLATE || tn === $.TITLE)
- startTagInHead(p, token);
-
- else {
- var newInsertionMode = TEMPLATE_INSERTION_MODE_SWITCH_MAP[tn] || IN_BODY_MODE;
-
- p._popTmplInsertionMode();
- p._pushTmplInsertionMode(newInsertionMode);
- p.insertionMode = newInsertionMode;
- p._processToken(token);
- }
-}
-
-function endTagInTemplate(p, token) {
- if (token.tagName === $.TEMPLATE)
- endTagInHead(p, token);
-}
-
-function eofInTemplate(p, token) {
- if (p.openElements.tmplCount > 0) {
- p.openElements.popUntilTagNamePopped($.TEMPLATE);
- p.activeFormattingElements.clearToLastMarker();
- p._popTmplInsertionMode();
- p._resetInsertionMode();
- p._processToken(token);
- }
-
- else
- p.stopped = true;
-}
-
-
-//12.2.5.4.19 The "after body" insertion mode
-//------------------------------------------------------------------
-function startTagAfterBody(p, token) {
- if (token.tagName === $.HTML)
- startTagInBody(p, token);
-
- else
- tokenAfterBody(p, token);
-}
-
-function endTagAfterBody(p, token) {
- if (token.tagName === $.HTML) {
- if (!p.fragmentContext)
- p.insertionMode = AFTER_AFTER_BODY_MODE;
- }
-
- else
- tokenAfterBody(p, token);
-}
-
-function tokenAfterBody(p, token) {
- p.insertionMode = IN_BODY_MODE;
- p._processToken(token);
-}
-
-//12.2.5.4.20 The "in frameset" insertion mode
-//------------------------------------------------------------------
-function startTagInFrameset(p, token) {
- var tn = token.tagName;
-
- if (tn === $.HTML)
- startTagInBody(p, token);
-
- else if (tn === $.FRAMESET)
- p._insertElement(token, NS.HTML);
-
- else if (tn === $.FRAME)
- p._appendElement(token, NS.HTML);
-
- else if (tn === $.NOFRAMES)
- startTagInHead(p, token);
-}
-
-function endTagInFrameset(p, token) {
- if (token.tagName === $.FRAMESET && !p.openElements.isRootHtmlElementCurrent()) {
- p.openElements.pop();
-
- if (!p.fragmentContext && p.openElements.currentTagName !== $.FRAMESET)
- p.insertionMode = AFTER_FRAMESET_MODE;
- }
-}
-
-//12.2.5.4.21 The "after frameset" insertion mode
-//------------------------------------------------------------------
-function startTagAfterFrameset(p, token) {
- var tn = token.tagName;
-
- if (tn === $.HTML)
- startTagInBody(p, token);
-
- else if (tn === $.NOFRAMES)
- startTagInHead(p, token);
-}
-
-function endTagAfterFrameset(p, token) {
- if (token.tagName === $.HTML)
- p.insertionMode = AFTER_AFTER_FRAMESET_MODE;
-}
-
-//12.2.5.4.22 The "after after body" insertion mode
-//------------------------------------------------------------------
-function startTagAfterAfterBody(p, token) {
- if (token.tagName === $.HTML)
- startTagInBody(p, token);
-
- else
- tokenAfterAfterBody(p, token);
-}
-
-function tokenAfterAfterBody(p, token) {
- p.insertionMode = IN_BODY_MODE;
- p._processToken(token);
-}
-
-//12.2.5.4.23 The "after after frameset" insertion mode
-//------------------------------------------------------------------
-function startTagAfterAfterFrameset(p, token) {
- var tn = token.tagName;
-
- if (tn === $.HTML)
- startTagInBody(p, token);
-
- else if (tn === $.NOFRAMES)
- startTagInHead(p, token);
-}
-
-
-//12.2.5.5 The rules for parsing tokens in foreign content
-//------------------------------------------------------------------
-function nullCharacterInForeignContent(p, token) {
- token.chars = UNICODE.REPLACEMENT_CHARACTER;
- p._insertCharacters(token);
-}
-
-function characterInForeignContent(p, token) {
- p._insertCharacters(token);
- p.framesetOk = false;
-}
-
-function startTagInForeignContent(p, token) {
- if (foreignContent.causesExit(token) && !p.fragmentContext) {
- while (p.treeAdapter.getNamespaceURI(p.openElements.current) !== NS.HTML && !p._isIntegrationPoint(p.openElements.current))
- p.openElements.pop();
-
- p._processToken(token);
- }
-
- else {
- var current = p._getAdjustedCurrentElement(),
- currentNs = p.treeAdapter.getNamespaceURI(current);
-
- if (currentNs === NS.MATHML)
- foreignContent.adjustTokenMathMLAttrs(token);
-
- else if (currentNs === NS.SVG) {
- foreignContent.adjustTokenSVGTagName(token);
- foreignContent.adjustTokenSVGAttrs(token);
- }
-
- foreignContent.adjustTokenXMLAttrs(token);
-
- if (token.selfClosing)
- p._appendElement(token, currentNs);
- else
- p._insertElement(token, currentNs);
- }
-}
-
-function endTagInForeignContent(p, token) {
- for (var i = p.openElements.stackTop; i > 0; i--) {
- var element = p.openElements.items[i];
-
- if (p.treeAdapter.getNamespaceURI(element) === NS.HTML) {
- p._processToken(token);
- break;
- }
-
- if (p.treeAdapter.getTagName(element).toLowerCase() === token.tagName) {
- p.openElements.popUntilElementPopped(element);
- break;
- }
- }
-}
diff --git a/tools/eslint/node_modules/parse5/lib/parser/open_element_stack.js b/tools/eslint/node_modules/parse5/lib/parser/open_element_stack.js
deleted file mode 100644
index bde23695c1..0000000000
--- a/tools/eslint/node_modules/parse5/lib/parser/open_element_stack.js
+++ /dev/null
@@ -1,395 +0,0 @@
-'use strict';
-
-var HTML = require('../common/html');
-
-//Aliases
-var $ = HTML.TAG_NAMES,
- NS = HTML.NAMESPACES;
-
-//Element utils
-
-//OPTIMIZATION: Integer comparisons are low-cost, so we can use very fast tag name length filters here.
-//It's faster than using dictionary.
-function isImpliedEndTagRequired(tn) {
- switch (tn.length) {
- case 1:
- return tn === $.P;
-
- case 2:
- return tn === $.RB || tn === $.RP || tn === $.RT || tn === $.DD || tn === $.DT || tn === $.LI;
-
- case 3:
- return tn === $.RTC;
-
- case 6:
- return tn === $.OPTION;
-
- case 8:
- return tn === $.OPTGROUP || tn === $.MENUITEM;
- }
-
- return false;
-}
-
-function isScopingElement(tn, ns) {
- switch (tn.length) {
- case 2:
- if (tn === $.TD || tn === $.TH)
- return ns === NS.HTML;
-
- else if (tn === $.MI || tn === $.MO || tn === $.MN || tn === $.MS)
- return ns === NS.MATHML;
-
- break;
-
- case 4:
- if (tn === $.HTML)
- return ns === NS.HTML;
-
- else if (tn === $.DESC)
- return ns === NS.SVG;
-
- break;
-
- case 5:
- if (tn === $.TABLE)
- return ns === NS.HTML;
-
- else if (tn === $.MTEXT)
- return ns === NS.MATHML;
-
- else if (tn === $.TITLE)
- return ns === NS.SVG;
-
- break;
-
- case 6:
- return (tn === $.APPLET || tn === $.OBJECT) && ns === NS.HTML;
-
- case 7:
- return (tn === $.CAPTION || tn === $.MARQUEE) && ns === NS.HTML;
-
- case 8:
- return tn === $.TEMPLATE && ns === NS.HTML;
-
- case 13:
- return tn === $.FOREIGN_OBJECT && ns === NS.SVG;
-
- case 14:
- return tn === $.ANNOTATION_XML && ns === NS.MATHML;
- }
-
- return false;
-}
-
-//Stack of open elements
-var OpenElementStack = module.exports = function (document, treeAdapter) {
- this.stackTop = -1;
- this.items = [];
- this.current = document;
- this.currentTagName = null;
- this.currentTmplContent = null;
- this.tmplCount = 0;
- this.treeAdapter = treeAdapter;
-};
-
-//Index of element
-OpenElementStack.prototype._indexOf = function (element) {
- var idx = -1;
-
- for (var i = this.stackTop; i >= 0; i--) {
- if (this.items[i] === element) {
- idx = i;
- break;
- }
- }
- return idx;
-};
-
-//Update current element
-OpenElementStack.prototype._isInTemplate = function () {
- return this.currentTagName === $.TEMPLATE && this.treeAdapter.getNamespaceURI(this.current) === NS.HTML;
-};
-
-OpenElementStack.prototype._updateCurrentElement = function () {
- this.current = this.items[this.stackTop];
- this.currentTagName = this.current && this.treeAdapter.getTagName(this.current);
-
- this.currentTmplContent = this._isInTemplate() ? this.treeAdapter.getTemplateContent(this.current) : null;
-};
-
-//Mutations
-OpenElementStack.prototype.push = function (element) {
- this.items[++this.stackTop] = element;
- this._updateCurrentElement();
-
- if (this._isInTemplate())
- this.tmplCount++;
-
-};
-
-OpenElementStack.prototype.pop = function () {
- this.stackTop--;
-
- if (this.tmplCount > 0 && this._isInTemplate())
- this.tmplCount--;
-
- this._updateCurrentElement();
-};
-
-OpenElementStack.prototype.replace = function (oldElement, newElement) {
- var idx = this._indexOf(oldElement);
-
- this.items[idx] = newElement;
-
- if (idx === this.stackTop)
- this._updateCurrentElement();
-};
-
-OpenElementStack.prototype.insertAfter = function (referenceElement, newElement) {
- var insertionIdx = this._indexOf(referenceElement) + 1;
-
- this.items.splice(insertionIdx, 0, newElement);
-
- if (insertionIdx === ++this.stackTop)
- this._updateCurrentElement();
-};
-
-OpenElementStack.prototype.popUntilTagNamePopped = function (tagName) {
- while (this.stackTop > -1) {
- var tn = this.currentTagName,
- ns = this.treeAdapter.getNamespaceURI(this.current);
-
- this.pop();
-
- if (tn === tagName && ns === NS.HTML)
- break;
- }
-};
-
-OpenElementStack.prototype.popUntilElementPopped = function (element) {
- while (this.stackTop > -1) {
- var poppedElement = this.current;
-
- this.pop();
-
- if (poppedElement === element)
- break;
- }
-};
-
-OpenElementStack.prototype.popUntilNumberedHeaderPopped = function () {
- while (this.stackTop > -1) {
- var tn = this.currentTagName,
- ns = this.treeAdapter.getNamespaceURI(this.current);
-
- this.pop();
-
- if (tn === $.H1 || tn === $.H2 || tn === $.H3 || tn === $.H4 || tn === $.H5 || tn === $.H6 && ns === NS.HTML)
- break;
- }
-};
-
-OpenElementStack.prototype.popUntilTableCellPopped = function () {
- while (this.stackTop > -1) {
- var tn = this.currentTagName,
- ns = this.treeAdapter.getNamespaceURI(this.current);
-
- this.pop();
-
- if (tn === $.TD || tn === $.TH && ns === NS.HTML)
- break;
- }
-};
-
-OpenElementStack.prototype.popAllUpToHtmlElement = function () {
- //NOTE: here we assume that root <html> element is always first in the open element stack, so
- //we perform this fast stack clean up.
- this.stackTop = 0;
- this._updateCurrentElement();
-};
-
-OpenElementStack.prototype.clearBackToTableContext = function () {
- while (this.currentTagName !== $.TABLE &&
- this.currentTagName !== $.TEMPLATE &&
- this.currentTagName !== $.HTML ||
- this.treeAdapter.getNamespaceURI(this.current) !== NS.HTML)
- this.pop();
-};
-
-OpenElementStack.prototype.clearBackToTableBodyContext = function () {
- while (this.currentTagName !== $.TBODY &&
- this.currentTagName !== $.TFOOT &&
- this.currentTagName !== $.THEAD &&
- this.currentTagName !== $.TEMPLATE &&
- this.currentTagName !== $.HTML ||
- this.treeAdapter.getNamespaceURI(this.current) !== NS.HTML)
- this.pop();
-};
-
-OpenElementStack.prototype.clearBackToTableRowContext = function () {
- while (this.currentTagName !== $.TR &&
- this.currentTagName !== $.TEMPLATE &&
- this.currentTagName !== $.HTML ||
- this.treeAdapter.getNamespaceURI(this.current) !== NS.HTML)
- this.pop();
-};
-
-OpenElementStack.prototype.remove = function (element) {
- for (var i = this.stackTop; i >= 0; i--) {
- if (this.items[i] === element) {
- this.items.splice(i, 1);
- this.stackTop--;
- this._updateCurrentElement();
- break;
- }
- }
-};
-
-//Search
-OpenElementStack.prototype.tryPeekProperlyNestedBodyElement = function () {
- //Properly nested <body> element (should be second element in stack).
- var element = this.items[1];
-
- return element && this.treeAdapter.getTagName(element) === $.BODY ? element : null;
-};
-
-OpenElementStack.prototype.contains = function (element) {
- return this._indexOf(element) > -1;
-};
-
-OpenElementStack.prototype.getCommonAncestor = function (element) {
- var elementIdx = this._indexOf(element);
-
- return --elementIdx >= 0 ? this.items[elementIdx] : null;
-};
-
-OpenElementStack.prototype.isRootHtmlElementCurrent = function () {
- return this.stackTop === 0 && this.currentTagName === $.HTML;
-};
-
-//Element in scope
-OpenElementStack.prototype.hasInScope = function (tagName) {
- for (var i = this.stackTop; i >= 0; i--) {
- var tn = this.treeAdapter.getTagName(this.items[i]),
- ns = this.treeAdapter.getNamespaceURI(this.items[i]);
-
- if (tn === tagName && ns === NS.HTML)
- return true;
-
- if (isScopingElement(tn, ns))
- return false;
- }
-
- return true;
-};
-
-OpenElementStack.prototype.hasNumberedHeaderInScope = function () {
- for (var i = this.stackTop; i >= 0; i--) {
- var tn = this.treeAdapter.getTagName(this.items[i]),
- ns = this.treeAdapter.getNamespaceURI(this.items[i]);
-
- if ((tn === $.H1 || tn === $.H2 || tn === $.H3 || tn === $.H4 || tn === $.H5 || tn === $.H6) && ns === NS.HTML)
- return true;
-
- if (isScopingElement(tn, ns))
- return false;
- }
-
- return true;
-};
-
-OpenElementStack.prototype.hasInListItemScope = function (tagName) {
- for (var i = this.stackTop; i >= 0; i--) {
- var tn = this.treeAdapter.getTagName(this.items[i]),
- ns = this.treeAdapter.getNamespaceURI(this.items[i]);
-
- if (tn === tagName && ns === NS.HTML)
- return true;
-
- if ((tn === $.UL || tn === $.OL) && ns === NS.HTML || isScopingElement(tn, ns))
- return false;
- }
-
- return true;
-};
-
-OpenElementStack.prototype.hasInButtonScope = function (tagName) {
- for (var i = this.stackTop; i >= 0; i--) {
- var tn = this.treeAdapter.getTagName(this.items[i]),
- ns = this.treeAdapter.getNamespaceURI(this.items[i]);
-
- if (tn === tagName && ns === NS.HTML)
- return true;
-
- if (tn === $.BUTTON && ns === NS.HTML || isScopingElement(tn, ns))
- return false;
- }
-
- return true;
-};
-
-OpenElementStack.prototype.hasInTableScope = function (tagName) {
- for (var i = this.stackTop; i >= 0; i--) {
- var tn = this.treeAdapter.getTagName(this.items[i]),
- ns = this.treeAdapter.getNamespaceURI(this.items[i]);
-
- if (ns !== NS.HTML)
- continue;
-
- if (tn === tagName)
- return true;
-
- if (tn === $.TABLE || tn === $.TEMPLATE || tn === $.HTML)
- return false;
- }
-
- return true;
-};
-
-OpenElementStack.prototype.hasTableBodyContextInTableScope = function () {
- for (var i = this.stackTop; i >= 0; i--) {
- var tn = this.treeAdapter.getTagName(this.items[i]),
- ns = this.treeAdapter.getNamespaceURI(this.items[i]);
-
- if (ns !== NS.HTML)
- continue;
-
- if (tn === $.TBODY || tn === $.THEAD || tn === $.TFOOT)
- return true;
-
- if (tn === $.TABLE || tn === $.HTML)
- return false;
- }
-
- return true;
-};
-
-OpenElementStack.prototype.hasInSelectScope = function (tagName) {
- for (var i = this.stackTop; i >= 0; i--) {
- var tn = this.treeAdapter.getTagName(this.items[i]),
- ns = this.treeAdapter.getNamespaceURI(this.items[i]);
-
- if (ns !== NS.HTML)
- continue;
-
- if (tn === tagName)
- return true;
-
- if (tn !== $.OPTION && tn !== $.OPTGROUP)
- return false;
- }
-
- return true;
-};
-
-//Implied end tags
-OpenElementStack.prototype.generateImpliedEndTags = function () {
- while (isImpliedEndTagRequired(this.currentTagName))
- this.pop();
-};
-
-OpenElementStack.prototype.generateImpliedEndTagsWithExclusion = function (exclusionTagName) {
- while (isImpliedEndTagRequired(this.currentTagName) && this.currentTagName !== exclusionTagName)
- this.pop();
-};
diff --git a/tools/eslint/node_modules/parse5/lib/parser/stream.js b/tools/eslint/node_modules/parse5/lib/parser/stream.js
deleted file mode 100644
index 3122190c72..0000000000
--- a/tools/eslint/node_modules/parse5/lib/parser/stream.js
+++ /dev/null
@@ -1,140 +0,0 @@
-'use strict';
-
-var WritableStream = require('stream').Writable,
- inherits = require('util').inherits,
- Parser = require('./index');
-
-/**
- * Streaming HTML parser with scripting support.
- * A [writable stream]{@link https://nodejs.org/api/stream.html#stream_class_stream_writable}.
- * @class ParserStream
- * @memberof parse5
- * @instance
- * @extends stream.Writable
- * @param {ParserOptions} options - Parsing options.
- * @example
- * var parse5 = require('parse5');
- * var http = require('http');
- *
- * // Fetch the google.com content and obtain it's <body> node
- * http.get('http://google.com', function(res) {
- * var parser = new parse5.ParserStream();
- *
- * parser.on('finish', function() {
- * var body = parser.document.childNodes[0].childNodes[1];
- * });
- *
- * res.pipe(parser);
- * });
- */
-var ParserStream = module.exports = function (options) {
- WritableStream.call(this);
-
- this.parser = new Parser(options);
-
- this.lastChunkWritten = false;
- this.writeCallback = null;
- this.pausedByScript = false;
-
- /**
- * The resulting document node.
- * @member {ASTNode<document>} document
- * @memberof parse5#ParserStream
- * @instance
- */
- this.document = this.parser.treeAdapter.createDocument();
-
- this.pendingHtmlInsertions = [];
-
- this._resume = this._resume.bind(this);
- this._documentWrite = this._documentWrite.bind(this);
- this._scriptHandler = this._scriptHandler.bind(this);
-
- this.parser._bootstrap(this.document, null);
-};
-
-inherits(ParserStream, WritableStream);
-
-//WritableStream implementation
-ParserStream.prototype._write = function (chunk, encoding, callback) {
- this.writeCallback = callback;
- this.parser.tokenizer.write(chunk.toString('utf8'), this.lastChunkWritten);
- this._runParsingLoop();
-};
-
-ParserStream.prototype.end = function (chunk, encoding, callback) {
- this.lastChunkWritten = true;
- WritableStream.prototype.end.call(this, chunk, encoding, callback);
-};
-
-//Scriptable parser implementation
-ParserStream.prototype._runParsingLoop = function () {
- this.parser._runParsingLoop(this.writeCallback, this._scriptHandler);
-};
-
-ParserStream.prototype._resume = function () {
- if (!this.pausedByScript)
- throw new Error('Parser was already resumed');
-
- while (this.pendingHtmlInsertions.length) {
- var html = this.pendingHtmlInsertions.pop();
-
- this.parser.tokenizer.insertHtmlAtCurrentPos(html);
- }
-
- this.pausedByScript = false;
-
- //NOTE: keep parsing if we don't wait for the next input chunk
- if (this.parser.tokenizer.active)
- this._runParsingLoop();
-};
-
-ParserStream.prototype._documentWrite = function (html) {
- if (!this.parser.stopped)
- this.pendingHtmlInsertions.push(html);
-};
-
-ParserStream.prototype._scriptHandler = function (scriptElement) {
- if (this.listeners('script').length) {
- this.pausedByScript = true;
-
- /**
- * Raised then parser encounters a `<script>` element.
- * If this event has listeners, parsing will be suspended once it is emitted.
- * So, if `<script>` has the `src` attribute, you can fetch it, execute and then resume parsing just like browsers do.
- * @event script
- * @memberof parse5#ParserStream
- * @instance
- * @type {Function}
- * @param {ASTNode} scriptElement - The script element that caused the event.
- * @param {Function} documentWrite(html) - Write additional `html` at the current parsing position.
- * Suitable for implementing the DOM `document.write` and `document.writeln` methods.
- * @param {Function} resume - Resumes parsing.
- * @example
- * var parse = require('parse5');
- * var http = require('http');
- *
- * var parser = new parse5.ParserStream();
- *
- * parser.on('script', function(scriptElement, documentWrite, resume) {
- * var src = parse5.treeAdapters.default.getAttrList(scriptElement)[0].value;
- *
- * http.get(src, function(res) {
- * // Fetch the script content, execute it with DOM built around `parser.document` and
- * // `document.write` implemented using `documentWrite`.
- * ...
- * // Then resume parsing.
- * resume();
- * });
- * });
- *
- * parser.end('<script src="example.com/script.js"></script>');
- */
-
-
- this.emit('script', scriptElement, this._documentWrite, this._resume);
- }
- else
- this._runParsingLoop();
-};
-
diff --git a/tools/eslint/node_modules/parse5/lib/sax/dev_null_stream.js b/tools/eslint/node_modules/parse5/lib/sax/dev_null_stream.js
deleted file mode 100644
index 96bdcf3312..0000000000
--- a/tools/eslint/node_modules/parse5/lib/sax/dev_null_stream.js
+++ /dev/null
@@ -1,14 +0,0 @@
-'use strict';
-
-var WritableStream = require('stream').Writable,
- util = require('util');
-
-var DevNullStream = module.exports = function () {
- WritableStream.call(this);
-};
-
-util.inherits(DevNullStream, WritableStream);
-
-DevNullStream.prototype._write = function (chunk, encoding, cb) {
- cb();
-};
diff --git a/tools/eslint/node_modules/parse5/lib/sax/index.js b/tools/eslint/node_modules/parse5/lib/sax/index.js
deleted file mode 100644
index 85f3ad4d0f..0000000000
--- a/tools/eslint/node_modules/parse5/lib/sax/index.js
+++ /dev/null
@@ -1,230 +0,0 @@
-'use strict';
-
-var TransformStream = require('stream').Transform,
- DevNullStream = require('./dev_null_stream'),
- inherits = require('util').inherits,
- Tokenizer = require('../tokenizer'),
- ParserFeedbackSimulator = require('./parser_feedback_simulator'),
- mergeOptions = require('../common/merge_options');
-
-/**
- * @typedef {Object} SAXParserOptions
- *
- * @property {Boolean} [locationInfo=false] - Enables source code location information for the tokens.
- * When enabled, each token event handler will receive {@link LocationInfo} (or {@link StartTagLocationInfo})
- * object as its last argument.
- */
-var DEFAULT_OPTIONS = {
- locationInfo: false
-};
-
-/**
- * Streaming [SAX]{@link https://en.wikipedia.org/wiki/Simple_API_for_XML}-style HTML parser.
- * A [transform stream](https://nodejs.org/api/stream.html#stream_class_stream_transform)
- * (which means you can pipe *through* it, see example).
- * @class SAXParser
- * @memberof parse5
- * @instance
- * @extends stream.Transform
- * @param {SAXParserOptions} options - Parsing options.
- * @example
- * var parse5 = require('parse5');
- * var http = require('http');
- * var fs = require('fs');
- *
- * var file = fs.createWriteStream('/home/google.com.html');
- * var parser = new parse5.SAXParser();
- *
- * parser.on('text', function(text) {
- * // Handle page text content
- * ...
- * });
- *
- * http.get('http://google.com', function(res) {
- * // SAXParser is the Transform stream, which means you can pipe
- * // through it. So, you can analyze page content and, e.g., save it
- * // to the file at the same time:
- * res.pipe(parser).pipe(file);
- * });
- */
-var SAXParser = module.exports = function (options) {
- TransformStream.call(this);
-
- this.options = mergeOptions(DEFAULT_OPTIONS, options);
-
- this.tokenizer = new Tokenizer(options);
- this.parserFeedbackSimulator = new ParserFeedbackSimulator(this.tokenizer);
-
- this.pendingText = null;
- this.currentTokenLocation = void 0;
-
- this.lastChunkWritten = false;
- this.stopped = false;
-
- // NOTE: always pipe stream to the /dev/null stream to avoid
- // `highWaterMark` hit even if we don't have consumers.
- // (see: https://github.com/inikulin/parse5/issues/97#issuecomment-171940774)
- this.pipe(new DevNullStream());
-};
-
-inherits(SAXParser, TransformStream);
-
-//TransformStream implementation
-SAXParser.prototype._transform = function (chunk, encoding, callback) {
- if (!this.stopped) {
- this.tokenizer.write(chunk.toString('utf8'), this.lastChunkWritten);
- this._runParsingLoop();
- }
-
- this.push(chunk);
-
- callback();
-};
-
-SAXParser.prototype._flush = function (callback) {
- callback();
-};
-
-SAXParser.prototype.end = function (chunk, encoding, callback) {
- this.lastChunkWritten = true;
- TransformStream.prototype.end.call(this, chunk, encoding, callback);
-};
-
-/**
- * Stops parsing. Useful if you want the parser to stop consuming CPU time once you've obtained the desired info
- * from the input stream. Doesn't prevent piping, so that data will flow through the parser as usual.
- *
- * @function stop
- * @memberof parse5#SAXParser
- * @instance
- * @example
- * var parse5 = require('parse5');
- * var http = require('http');
- * var fs = require('fs');
- *
- * var file = fs.createWriteStream('/home/google.com.html');
- * var parser = new parse5.SAXParser();
- *
- * parser.on('doctype', function(name, publicId, systemId) {
- * // Process doctype info ans stop parsing
- * ...
- * parser.stop();
- * });
- *
- * http.get('http://google.com', function(res) {
- * // Despite the fact that parser.stop() was called whole
- * // content of the page will be written to the file
- * res.pipe(parser).pipe(file);
- * });
- */
-SAXParser.prototype.stop = function () {
- this.stopped = true;
-};
-
-//Internals
-SAXParser.prototype._runParsingLoop = function () {
- do {
- var token = this.parserFeedbackSimulator.getNextToken();
-
- if (token.type === Tokenizer.HIBERNATION_TOKEN)
- break;
-
- if (token.type === Tokenizer.CHARACTER_TOKEN ||
- token.type === Tokenizer.WHITESPACE_CHARACTER_TOKEN ||
- token.type === Tokenizer.NULL_CHARACTER_TOKEN) {
-
- if (this.options.locationInfo) {
- if (this.pendingText === null)
- this.currentTokenLocation = token.location;
-
- else
- this.currentTokenLocation.endOffset = token.location.endOffset;
- }
-
- this.pendingText = (this.pendingText || '') + token.chars;
- }
-
- else {
- this._emitPendingText();
- this._handleToken(token);
- }
- } while (!this.stopped && token.type !== Tokenizer.EOF_TOKEN);
-};
-
-SAXParser.prototype._handleToken = function (token) {
- if (this.options.locationInfo)
- this.currentTokenLocation = token.location;
-
- if (token.type === Tokenizer.START_TAG_TOKEN)
- /**
- * Raised when the parser encounters a start tag.
- * @event startTag
- * @memberof parse5#SAXParser
- * @instance
- * @type {Function}
- * @param {String} name - Tag name.
- * @param {Array} attrs - List of attributes in the `{ name: String, value: String, prefix?: String }` form.
- * @param {Boolean} selfClosing - Indicates if the tag is self-closing.
- * @param {StartTagLocationInfo} [location] - Start tag source code location info.
- * Available if location info is enabled in {@link SAXParserOptions}.
- */
- this.emit('startTag', token.tagName, token.attrs, token.selfClosing, this.currentTokenLocation);
-
- else if (token.type === Tokenizer.END_TAG_TOKEN)
- /**
- * Raised then parser encounters an end tag.
- * @event endTag
- * @memberof parse5#SAXParser
- * @instance
- * @type {Function}
- * @param {String} name - Tag name.
- * @param {LocationInfo} [location] - End tag source code location info.
- * Available if location info is enabled in {@link SAXParserOptions}.
- */
- this.emit('endTag', token.tagName, this.currentTokenLocation);
-
- else if (token.type === Tokenizer.COMMENT_TOKEN)
- /**
- * Raised then parser encounters a comment.
- * @event comment
- * @memberof parse5#SAXParser
- * @instance
- * @type {Function}
- * @param {String} text - Comment text.
- * @param {LocationInfo} [location] - Comment source code location info.
- * Available if location info is enabled in {@link SAXParserOptions}.
- */
- this.emit('comment', token.data, this.currentTokenLocation);
-
- else if (token.type === Tokenizer.DOCTYPE_TOKEN)
- /**
- * Raised then parser encounters a [document type declaration]{@link https://en.wikipedia.org/wiki/Document_type_declaration}.
- * @event doctype
- * @memberof parse5#SAXParser
- * @instance
- * @type {Function}
- * @param {String} name - Document type name.
- * @param {String} publicId - Document type public identifier.
- * @param {String} systemId - Document type system identifier.
- * @param {LocationInfo} [location] - Document type declaration source code location info.
- * Available if location info is enabled in {@link SAXParserOptions}.
- */
- this.emit('doctype', token.name, token.publicId, token.systemId, this.currentTokenLocation);
-};
-
-SAXParser.prototype._emitPendingText = function () {
- if (this.pendingText !== null) {
- /**
- * Raised then parser encounters text content.
- * @event text
- * @memberof parse5#SAXParser
- * @instance
- * @type {Function}
- * @param {String} text - Text content.
- * @param {LocationInfo} [location] - Text content code location info.
- * Available if location info is enabled in {@link SAXParserOptions}.
- */
- this.emit('text', this.pendingText, this.currentTokenLocation);
- this.pendingText = null;
- }
-};
diff --git a/tools/eslint/node_modules/parse5/lib/sax/parser_feedback_simulator.js b/tools/eslint/node_modules/parse5/lib/sax/parser_feedback_simulator.js
deleted file mode 100644
index db51623ee6..0000000000
--- a/tools/eslint/node_modules/parse5/lib/sax/parser_feedback_simulator.js
+++ /dev/null
@@ -1,153 +0,0 @@
-'use strict';
-
-var Tokenizer = require('../tokenizer'),
- foreignContent = require('../common/foreign_content'),
- UNICODE = require('../common/unicode'),
- HTML = require('../common/html');
-
-
-//Aliases
-var $ = HTML.TAG_NAMES,
- NS = HTML.NAMESPACES;
-
-
-//ParserFeedbackSimulator
-//Simulates adjustment of the Tokenizer which performed by standard parser during tree construction.
-var ParserFeedbackSimulator = module.exports = function (tokenizer) {
- this.tokenizer = tokenizer;
-
- this.namespaceStack = [];
- this.namespaceStackTop = -1;
- this._enterNamespace(NS.HTML);
-};
-
-ParserFeedbackSimulator.prototype.getNextToken = function () {
- var token = this.tokenizer.getNextToken();
-
- if (token.type === Tokenizer.START_TAG_TOKEN)
- this._handleStartTagToken(token);
-
- else if (token.type === Tokenizer.END_TAG_TOKEN)
- this._handleEndTagToken(token);
-
- else if (token.type === Tokenizer.NULL_CHARACTER_TOKEN && this.inForeignContent) {
- token.type = Tokenizer.CHARACTER_TOKEN;
- token.chars = UNICODE.REPLACEMENT_CHARACTER;
- }
-
- else if (this.skipNextNewLine) {
- if (token.type !== Tokenizer.HIBERNATION_TOKEN)
- this.skipNextNewLine = false;
-
- if (token.type === Tokenizer.WHITESPACE_CHARACTER_TOKEN && token.chars[0] === '\n') {
- if (token.chars.length === 1)
- return this.getNextToken();
-
- token.chars = token.chars.substr(1);
- }
- }
-
- return token;
-};
-
-//Namespace stack mutations
-ParserFeedbackSimulator.prototype._enterNamespace = function (namespace) {
- this.namespaceStackTop++;
- this.namespaceStack.push(namespace);
-
- this.inForeignContent = namespace !== NS.HTML;
- this.currentNamespace = namespace;
- this.tokenizer.allowCDATA = this.inForeignContent;
-};
-
-ParserFeedbackSimulator.prototype._leaveCurrentNamespace = function () {
- this.namespaceStackTop--;
- this.namespaceStack.pop();
-
- this.currentNamespace = this.namespaceStack[this.namespaceStackTop];
- this.inForeignContent = this.currentNamespace !== NS.HTML;
- this.tokenizer.allowCDATA = this.inForeignContent;
-};
-
-//Token handlers
-ParserFeedbackSimulator.prototype._ensureTokenizerMode = function (tn) {
- if (tn === $.TEXTAREA || tn === $.TITLE)
- this.tokenizer.state = Tokenizer.MODE.RCDATA;
-
- else if (tn === $.PLAINTEXT)
- this.tokenizer.state = Tokenizer.MODE.PLAINTEXT;
-
- else if (tn === $.SCRIPT)
- this.tokenizer.state = Tokenizer.MODE.SCRIPT_DATA;
-
- else if (tn === $.STYLE || tn === $.IFRAME || tn === $.XMP ||
- tn === $.NOEMBED || tn === $.NOFRAMES || tn === $.NOSCRIPT)
- this.tokenizer.state = Tokenizer.MODE.RAWTEXT;
-};
-
-ParserFeedbackSimulator.prototype._handleStartTagToken = function (token) {
- var tn = token.tagName;
-
- if (tn === $.SVG)
- this._enterNamespace(NS.SVG);
-
- else if (tn === $.MATH)
- this._enterNamespace(NS.MATHML);
-
- if (this.inForeignContent) {
- if (foreignContent.causesExit(token)) {
- this._leaveCurrentNamespace();
- return;
- }
-
- var currentNs = this.currentNamespace;
-
- if (currentNs === NS.MATHML)
- foreignContent.adjustTokenMathMLAttrs(token);
-
- else if (currentNs === NS.SVG) {
- foreignContent.adjustTokenSVGTagName(token);
- foreignContent.adjustTokenSVGAttrs(token);
- }
-
- foreignContent.adjustTokenXMLAttrs(token);
-
- tn = token.tagName;
-
- if (!token.selfClosing && foreignContent.isIntegrationPoint(tn, currentNs, token.attrs))
- this._enterNamespace(NS.HTML);
- }
-
- else {
- if (tn === $.PRE || tn === $.TEXTAREA || tn === $.LISTING)
- this.skipNextNewLine = true;
-
- else if (tn === $.IMAGE)
- token.tagName = $.IMG;
-
- this._ensureTokenizerMode(tn);
- }
-};
-
-ParserFeedbackSimulator.prototype._handleEndTagToken = function (token) {
- var tn = token.tagName;
-
- if (!this.inForeignContent) {
- var previousNs = this.namespaceStack[this.namespaceStackTop - 1];
-
- if (previousNs === NS.SVG && foreignContent.SVG_TAG_NAMES_ADJUSTMENT_MAP[tn])
- tn = foreignContent.SVG_TAG_NAMES_ADJUSTMENT_MAP[tn];
-
- //NOTE: check for exit from integration point
- if (foreignContent.isIntegrationPoint(tn, previousNs, token.attrs))
- this._leaveCurrentNamespace();
- }
-
- else if (tn === $.SVG && this.currentNamespace === NS.SVG ||
- tn === $.MATH && this.currentNamespace === NS.MATHML)
- this._leaveCurrentNamespace();
-
- // NOTE: adjust end tag name as well for consistency
- if (this.currentNamespace === NS.SVG)
- foreignContent.adjustTokenSVGTagName(token);
-};
diff --git a/tools/eslint/node_modules/parse5/lib/serializer/index.js b/tools/eslint/node_modules/parse5/lib/serializer/index.js
deleted file mode 100644
index 4c0d8855f3..0000000000
--- a/tools/eslint/node_modules/parse5/lib/serializer/index.js
+++ /dev/null
@@ -1,180 +0,0 @@
-'use strict';
-
-var defaultTreeAdapter = require('../tree_adapters/default'),
- doctype = require('../common/doctype'),
- mergeOptions = require('../common/merge_options'),
- HTML = require('../common/html');
-
-//Aliases
-var $ = HTML.TAG_NAMES,
- NS = HTML.NAMESPACES;
-
-//Default serializer options
-/**
- * @typedef {Object} SerializerOptions
- *
- * @property {TreeAdapter} [treeAdapter=parse5.treeAdapters.default] - Specifies input tree format.
- */
-var DEFAULT_OPTIONS = {
- treeAdapter: defaultTreeAdapter
-};
-
-//Escaping regexes
-var AMP_REGEX = /&/g,
- NBSP_REGEX = /\u00a0/g,
- DOUBLE_QUOTE_REGEX = /"/g,
- LT_REGEX = /</g,
- GT_REGEX = />/g;
-
-//Serializer
-var Serializer = module.exports = function (node, options) {
- this.options = mergeOptions(DEFAULT_OPTIONS, options);
- this.treeAdapter = this.options.treeAdapter;
-
- this.html = '';
- this.startNode = node;
-};
-
-// NOTE: exported as static method for the testing purposes
-Serializer.escapeString = function (str, attrMode) {
- str = str
- .replace(AMP_REGEX, '&amp;')
- .replace(NBSP_REGEX, '&nbsp;');
-
- if (attrMode)
- str = str.replace(DOUBLE_QUOTE_REGEX, '&quot;');
-
- else {
- str = str
- .replace(LT_REGEX, '&lt;')
- .replace(GT_REGEX, '&gt;');
- }
-
- return str;
-};
-
-
-//API
-Serializer.prototype.serialize = function () {
- this._serializeChildNodes(this.startNode);
-
- return this.html;
-};
-
-
-//Internals
-Serializer.prototype._serializeChildNodes = function (parentNode) {
- var childNodes = this.treeAdapter.getChildNodes(parentNode);
-
- if (childNodes) {
- for (var i = 0, cnLength = childNodes.length; i < cnLength; i++) {
- var currentNode = childNodes[i];
-
- if (this.treeAdapter.isElementNode(currentNode))
- this._serializeElement(currentNode);
-
- else if (this.treeAdapter.isTextNode(currentNode))
- this._serializeTextNode(currentNode);
-
- else if (this.treeAdapter.isCommentNode(currentNode))
- this._serializeCommentNode(currentNode);
-
- else if (this.treeAdapter.isDocumentTypeNode(currentNode))
- this._serializeDocumentTypeNode(currentNode);
- }
- }
-};
-
-Serializer.prototype._serializeElement = function (node) {
- var tn = this.treeAdapter.getTagName(node),
- ns = this.treeAdapter.getNamespaceURI(node);
-
- this.html += '<' + tn;
- this._serializeAttributes(node);
- this.html += '>';
-
- if (tn !== $.AREA && tn !== $.BASE && tn !== $.BASEFONT && tn !== $.BGSOUND && tn !== $.BR && tn !== $.BR &&
- tn !== $.COL && tn !== $.EMBED && tn !== $.FRAME && tn !== $.HR && tn !== $.IMG && tn !== $.INPUT &&
- tn !== $.KEYGEN && tn !== $.LINK && tn !== $.MENUITEM && tn !== $.META && tn !== $.PARAM && tn !== $.SOURCE &&
- tn !== $.TRACK && tn !== $.WBR) {
-
- if (tn === $.PRE || tn === $.TEXTAREA || tn === $.LISTING) {
- var firstChild = this.treeAdapter.getFirstChild(node);
-
- if (firstChild && this.treeAdapter.isTextNode(firstChild)) {
- var content = this.treeAdapter.getTextNodeContent(firstChild);
-
- if (content[0] === '\n')
- this.html += '\n';
- }
- }
-
- var childNodesHolder = tn === $.TEMPLATE && ns === NS.HTML ?
- this.treeAdapter.getTemplateContent(node) :
- node;
-
- this._serializeChildNodes(childNodesHolder);
- this.html += '</' + tn + '>';
- }
-};
-
-Serializer.prototype._serializeAttributes = function (node) {
- var attrs = this.treeAdapter.getAttrList(node);
-
- for (var i = 0, attrsLength = attrs.length; i < attrsLength; i++) {
- var attr = attrs[i],
- value = Serializer.escapeString(attr.value, true);
-
- this.html += ' ';
-
- if (!attr.namespace)
- this.html += attr.name;
-
- else if (attr.namespace === NS.XML)
- this.html += 'xml:' + attr.name;
-
- else if (attr.namespace === NS.XMLNS) {
- if (attr.name !== 'xmlns')
- this.html += 'xmlns:';
-
- this.html += attr.name;
- }
-
- else if (attr.namespace === NS.XLINK)
- this.html += 'xlink:' + attr.name;
-
- else
- this.html += attr.namespace + ':' + attr.name;
-
- this.html += '="' + value + '"';
- }
-};
-
-Serializer.prototype._serializeTextNode = function (node) {
- var content = this.treeAdapter.getTextNodeContent(node),
- parent = this.treeAdapter.getParentNode(node),
- parentTn = void 0;
-
- if (parent && this.treeAdapter.isElementNode(parent))
- parentTn = this.treeAdapter.getTagName(parent);
-
- if (parentTn === $.STYLE || parentTn === $.SCRIPT || parentTn === $.XMP || parentTn === $.IFRAME ||
- parentTn === $.NOEMBED || parentTn === $.NOFRAMES || parentTn === $.PLAINTEXT || parentTn === $.NOSCRIPT)
-
- this.html += content;
-
- else
- this.html += Serializer.escapeString(content, false);
-};
-
-Serializer.prototype._serializeCommentNode = function (node) {
- this.html += '<!--' + this.treeAdapter.getCommentNodeContent(node) + '-->';
-};
-
-Serializer.prototype._serializeDocumentTypeNode = function (node) {
- var name = this.treeAdapter.getDocumentTypeNodeName(node),
- publicId = this.treeAdapter.getDocumentTypeNodePublicId(node),
- systemId = this.treeAdapter.getDocumentTypeNodeSystemId(node);
-
- this.html += '<' + doctype.serializeContent(name, publicId, systemId) + '>';
-};
diff --git a/tools/eslint/node_modules/parse5/lib/serializer/stream.js b/tools/eslint/node_modules/parse5/lib/serializer/stream.js
deleted file mode 100644
index 304b28d24b..0000000000
--- a/tools/eslint/node_modules/parse5/lib/serializer/stream.js
+++ /dev/null
@@ -1,49 +0,0 @@
-'use strict';
-
-var ReadableStream = require('stream').Readable,
- inherits = require('util').inherits,
- Serializer = require('./index');
-
-/**
- * Streaming AST node to an HTML serializer.
- * A [readable stream]{@link https://nodejs.org/api/stream.html#stream_class_stream_readable}.
- * @class SerializerStream
- * @memberof parse5
- * @instance
- * @extends stream.Readable
- * @param {ASTNode} node - Node to serialize.
- * @param {SerializerOptions} [options] - Serialization options.
- * @example
- * var parse5 = require('parse5');
- * var fs = require('fs');
- *
- * var file = fs.createWriteStream('/home/index.html');
- *
- * // Serializes the parsed document to HTML and writes it to the file.
- * var document = parse5.parse('<body>Who is John Galt?</body>');
- * var serializer = new parse5.SerializerStream(document);
- *
- * serializer.pipe(file);
- */
-var SerializerStream = module.exports = function (node, options) {
- ReadableStream.call(this);
-
- this.serializer = new Serializer(node, options);
-
- Object.defineProperty(this.serializer, 'html', {
- //NOTE: To make `+=` concat operator work properly we define
- //getter which always returns empty string
- get: function () {
- return '';
- },
- set: this.push.bind(this)
- });
-};
-
-inherits(SerializerStream, ReadableStream);
-
-//Readable stream implementation
-SerializerStream.prototype._read = function () {
- this.serializer.serialize();
- this.push(null);
-};
diff --git a/tools/eslint/node_modules/parse5/lib/tokenizer/index.js b/tools/eslint/node_modules/parse5/lib/tokenizer/index.js
deleted file mode 100644
index d107151aa1..0000000000
--- a/tools/eslint/node_modules/parse5/lib/tokenizer/index.js
+++ /dev/null
@@ -1,2101 +0,0 @@
-'use strict';
-
-var Preprocessor = require('./preprocessor'),
- locationInfoMixin = require('../location_info/tokenizer_mixin'),
- UNICODE = require('../common/unicode'),
- NAMED_ENTITY_TRIE = require('./named_entity_trie');
-
-//Aliases
-var $ = UNICODE.CODE_POINTS,
- $$ = UNICODE.CODE_POINT_SEQUENCES;
-
-//Replacement code points for numeric entities
-var NUMERIC_ENTITY_REPLACEMENTS = {
- 0x00: 0xFFFD, 0x0D: 0x000D, 0x80: 0x20AC, 0x81: 0x0081, 0x82: 0x201A, 0x83: 0x0192, 0x84: 0x201E,
- 0x85: 0x2026, 0x86: 0x2020, 0x87: 0x2021, 0x88: 0x02C6, 0x89: 0x2030, 0x8A: 0x0160, 0x8B: 0x2039,
- 0x8C: 0x0152, 0x8D: 0x008D, 0x8E: 0x017D, 0x8F: 0x008F, 0x90: 0x0090, 0x91: 0x2018, 0x92: 0x2019,
- 0x93: 0x201C, 0x94: 0x201D, 0x95: 0x2022, 0x96: 0x2013, 0x97: 0x2014, 0x98: 0x02DC, 0x99: 0x2122,
- 0x9A: 0x0161, 0x9B: 0x203A, 0x9C: 0x0153, 0x9D: 0x009D, 0x9E: 0x017E, 0x9F: 0x0178
-};
-
-//States
-var DATA_STATE = 'DATA_STATE',
- CHARACTER_REFERENCE_IN_DATA_STATE = 'CHARACTER_REFERENCE_IN_DATA_STATE',
- RCDATA_STATE = 'RCDATA_STATE',
- CHARACTER_REFERENCE_IN_RCDATA_STATE = 'CHARACTER_REFERENCE_IN_RCDATA_STATE',
- RAWTEXT_STATE = 'RAWTEXT_STATE',
- SCRIPT_DATA_STATE = 'SCRIPT_DATA_STATE',
- PLAINTEXT_STATE = 'PLAINTEXT_STATE',
- TAG_OPEN_STATE = 'TAG_OPEN_STATE',
- END_TAG_OPEN_STATE = 'END_TAG_OPEN_STATE',
- TAG_NAME_STATE = 'TAG_NAME_STATE',
- RCDATA_LESS_THAN_SIGN_STATE = 'RCDATA_LESS_THAN_SIGN_STATE',
- RCDATA_END_TAG_OPEN_STATE = 'RCDATA_END_TAG_OPEN_STATE',
- RCDATA_END_TAG_NAME_STATE = 'RCDATA_END_TAG_NAME_STATE',
- RAWTEXT_LESS_THAN_SIGN_STATE = 'RAWTEXT_LESS_THAN_SIGN_STATE',
- RAWTEXT_END_TAG_OPEN_STATE = 'RAWTEXT_END_TAG_OPEN_STATE',
- RAWTEXT_END_TAG_NAME_STATE = 'RAWTEXT_END_TAG_NAME_STATE',
- SCRIPT_DATA_LESS_THAN_SIGN_STATE = 'SCRIPT_DATA_LESS_THAN_SIGN_STATE',
- SCRIPT_DATA_END_TAG_OPEN_STATE = 'SCRIPT_DATA_END_TAG_OPEN_STATE',
- SCRIPT_DATA_END_TAG_NAME_STATE = 'SCRIPT_DATA_END_TAG_NAME_STATE',
- SCRIPT_DATA_ESCAPE_START_STATE = 'SCRIPT_DATA_ESCAPE_START_STATE',
- SCRIPT_DATA_ESCAPE_START_DASH_STATE = 'SCRIPT_DATA_ESCAPE_START_DASH_STATE',
- SCRIPT_DATA_ESCAPED_STATE = 'SCRIPT_DATA_ESCAPED_STATE',
- SCRIPT_DATA_ESCAPED_DASH_STATE = 'SCRIPT_DATA_ESCAPED_DASH_STATE',
- SCRIPT_DATA_ESCAPED_DASH_DASH_STATE = 'SCRIPT_DATA_ESCAPED_DASH_DASH_STATE',
- SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE = 'SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE',
- SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE = 'SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE',
- SCRIPT_DATA_ESCAPED_END_TAG_NAME_STATE = 'SCRIPT_DATA_ESCAPED_END_TAG_NAME_STATE',
- SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE = 'SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE',
- SCRIPT_DATA_DOUBLE_ESCAPED_STATE = 'SCRIPT_DATA_DOUBLE_ESCAPED_STATE',
- SCRIPT_DATA_DOUBLE_ESCAPED_DASH_STATE = 'SCRIPT_DATA_DOUBLE_ESCAPED_DASH_STATE',
- SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH_STATE = 'SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH_STATE',
- SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE = 'SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE',
- SCRIPT_DATA_DOUBLE_ESCAPE_END_STATE = 'SCRIPT_DATA_DOUBLE_ESCAPE_END_STATE',
- BEFORE_ATTRIBUTE_NAME_STATE = 'BEFORE_ATTRIBUTE_NAME_STATE',
- ATTRIBUTE_NAME_STATE = 'ATTRIBUTE_NAME_STATE',
- AFTER_ATTRIBUTE_NAME_STATE = 'AFTER_ATTRIBUTE_NAME_STATE',
- BEFORE_ATTRIBUTE_VALUE_STATE = 'BEFORE_ATTRIBUTE_VALUE_STATE',
- ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE = 'ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE',
- ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE = 'ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE',
- ATTRIBUTE_VALUE_UNQUOTED_STATE = 'ATTRIBUTE_VALUE_UNQUOTED_STATE',
- CHARACTER_REFERENCE_IN_ATTRIBUTE_VALUE_STATE = 'CHARACTER_REFERENCE_IN_ATTRIBUTE_VALUE_STATE',
- AFTER_ATTRIBUTE_VALUE_QUOTED_STATE = 'AFTER_ATTRIBUTE_VALUE_QUOTED_STATE',
- SELF_CLOSING_START_TAG_STATE = 'SELF_CLOSING_START_TAG_STATE',
- BOGUS_COMMENT_STATE = 'BOGUS_COMMENT_STATE',
- BOGUS_COMMENT_STATE_CONTINUATION = 'BOGUS_COMMENT_STATE_CONTINUATION',
- MARKUP_DECLARATION_OPEN_STATE = 'MARKUP_DECLARATION_OPEN_STATE',
- COMMENT_START_STATE = 'COMMENT_START_STATE',
- COMMENT_START_DASH_STATE = 'COMMENT_START_DASH_STATE',
- COMMENT_STATE = 'COMMENT_STATE',
- COMMENT_END_DASH_STATE = 'COMMENT_END_DASH_STATE',
- COMMENT_END_STATE = 'COMMENT_END_STATE',
- COMMENT_END_BANG_STATE = 'COMMENT_END_BANG_STATE',
- DOCTYPE_STATE = 'DOCTYPE_STATE',
- DOCTYPE_NAME_STATE = 'DOCTYPE_NAME_STATE',
- AFTER_DOCTYPE_NAME_STATE = 'AFTER_DOCTYPE_NAME_STATE',
- BEFORE_DOCTYPE_PUBLIC_IDENTIFIER_STATE = 'BEFORE_DOCTYPE_PUBLIC_IDENTIFIER_STATE',
- DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED_STATE = 'DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED_STATE',
- DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED_STATE = 'DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED_STATE',
- BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS_STATE = 'BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS_STATE',
- BEFORE_DOCTYPE_SYSTEM_IDENTIFIER_STATE = 'BEFORE_DOCTYPE_SYSTEM_IDENTIFIER_STATE',
- DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE = 'DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE',
- DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE = 'DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE',
- AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE = 'AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE',
- BOGUS_DOCTYPE_STATE = 'BOGUS_DOCTYPE_STATE',
- CDATA_SECTION_STATE = 'CDATA_SECTION_STATE';
-
-//Utils
-
-//OPTIMIZATION: these utility functions should not be moved out of this module. V8 Crankshaft will not inline
-//this functions if they will be situated in another module due to context switch.
-//Always perform inlining check before modifying this functions ('node --trace-inlining').
-function isWhitespace(cp) {
- return cp === $.SPACE || cp === $.LINE_FEED || cp === $.TABULATION || cp === $.FORM_FEED;
-}
-
-function isAsciiDigit(cp) {
- return cp >= $.DIGIT_0 && cp <= $.DIGIT_9;
-}
-
-function isAsciiUpper(cp) {
- return cp >= $.LATIN_CAPITAL_A && cp <= $.LATIN_CAPITAL_Z;
-}
-
-function isAsciiLower(cp) {
- return cp >= $.LATIN_SMALL_A && cp <= $.LATIN_SMALL_Z;
-}
-
-function isAsciiLetter(cp) {
- return isAsciiLower(cp) || isAsciiUpper(cp);
-}
-
-function isAsciiAlphaNumeric(cp) {
- return isAsciiLetter(cp) || isAsciiDigit(cp);
-}
-
-function isDigit(cp, isHex) {
- return isAsciiDigit(cp) || isHex && (cp >= $.LATIN_CAPITAL_A && cp <= $.LATIN_CAPITAL_F ||
- cp >= $.LATIN_SMALL_A && cp <= $.LATIN_SMALL_F);
-}
-
-function isReservedCodePoint(cp) {
- return cp >= 0xD800 && cp <= 0xDFFF || cp > 0x10FFFF;
-}
-
-function toAsciiLowerCodePoint(cp) {
- return cp + 0x0020;
-}
-
-//NOTE: String.fromCharCode() function can handle only characters from BMP subset.
-//So, we need to workaround this manually.
-//(see: https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/fromCharCode#Getting_it_to_work_with_higher_values)
-function toChar(cp) {
- if (cp <= 0xFFFF)
- return String.fromCharCode(cp);
-
- cp -= 0x10000;
- return String.fromCharCode(cp >>> 10 & 0x3FF | 0xD800) + String.fromCharCode(0xDC00 | cp & 0x3FF);
-}
-
-function toAsciiLowerChar(cp) {
- return String.fromCharCode(toAsciiLowerCodePoint(cp));
-}
-
-//Tokenizer
-var Tokenizer = module.exports = function (options) {
- this.preprocessor = new Preprocessor();
-
- this.tokenQueue = [];
-
- this.allowCDATA = false;
-
- this.state = DATA_STATE;
- this.returnState = '';
-
- this.tempBuff = [];
- this.additionalAllowedCp = void 0;
- this.lastStartTagName = '';
-
- this.consumedAfterSnapshot = -1;
- this.active = false;
-
- this.currentCharacterToken = null;
- this.currentToken = null;
- this.currentAttr = null;
-
- if (options && options.locationInfo)
- locationInfoMixin.assign(this);
-};
-
-//Token types
-Tokenizer.CHARACTER_TOKEN = 'CHARACTER_TOKEN';
-Tokenizer.NULL_CHARACTER_TOKEN = 'NULL_CHARACTER_TOKEN';
-Tokenizer.WHITESPACE_CHARACTER_TOKEN = 'WHITESPACE_CHARACTER_TOKEN';
-Tokenizer.START_TAG_TOKEN = 'START_TAG_TOKEN';
-Tokenizer.END_TAG_TOKEN = 'END_TAG_TOKEN';
-Tokenizer.COMMENT_TOKEN = 'COMMENT_TOKEN';
-Tokenizer.DOCTYPE_TOKEN = 'DOCTYPE_TOKEN';
-Tokenizer.EOF_TOKEN = 'EOF_TOKEN';
-Tokenizer.HIBERNATION_TOKEN = 'HIBERNATION_TOKEN';
-
-//Tokenizer initial states for different modes
-Tokenizer.MODE = Tokenizer.prototype.MODE = {
- DATA: DATA_STATE,
- RCDATA: RCDATA_STATE,
- RAWTEXT: RAWTEXT_STATE,
- SCRIPT_DATA: SCRIPT_DATA_STATE,
- PLAINTEXT: PLAINTEXT_STATE
-};
-
-//Static
-Tokenizer.getTokenAttr = function (token, attrName) {
- for (var i = token.attrs.length - 1; i >= 0; i--) {
- if (token.attrs[i].name === attrName)
- return token.attrs[i].value;
- }
-
- return null;
-};
-
-//API
-Tokenizer.prototype.getNextToken = function () {
- while (!this.tokenQueue.length && this.active) {
- this._hibernationSnapshot();
-
- var cp = this._consume();
-
- if (!this._ensureHibernation())
- this[this.state](cp);
- }
-
- return this.tokenQueue.shift();
-};
-
-Tokenizer.prototype.write = function (chunk, isLastChunk) {
- this.active = true;
- this.preprocessor.write(chunk, isLastChunk);
-};
-
-Tokenizer.prototype.insertHtmlAtCurrentPos = function (chunk) {
- this.active = true;
- this.preprocessor.insertHtmlAtCurrentPos(chunk);
-};
-
-//Hibernation
-Tokenizer.prototype._hibernationSnapshot = function () {
- this.consumedAfterSnapshot = 0;
-};
-
-Tokenizer.prototype._ensureHibernation = function () {
- if (this.preprocessor.endOfChunkHit) {
- for (; this.consumedAfterSnapshot > 0; this.consumedAfterSnapshot--)
- this.preprocessor.retreat();
-
- this.active = false;
- this.tokenQueue.push({type: Tokenizer.HIBERNATION_TOKEN});
-
- return true;
- }
-
- return false;
-};
-
-
-//Consumption
-Tokenizer.prototype._consume = function () {
- this.consumedAfterSnapshot++;
- return this.preprocessor.advance();
-};
-
-Tokenizer.prototype._unconsume = function () {
- this.consumedAfterSnapshot--;
- this.preprocessor.retreat();
-};
-
-Tokenizer.prototype._unconsumeSeveral = function (count) {
- while (count--)
- this._unconsume();
-};
-
-Tokenizer.prototype._reconsumeInState = function (state) {
- this.state = state;
- this._unconsume();
-};
-
-Tokenizer.prototype._consumeSubsequentIfMatch = function (pattern, startCp, caseSensitive) {
- var consumedCount = 0,
- isMatch = true,
- patternLength = pattern.length,
- patternPos = 0,
- cp = startCp,
- patternCp = void 0;
-
- for (; patternPos < patternLength; patternPos++) {
- if (patternPos > 0) {
- cp = this._consume();
- consumedCount++;
- }
-
- if (cp === $.EOF) {
- isMatch = false;
- break;
- }
-
- patternCp = pattern[patternPos];
-
- if (cp !== patternCp && (caseSensitive || cp !== toAsciiLowerCodePoint(patternCp))) {
- isMatch = false;
- break;
- }
- }
-
- if (!isMatch)
- this._unconsumeSeveral(consumedCount);
-
- return isMatch;
-};
-
-//Lookahead
-Tokenizer.prototype._lookahead = function () {
- var cp = this._consume();
-
- this._unconsume();
-
- return cp;
-};
-
-//Temp buffer
-Tokenizer.prototype.isTempBufferEqualToScriptString = function () {
- if (this.tempBuff.length !== $$.SCRIPT_STRING.length)
- return false;
-
- for (var i = 0; i < this.tempBuff.length; i++) {
- if (this.tempBuff[i] !== $$.SCRIPT_STRING[i])
- return false;
- }
-
- return true;
-};
-
-//Token creation
-Tokenizer.prototype._createStartTagToken = function () {
- this.currentToken = {
- type: Tokenizer.START_TAG_TOKEN,
- tagName: '',
- selfClosing: false,
- attrs: []
- };
-};
-
-Tokenizer.prototype._createEndTagToken = function () {
- this.currentToken = {
- type: Tokenizer.END_TAG_TOKEN,
- tagName: '',
- attrs: []
- };
-};
-
-Tokenizer.prototype._createCommentToken = function () {
- this.currentToken = {
- type: Tokenizer.COMMENT_TOKEN,
- data: ''
- };
-};
-
-Tokenizer.prototype._createDoctypeToken = function (initialName) {
- this.currentToken = {
- type: Tokenizer.DOCTYPE_TOKEN,
- name: initialName,
- forceQuirks: false,
- publicId: null,
- systemId: null
- };
-};
-
-Tokenizer.prototype._createCharacterToken = function (type, ch) {
- this.currentCharacterToken = {
- type: type,
- chars: ch
- };
-};
-
-//Tag attributes
-Tokenizer.prototype._createAttr = function (attrNameFirstCh) {
- this.currentAttr = {
- name: attrNameFirstCh,
- value: ''
- };
-};
-
-Tokenizer.prototype._isDuplicateAttr = function () {
- return Tokenizer.getTokenAttr(this.currentToken, this.currentAttr.name) !== null;
-};
-
-Tokenizer.prototype._leaveAttrName = function (toState) {
- this.state = toState;
-
- if (!this._isDuplicateAttr())
- this.currentToken.attrs.push(this.currentAttr);
-};
-
-Tokenizer.prototype._leaveAttrValue = function (toState) {
- this.state = toState;
-};
-
-//Appropriate end tag token
-//(see: http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html#appropriate-end-tag-token)
-Tokenizer.prototype._isAppropriateEndTagToken = function () {
- return this.lastStartTagName === this.currentToken.tagName;
-};
-
-//Token emission
-Tokenizer.prototype._emitCurrentToken = function () {
- this._emitCurrentCharacterToken();
-
- //NOTE: store emited start tag's tagName to determine is the following end tag token is appropriate.
- if (this.currentToken.type === Tokenizer.START_TAG_TOKEN)
- this.lastStartTagName = this.currentToken.tagName;
-
- this.tokenQueue.push(this.currentToken);
- this.currentToken = null;
-};
-
-Tokenizer.prototype._emitCurrentCharacterToken = function () {
- if (this.currentCharacterToken) {
- this.tokenQueue.push(this.currentCharacterToken);
- this.currentCharacterToken = null;
- }
-};
-
-Tokenizer.prototype._emitEOFToken = function () {
- this._emitCurrentCharacterToken();
- this.tokenQueue.push({type: Tokenizer.EOF_TOKEN});
-};
-
-//Characters emission
-
-//OPTIMIZATION: specification uses only one type of character tokens (one token per character).
-//This causes a huge memory overhead and a lot of unnecessary parser loops. parse5 uses 3 groups of characters.
-//If we have a sequence of characters that belong to the same group, parser can process it
-//as a single solid character token.
-//So, there are 3 types of character tokens in parse5:
-//1)NULL_CHARACTER_TOKEN - \u0000-character sequences (e.g. '\u0000\u0000\u0000')
-//2)WHITESPACE_CHARACTER_TOKEN - any whitespace/new-line character sequences (e.g. '\n \r\t \f')
-//3)CHARACTER_TOKEN - any character sequence which don't belong to groups 1 and 2 (e.g. 'abcdef1234@@#$%^')
-Tokenizer.prototype._appendCharToCurrentCharacterToken = function (type, ch) {
- if (this.currentCharacterToken && this.currentCharacterToken.type !== type)
- this._emitCurrentCharacterToken();
-
- if (this.currentCharacterToken)
- this.currentCharacterToken.chars += ch;
-
- else
- this._createCharacterToken(type, ch);
-};
-
-Tokenizer.prototype._emitCodePoint = function (cp) {
- var type = Tokenizer.CHARACTER_TOKEN;
-
- if (isWhitespace(cp))
- type = Tokenizer.WHITESPACE_CHARACTER_TOKEN;
-
- else if (cp === $.NULL)
- type = Tokenizer.NULL_CHARACTER_TOKEN;
-
- this._appendCharToCurrentCharacterToken(type, toChar(cp));
-};
-
-Tokenizer.prototype._emitSeveralCodePoints = function (codePoints) {
- for (var i = 0; i < codePoints.length; i++)
- this._emitCodePoint(codePoints[i]);
-};
-
-//NOTE: used then we emit character explicitly. This is always a non-whitespace and a non-null character.
-//So we can avoid additional checks here.
-Tokenizer.prototype._emitChar = function (ch) {
- this._appendCharToCurrentCharacterToken(Tokenizer.CHARACTER_TOKEN, ch);
-};
-
-//Character reference tokenization
-Tokenizer.prototype._consumeNumericEntity = function (isHex) {
- var digits = '',
- nextCp = void 0;
-
- do {
- digits += toChar(this._consume());
- nextCp = this._lookahead();
- } while (nextCp !== $.EOF && isDigit(nextCp, isHex));
-
- if (this._lookahead() === $.SEMICOLON)
- this._consume();
-
- var referencedCp = parseInt(digits, isHex ? 16 : 10),
- replacement = NUMERIC_ENTITY_REPLACEMENTS[referencedCp];
-
- if (replacement)
- return replacement;
-
- if (isReservedCodePoint(referencedCp))
- return $.REPLACEMENT_CHARACTER;
-
- return referencedCp;
-};
-
-Tokenizer.prototype._consumeNamedEntity = function (startCp, inAttr) {
- var referencedCodePoints = null,
- entityCodePointsCount = 0,
- cp = startCp,
- leaf = NAMED_ENTITY_TRIE[cp],
- consumedCount = 1,
- semicolonTerminated = false;
-
- for (; leaf && cp !== $.EOF; cp = this._consume(), consumedCount++, leaf = leaf.l && leaf.l[cp]) {
- if (leaf.c) {
- //NOTE: we have at least one named reference match. But we don't stop lookup at this point,
- //because longer matches still can be found (e.g. '&not' and '&notin;') except the case
- //then found match is terminated by semicolon.
- referencedCodePoints = leaf.c;
- entityCodePointsCount = consumedCount;
-
- if (cp === $.SEMICOLON) {
- semicolonTerminated = true;
- break;
- }
- }
- }
-
- if (referencedCodePoints) {
- if (!semicolonTerminated) {
- //NOTE: unconsume excess (e.g. 'it' in '&notit')
- this._unconsumeSeveral(consumedCount - entityCodePointsCount);
-
- //NOTE: If the character reference is being consumed as part of an attribute and the next character
- //is either a U+003D EQUALS SIGN character (=) or an alphanumeric ASCII character, then, for historical
- //reasons, all the characters that were matched after the U+0026 AMPERSAND character (&) must be
- //unconsumed, and nothing is returned.
- //However, if this next character is in fact a U+003D EQUALS SIGN character (=), then this is a
- //parse error, because some legacy user agents will misinterpret the markup in those cases.
- //(see: http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html#tokenizing-character-references)
- if (inAttr) {
- var nextCp = this._lookahead();
-
- if (nextCp === $.EQUALS_SIGN || isAsciiAlphaNumeric(nextCp)) {
- this._unconsumeSeveral(entityCodePointsCount);
- return null;
- }
- }
- }
-
- return referencedCodePoints;
- }
-
- this._unconsumeSeveral(consumedCount);
-
- return null;
-};
-
-Tokenizer.prototype._consumeCharacterReference = function (startCp, inAttr) {
- if (isWhitespace(startCp) || startCp === $.GREATER_THAN_SIGN ||
- startCp === $.AMPERSAND || startCp === this.additionalAllowedCp || startCp === $.EOF) {
- //NOTE: not a character reference. No characters are consumed, and nothing is returned.
- this._unconsume();
- return null;
- }
-
- if (startCp === $.NUMBER_SIGN) {
- //NOTE: we have a numeric entity candidate, now we should determine if it's hex or decimal
- var isHex = false,
- nextCp = this._lookahead();
-
- if (nextCp === $.LATIN_SMALL_X || nextCp === $.LATIN_CAPITAL_X) {
- this._consume();
- isHex = true;
- }
-
- nextCp = this._lookahead();
-
- //NOTE: if we have at least one digit this is a numeric entity for sure, so we consume it
- if (nextCp !== $.EOF && isDigit(nextCp, isHex))
- return [this._consumeNumericEntity(isHex)];
-
- //NOTE: otherwise this is a bogus number entity and a parse error. Unconsume the number sign
- //and the 'x'-character if appropriate.
- this._unconsumeSeveral(isHex ? 2 : 1);
- return null;
- }
-
- return this._consumeNamedEntity(startCp, inAttr);
-};
-
-//State machine
-var _ = Tokenizer.prototype;
-
-//12.2.4.1 Data state
-//------------------------------------------------------------------
-_[DATA_STATE] = function dataState(cp) {
- this.preprocessor.dropParsedChunk();
-
- if (cp === $.AMPERSAND)
- this.state = CHARACTER_REFERENCE_IN_DATA_STATE;
-
- else if (cp === $.LESS_THAN_SIGN)
- this.state = TAG_OPEN_STATE;
-
- else if (cp === $.NULL)
- this._emitCodePoint(cp);
-
- else if (cp === $.EOF)
- this._emitEOFToken();
-
- else
- this._emitCodePoint(cp);
-};
-
-
-//12.2.4.2 Character reference in data state
-//------------------------------------------------------------------
-_[CHARACTER_REFERENCE_IN_DATA_STATE] = function characterReferenceInDataState(cp) {
- this.additionalAllowedCp = void 0;
-
- var referencedCodePoints = this._consumeCharacterReference(cp, false);
-
- if (!this._ensureHibernation()) {
- if (referencedCodePoints)
- this._emitSeveralCodePoints(referencedCodePoints);
-
- else
- this._emitChar('&');
-
- this.state = DATA_STATE;
- }
-};
-
-
-//12.2.4.3 RCDATA state
-//------------------------------------------------------------------
-_[RCDATA_STATE] = function rcdataState(cp) {
- this.preprocessor.dropParsedChunk();
-
- if (cp === $.AMPERSAND)
- this.state = CHARACTER_REFERENCE_IN_RCDATA_STATE;
-
- else if (cp === $.LESS_THAN_SIGN)
- this.state = RCDATA_LESS_THAN_SIGN_STATE;
-
- else if (cp === $.NULL)
- this._emitChar(UNICODE.REPLACEMENT_CHARACTER);
-
- else if (cp === $.EOF)
- this._emitEOFToken();
-
- else
- this._emitCodePoint(cp);
-};
-
-
-//12.2.4.4 Character reference in RCDATA state
-//------------------------------------------------------------------
-_[CHARACTER_REFERENCE_IN_RCDATA_STATE] = function characterReferenceInRcdataState(cp) {
- this.additionalAllowedCp = void 0;
-
- var referencedCodePoints = this._consumeCharacterReference(cp, false);
-
- if (!this._ensureHibernation()) {
- if (referencedCodePoints)
- this._emitSeveralCodePoints(referencedCodePoints);
-
- else
- this._emitChar('&');
-
- this.state = RCDATA_STATE;
- }
-};
-
-
-//12.2.4.5 RAWTEXT state
-//------------------------------------------------------------------
-_[RAWTEXT_STATE] = function rawtextState(cp) {
- this.preprocessor.dropParsedChunk();
-
- if (cp === $.LESS_THAN_SIGN)
- this.state = RAWTEXT_LESS_THAN_SIGN_STATE;
-
- else if (cp === $.NULL)
- this._emitChar(UNICODE.REPLACEMENT_CHARACTER);
-
- else if (cp === $.EOF)
- this._emitEOFToken();
-
- else
- this._emitCodePoint(cp);
-};
-
-
-//12.2.4.6 Script data state
-//------------------------------------------------------------------
-_[SCRIPT_DATA_STATE] = function scriptDataState(cp) {
- this.preprocessor.dropParsedChunk();
-
- if (cp === $.LESS_THAN_SIGN)
- this.state = SCRIPT_DATA_LESS_THAN_SIGN_STATE;
-
- else if (cp === $.NULL)
- this._emitChar(UNICODE.REPLACEMENT_CHARACTER);
-
- else if (cp === $.EOF)
- this._emitEOFToken();
-
- else
- this._emitCodePoint(cp);
-};
-
-
-//12.2.4.7 PLAINTEXT state
-//------------------------------------------------------------------
-_[PLAINTEXT_STATE] = function plaintextState(cp) {
- this.preprocessor.dropParsedChunk();
-
- if (cp === $.NULL)
- this._emitChar(UNICODE.REPLACEMENT_CHARACTER);
-
- else if (cp === $.EOF)
- this._emitEOFToken();
-
- else
- this._emitCodePoint(cp);
-};
-
-
-//12.2.4.8 Tag open state
-//------------------------------------------------------------------
-_[TAG_OPEN_STATE] = function tagOpenState(cp) {
- if (cp === $.EXCLAMATION_MARK)
- this.state = MARKUP_DECLARATION_OPEN_STATE;
-
- else if (cp === $.SOLIDUS)
- this.state = END_TAG_OPEN_STATE;
-
- else if (isAsciiLetter(cp)) {
- this._createStartTagToken();
- this._reconsumeInState(TAG_NAME_STATE);
- }
-
- else if (cp === $.QUESTION_MARK)
- this._reconsumeInState(BOGUS_COMMENT_STATE);
-
- else {
- this._emitChar('<');
- this._reconsumeInState(DATA_STATE);
- }
-};
-
-
-//12.2.4.9 End tag open state
-//------------------------------------------------------------------
-_[END_TAG_OPEN_STATE] = function endTagOpenState(cp) {
- if (isAsciiLetter(cp)) {
- this._createEndTagToken();
- this._reconsumeInState(TAG_NAME_STATE);
- }
-
- else if (cp === $.GREATER_THAN_SIGN)
- this.state = DATA_STATE;
-
- else if (cp === $.EOF) {
- this._reconsumeInState(DATA_STATE);
- this._emitChar('<');
- this._emitChar('/');
- }
-
- else
- this._reconsumeInState(BOGUS_COMMENT_STATE);
-};
-
-
-//12.2.4.10 Tag name state
-//------------------------------------------------------------------
-_[TAG_NAME_STATE] = function tagNameState(cp) {
- if (isWhitespace(cp))
- this.state = BEFORE_ATTRIBUTE_NAME_STATE;
-
- else if (cp === $.SOLIDUS)
- this.state = SELF_CLOSING_START_TAG_STATE;
-
- else if (cp === $.GREATER_THAN_SIGN) {
- this.state = DATA_STATE;
- this._emitCurrentToken();
- }
-
- else if (isAsciiUpper(cp))
- this.currentToken.tagName += toAsciiLowerChar(cp);
-
- else if (cp === $.NULL)
- this.currentToken.tagName += UNICODE.REPLACEMENT_CHARACTER;
-
- else if (cp === $.EOF)
- this._reconsumeInState(DATA_STATE);
-
- else
- this.currentToken.tagName += toChar(cp);
-};
-
-
-//12.2.4.11 RCDATA less-than sign state
-//------------------------------------------------------------------
-_[RCDATA_LESS_THAN_SIGN_STATE] = function rcdataLessThanSignState(cp) {
- if (cp === $.SOLIDUS) {
- this.tempBuff = [];
- this.state = RCDATA_END_TAG_OPEN_STATE;
- }
-
- else {
- this._emitChar('<');
- this._reconsumeInState(RCDATA_STATE);
- }
-};
-
-
-//12.2.4.12 RCDATA end tag open state
-//------------------------------------------------------------------
-_[RCDATA_END_TAG_OPEN_STATE] = function rcdataEndTagOpenState(cp) {
- if (isAsciiLetter(cp)) {
- this._createEndTagToken();
- this._reconsumeInState(RCDATA_END_TAG_NAME_STATE);
- }
-
- else {
- this._emitChar('<');
- this._emitChar('/');
- this._reconsumeInState(RCDATA_STATE);
- }
-};
-
-
-//12.2.4.13 RCDATA end tag name state
-//------------------------------------------------------------------
-_[RCDATA_END_TAG_NAME_STATE] = function rcdataEndTagNameState(cp) {
- if (isAsciiUpper(cp)) {
- this.currentToken.tagName += toAsciiLowerChar(cp);
- this.tempBuff.push(cp);
- }
-
- else if (isAsciiLower(cp)) {
- this.currentToken.tagName += toChar(cp);
- this.tempBuff.push(cp);
- }
-
- else {
- if (this._isAppropriateEndTagToken()) {
- if (isWhitespace(cp)) {
- this.state = BEFORE_ATTRIBUTE_NAME_STATE;
- return;
- }
-
- if (cp === $.SOLIDUS) {
- this.state = SELF_CLOSING_START_TAG_STATE;
- return;
- }
-
- if (cp === $.GREATER_THAN_SIGN) {
- this.state = DATA_STATE;
- this._emitCurrentToken();
- return;
- }
- }
-
- this._emitChar('<');
- this._emitChar('/');
- this._emitSeveralCodePoints(this.tempBuff);
- this._reconsumeInState(RCDATA_STATE);
- }
-};
-
-
-//12.2.4.14 RAWTEXT less-than sign state
-//------------------------------------------------------------------
-_[RAWTEXT_LESS_THAN_SIGN_STATE] = function rawtextLessThanSignState(cp) {
- if (cp === $.SOLIDUS) {
- this.tempBuff = [];
- this.state = RAWTEXT_END_TAG_OPEN_STATE;
- }
-
- else {
- this._emitChar('<');
- this._reconsumeInState(RAWTEXT_STATE);
- }
-};
-
-
-//12.2.4.15 RAWTEXT end tag open state
-//------------------------------------------------------------------
-_[RAWTEXT_END_TAG_OPEN_STATE] = function rawtextEndTagOpenState(cp) {
- if (isAsciiLetter(cp)) {
- this._createEndTagToken();
- this._reconsumeInState(RAWTEXT_END_TAG_NAME_STATE);
- }
-
- else {
- this._emitChar('<');
- this._emitChar('/');
- this._reconsumeInState(RAWTEXT_STATE);
- }
-};
-
-
-//12.2.4.16 RAWTEXT end tag name state
-//------------------------------------------------------------------
-_[RAWTEXT_END_TAG_NAME_STATE] = function rawtextEndTagNameState(cp) {
- if (isAsciiUpper(cp)) {
- this.currentToken.tagName += toAsciiLowerChar(cp);
- this.tempBuff.push(cp);
- }
-
- else if (isAsciiLower(cp)) {
- this.currentToken.tagName += toChar(cp);
- this.tempBuff.push(cp);
- }
-
- else {
- if (this._isAppropriateEndTagToken()) {
- if (isWhitespace(cp)) {
- this.state = BEFORE_ATTRIBUTE_NAME_STATE;
- return;
- }
-
- if (cp === $.SOLIDUS) {
- this.state = SELF_CLOSING_START_TAG_STATE;
- return;
- }
-
- if (cp === $.GREATER_THAN_SIGN) {
- this._emitCurrentToken();
- this.state = DATA_STATE;
- return;
- }
- }
-
- this._emitChar('<');
- this._emitChar('/');
- this._emitSeveralCodePoints(this.tempBuff);
- this._reconsumeInState(RAWTEXT_STATE);
- }
-};
-
-
-//12.2.4.17 Script data less-than sign state
-//------------------------------------------------------------------
-_[SCRIPT_DATA_LESS_THAN_SIGN_STATE] = function scriptDataLessThanSignState(cp) {
- if (cp === $.SOLIDUS) {
- this.tempBuff = [];
- this.state = SCRIPT_DATA_END_TAG_OPEN_STATE;
- }
-
- else if (cp === $.EXCLAMATION_MARK) {
- this.state = SCRIPT_DATA_ESCAPE_START_STATE;
- this._emitChar('<');
- this._emitChar('!');
- }
-
- else {
- this._emitChar('<');
- this._reconsumeInState(SCRIPT_DATA_STATE);
- }
-};
-
-
-//12.2.4.18 Script data end tag open state
-//------------------------------------------------------------------
-_[SCRIPT_DATA_END_TAG_OPEN_STATE] = function scriptDataEndTagOpenState(cp) {
- if (isAsciiLetter(cp)) {
- this._createEndTagToken();
- this._reconsumeInState(SCRIPT_DATA_END_TAG_NAME_STATE);
- }
-
- else {
- this._emitChar('<');
- this._emitChar('/');
- this._reconsumeInState(SCRIPT_DATA_STATE);
- }
-};
-
-
-//12.2.4.19 Script data end tag name state
-//------------------------------------------------------------------
-_[SCRIPT_DATA_END_TAG_NAME_STATE] = function scriptDataEndTagNameState(cp) {
- if (isAsciiUpper(cp)) {
- this.currentToken.tagName += toAsciiLowerChar(cp);
- this.tempBuff.push(cp);
- }
-
- else if (isAsciiLower(cp)) {
- this.currentToken.tagName += toChar(cp);
- this.tempBuff.push(cp);
- }
-
- else {
- if (this._isAppropriateEndTagToken()) {
- if (isWhitespace(cp)) {
- this.state = BEFORE_ATTRIBUTE_NAME_STATE;
- return;
- }
-
- else if (cp === $.SOLIDUS) {
- this.state = SELF_CLOSING_START_TAG_STATE;
- return;
- }
-
- else if (cp === $.GREATER_THAN_SIGN) {
- this._emitCurrentToken();
- this.state = DATA_STATE;
- return;
- }
- }
-
- this._emitChar('<');
- this._emitChar('/');
- this._emitSeveralCodePoints(this.tempBuff);
- this._reconsumeInState(SCRIPT_DATA_STATE);
- }
-};
-
-
-//12.2.4.20 Script data escape start state
-//------------------------------------------------------------------
-_[SCRIPT_DATA_ESCAPE_START_STATE] = function scriptDataEscapeStartState(cp) {
- if (cp === $.HYPHEN_MINUS) {
- this.state = SCRIPT_DATA_ESCAPE_START_DASH_STATE;
- this._emitChar('-');
- }
-
- else
- this._reconsumeInState(SCRIPT_DATA_STATE);
-};
-
-
-//12.2.4.21 Script data escape start dash state
-//------------------------------------------------------------------
-_[SCRIPT_DATA_ESCAPE_START_DASH_STATE] = function scriptDataEscapeStartDashState(cp) {
- if (cp === $.HYPHEN_MINUS) {
- this.state = SCRIPT_DATA_ESCAPED_DASH_DASH_STATE;
- this._emitChar('-');
- }
-
- else
- this._reconsumeInState(SCRIPT_DATA_STATE);
-};
-
-
-//12.2.4.22 Script data escaped state
-//------------------------------------------------------------------
-_[SCRIPT_DATA_ESCAPED_STATE] = function scriptDataEscapedState(cp) {
- if (cp === $.HYPHEN_MINUS) {
- this.state = SCRIPT_DATA_ESCAPED_DASH_STATE;
- this._emitChar('-');
- }
-
- else if (cp === $.LESS_THAN_SIGN)
- this.state = SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE;
-
- else if (cp === $.NULL)
- this._emitChar(UNICODE.REPLACEMENT_CHARACTER);
-
- else if (cp === $.EOF)
- this._reconsumeInState(DATA_STATE);
-
- else
- this._emitCodePoint(cp);
-};
-
-
-//12.2.4.23 Script data escaped dash state
-//------------------------------------------------------------------
-_[SCRIPT_DATA_ESCAPED_DASH_STATE] = function scriptDataEscapedDashState(cp) {
- if (cp === $.HYPHEN_MINUS) {
- this.state = SCRIPT_DATA_ESCAPED_DASH_DASH_STATE;
- this._emitChar('-');
- }
-
- else if (cp === $.LESS_THAN_SIGN)
- this.state = SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE;
-
- else if (cp === $.NULL) {
- this.state = SCRIPT_DATA_ESCAPED_STATE;
- this._emitChar(UNICODE.REPLACEMENT_CHARACTER);
- }
-
- else if (cp === $.EOF)
- this._reconsumeInState(DATA_STATE);
-
- else {
- this.state = SCRIPT_DATA_ESCAPED_STATE;
- this._emitCodePoint(cp);
- }
-};
-
-
-//12.2.4.24 Script data escaped dash dash state
-//------------------------------------------------------------------
-_[SCRIPT_DATA_ESCAPED_DASH_DASH_STATE] = function scriptDataEscapedDashDashState(cp) {
- if (cp === $.HYPHEN_MINUS)
- this._emitChar('-');
-
- else if (cp === $.LESS_THAN_SIGN)
- this.state = SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE;
-
- else if (cp === $.GREATER_THAN_SIGN) {
- this.state = SCRIPT_DATA_STATE;
- this._emitChar('>');
- }
-
- else if (cp === $.NULL) {
- this.state = SCRIPT_DATA_ESCAPED_STATE;
- this._emitChar(UNICODE.REPLACEMENT_CHARACTER);
- }
-
- else if (cp === $.EOF)
- this._reconsumeInState(DATA_STATE);
-
- else {
- this.state = SCRIPT_DATA_ESCAPED_STATE;
- this._emitCodePoint(cp);
- }
-};
-
-
-//12.2.4.25 Script data escaped less-than sign state
-//------------------------------------------------------------------
-_[SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE] = function scriptDataEscapedLessThanSignState(cp) {
- if (cp === $.SOLIDUS) {
- this.tempBuff = [];
- this.state = SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE;
- }
-
- else if (isAsciiLetter(cp)) {
- this.tempBuff = [];
- this._emitChar('<');
- this._reconsumeInState(SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE);
- }
-
- else {
- this._emitChar('<');
- this._reconsumeInState(SCRIPT_DATA_ESCAPED_STATE);
- }
-};
-
-
-//12.2.4.26 Script data escaped end tag open state
-//------------------------------------------------------------------
-_[SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE] = function scriptDataEscapedEndTagOpenState(cp) {
- if (isAsciiLetter(cp)) {
- this._createEndTagToken();
- this._reconsumeInState(SCRIPT_DATA_ESCAPED_END_TAG_NAME_STATE);
- }
-
- else {
- this._emitChar('<');
- this._emitChar('/');
- this._reconsumeInState(SCRIPT_DATA_ESCAPED_STATE);
- }
-};
-
-
-//12.2.4.27 Script data escaped end tag name state
-//------------------------------------------------------------------
-_[SCRIPT_DATA_ESCAPED_END_TAG_NAME_STATE] = function scriptDataEscapedEndTagNameState(cp) {
- if (isAsciiUpper(cp)) {
- this.currentToken.tagName += toAsciiLowerChar(cp);
- this.tempBuff.push(cp);
- }
-
- else if (isAsciiLower(cp)) {
- this.currentToken.tagName += toChar(cp);
- this.tempBuff.push(cp);
- }
-
- else {
- if (this._isAppropriateEndTagToken()) {
- if (isWhitespace(cp)) {
- this.state = BEFORE_ATTRIBUTE_NAME_STATE;
- return;
- }
-
- if (cp === $.SOLIDUS) {
- this.state = SELF_CLOSING_START_TAG_STATE;
- return;
- }
-
- if (cp === $.GREATER_THAN_SIGN) {
- this._emitCurrentToken();
- this.state = DATA_STATE;
- return;
- }
- }
-
- this._emitChar('<');
- this._emitChar('/');
- this._emitSeveralCodePoints(this.tempBuff);
- this._reconsumeInState(SCRIPT_DATA_ESCAPED_STATE);
- }
-};
-
-
-//12.2.4.28 Script data double escape start state
-//------------------------------------------------------------------
-_[SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE] = function scriptDataDoubleEscapeStartState(cp) {
- if (isWhitespace(cp) || cp === $.SOLIDUS || cp === $.GREATER_THAN_SIGN) {
- this.state = this.isTempBufferEqualToScriptString() ? SCRIPT_DATA_DOUBLE_ESCAPED_STATE : SCRIPT_DATA_ESCAPED_STATE;
- this._emitCodePoint(cp);
- }
-
- else if (isAsciiUpper(cp)) {
- this.tempBuff.push(toAsciiLowerCodePoint(cp));
- this._emitCodePoint(cp);
- }
-
- else if (isAsciiLower(cp)) {
- this.tempBuff.push(cp);
- this._emitCodePoint(cp);
- }
-
- else
- this._reconsumeInState(SCRIPT_DATA_ESCAPED_STATE);
-};
-
-
-//12.2.4.29 Script data double escaped state
-//------------------------------------------------------------------
-_[SCRIPT_DATA_DOUBLE_ESCAPED_STATE] = function scriptDataDoubleEscapedState(cp) {
- if (cp === $.HYPHEN_MINUS) {
- this.state = SCRIPT_DATA_DOUBLE_ESCAPED_DASH_STATE;
- this._emitChar('-');
- }
-
- else if (cp === $.LESS_THAN_SIGN) {
- this.state = SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE;
- this._emitChar('<');
- }
-
- else if (cp === $.NULL)
- this._emitChar(UNICODE.REPLACEMENT_CHARACTER);
-
- else if (cp === $.EOF)
- this._reconsumeInState(DATA_STATE);
-
- else
- this._emitCodePoint(cp);
-};
-
-
-//12.2.4.30 Script data double escaped dash state
-//------------------------------------------------------------------
-_[SCRIPT_DATA_DOUBLE_ESCAPED_DASH_STATE] = function scriptDataDoubleEscapedDashState(cp) {
- if (cp === $.HYPHEN_MINUS) {
- this.state = SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH_STATE;
- this._emitChar('-');
- }
-
- else if (cp === $.LESS_THAN_SIGN) {
- this.state = SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE;
- this._emitChar('<');
- }
-
- else if (cp === $.NULL) {
- this.state = SCRIPT_DATA_DOUBLE_ESCAPED_STATE;
- this._emitChar(UNICODE.REPLACEMENT_CHARACTER);
- }
-
- else if (cp === $.EOF)
- this._reconsumeInState(DATA_STATE);
-
- else {
- this.state = SCRIPT_DATA_DOUBLE_ESCAPED_STATE;
- this._emitCodePoint(cp);
- }
-};
-
-
-//12.2.4.31 Script data double escaped dash dash state
-//------------------------------------------------------------------
-_[SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH_STATE] = function scriptDataDoubleEscapedDashDashState(cp) {
- if (cp === $.HYPHEN_MINUS)
- this._emitChar('-');
-
- else if (cp === $.LESS_THAN_SIGN) {
- this.state = SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE;
- this._emitChar('<');
- }
-
- else if (cp === $.GREATER_THAN_SIGN) {
- this.state = SCRIPT_DATA_STATE;
- this._emitChar('>');
- }
-
- else if (cp === $.NULL) {
- this.state = SCRIPT_DATA_DOUBLE_ESCAPED_STATE;
- this._emitChar(UNICODE.REPLACEMENT_CHARACTER);
- }
-
- else if (cp === $.EOF)
- this._reconsumeInState(DATA_STATE);
-
- else {
- this.state = SCRIPT_DATA_DOUBLE_ESCAPED_STATE;
- this._emitCodePoint(cp);
- }
-};
-
-
-//12.2.4.32 Script data double escaped less-than sign state
-//------------------------------------------------------------------
-_[SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE] = function scriptDataDoubleEscapedLessThanSignState(cp) {
- if (cp === $.SOLIDUS) {
- this.tempBuff = [];
- this.state = SCRIPT_DATA_DOUBLE_ESCAPE_END_STATE;
- this._emitChar('/');
- }
-
- else
- this._reconsumeInState(SCRIPT_DATA_DOUBLE_ESCAPED_STATE);
-};
-
-
-//12.2.4.33 Script data double escape end state
-//------------------------------------------------------------------
-_[SCRIPT_DATA_DOUBLE_ESCAPE_END_STATE] = function scriptDataDoubleEscapeEndState(cp) {
- if (isWhitespace(cp) || cp === $.SOLIDUS || cp === $.GREATER_THAN_SIGN) {
- this.state = this.isTempBufferEqualToScriptString() ? SCRIPT_DATA_ESCAPED_STATE : SCRIPT_DATA_DOUBLE_ESCAPED_STATE;
-
- this._emitCodePoint(cp);
- }
-
- else if (isAsciiUpper(cp)) {
- this.tempBuff.push(toAsciiLowerCodePoint(cp));
- this._emitCodePoint(cp);
- }
-
- else if (isAsciiLower(cp)) {
- this.tempBuff.push(cp);
- this._emitCodePoint(cp);
- }
-
- else
- this._reconsumeInState(SCRIPT_DATA_DOUBLE_ESCAPED_STATE);
-};
-
-
-//12.2.4.34 Before attribute name state
-//------------------------------------------------------------------
-_[BEFORE_ATTRIBUTE_NAME_STATE] = function beforeAttributeNameState(cp) {
- if (isWhitespace(cp))
- return;
-
- if (cp === $.SOLIDUS || cp === $.GREATER_THAN_SIGN || cp === $.EOF)
- this._reconsumeInState(AFTER_ATTRIBUTE_NAME_STATE);
-
- else if (cp === $.EQUALS_SIGN) {
- this._createAttr('=');
- this.state = ATTRIBUTE_NAME_STATE;
- }
-
- else {
- this._createAttr('');
- this._reconsumeInState(ATTRIBUTE_NAME_STATE);
- }
-};
-
-
-//12.2.4.35 Attribute name state
-//------------------------------------------------------------------
-_[ATTRIBUTE_NAME_STATE] = function attributeNameState(cp) {
- if (isWhitespace(cp) || cp === $.SOLIDUS || cp === $.GREATER_THAN_SIGN || cp === $.EOF) {
- this._leaveAttrName(AFTER_ATTRIBUTE_NAME_STATE);
- this._unconsume();
- }
-
- else if (cp === $.EQUALS_SIGN)
- this._leaveAttrName(BEFORE_ATTRIBUTE_VALUE_STATE);
-
- else if (isAsciiUpper(cp))
- this.currentAttr.name += toAsciiLowerChar(cp);
-
- else if (cp === $.QUOTATION_MARK || cp === $.APOSTROPHE || cp === $.LESS_THAN_SIGN)
- this.currentAttr.name += toChar(cp);
-
- else if (cp === $.NULL)
- this.currentAttr.name += UNICODE.REPLACEMENT_CHARACTER;
-
- else
- this.currentAttr.name += toChar(cp);
-};
-
-
-//12.2.4.36 After attribute name state
-//------------------------------------------------------------------
-_[AFTER_ATTRIBUTE_NAME_STATE] = function afterAttributeNameState(cp) {
- if (isWhitespace(cp))
- return;
-
- if (cp === $.SOLIDUS)
- this.state = SELF_CLOSING_START_TAG_STATE;
-
- else if (cp === $.EQUALS_SIGN)
- this.state = BEFORE_ATTRIBUTE_VALUE_STATE;
-
- else if (cp === $.GREATER_THAN_SIGN) {
- this.state = DATA_STATE;
- this._emitCurrentToken();
- }
-
- else if (cp === $.EOF)
- this._reconsumeInState(DATA_STATE);
-
- else {
- this._createAttr('');
- this._reconsumeInState(ATTRIBUTE_NAME_STATE);
- }
-};
-
-
-//12.2.4.37 Before attribute value state
-//------------------------------------------------------------------
-_[BEFORE_ATTRIBUTE_VALUE_STATE] = function beforeAttributeValueState(cp) {
- if (isWhitespace(cp))
- return;
-
- if (cp === $.QUOTATION_MARK)
- this.state = ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE;
-
- else if (cp === $.APOSTROPHE)
- this.state = ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE;
-
- else
- this._reconsumeInState(ATTRIBUTE_VALUE_UNQUOTED_STATE);
-};
-
-
-//12.2.4.38 Attribute value (double-quoted) state
-//------------------------------------------------------------------
-_[ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE] = function attributeValueDoubleQuotedState(cp) {
- if (cp === $.QUOTATION_MARK)
- this.state = AFTER_ATTRIBUTE_VALUE_QUOTED_STATE;
-
- else if (cp === $.AMPERSAND) {
- this.additionalAllowedCp = $.QUOTATION_MARK;
- this.returnState = this.state;
- this.state = CHARACTER_REFERENCE_IN_ATTRIBUTE_VALUE_STATE;
- }
-
- else if (cp === $.NULL)
- this.currentAttr.value += UNICODE.REPLACEMENT_CHARACTER;
-
- else if (cp === $.EOF)
- this._reconsumeInState(DATA_STATE);
-
- else
- this.currentAttr.value += toChar(cp);
-};
-
-
-//12.2.4.39 Attribute value (single-quoted) state
-//------------------------------------------------------------------
-_[ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE] = function attributeValueSingleQuotedState(cp) {
- if (cp === $.APOSTROPHE)
- this.state = AFTER_ATTRIBUTE_VALUE_QUOTED_STATE;
-
- else if (cp === $.AMPERSAND) {
- this.additionalAllowedCp = $.APOSTROPHE;
- this.returnState = this.state;
- this.state = CHARACTER_REFERENCE_IN_ATTRIBUTE_VALUE_STATE;
- }
-
- else if (cp === $.NULL)
- this.currentAttr.value += UNICODE.REPLACEMENT_CHARACTER;
-
- else if (cp === $.EOF)
- this._reconsumeInState(DATA_STATE);
-
- else
- this.currentAttr.value += toChar(cp);
-};
-
-
-//12.2.4.40 Attribute value (unquoted) state
-//------------------------------------------------------------------
-_[ATTRIBUTE_VALUE_UNQUOTED_STATE] = function attributeValueUnquotedState(cp) {
- if (isWhitespace(cp))
- this._leaveAttrValue(BEFORE_ATTRIBUTE_NAME_STATE);
-
- else if (cp === $.AMPERSAND) {
- this.additionalAllowedCp = $.GREATER_THAN_SIGN;
- this.returnState = this.state;
- this.state = CHARACTER_REFERENCE_IN_ATTRIBUTE_VALUE_STATE;
- }
-
- else if (cp === $.GREATER_THAN_SIGN) {
- this._leaveAttrValue(DATA_STATE);
- this._emitCurrentToken();
- }
-
- else if (cp === $.NULL)
- this.currentAttr.value += UNICODE.REPLACEMENT_CHARACTER;
-
- else if (cp === $.QUOTATION_MARK || cp === $.APOSTROPHE || cp === $.LESS_THAN_SIGN ||
- cp === $.EQUALS_SIGN || cp === $.GRAVE_ACCENT)
- this.currentAttr.value += toChar(cp);
-
- else if (cp === $.EOF)
- this._reconsumeInState(DATA_STATE);
-
- else
- this.currentAttr.value += toChar(cp);
-};
-
-
-//12.2.4.41 Character reference in attribute value state
-//------------------------------------------------------------------
-_[CHARACTER_REFERENCE_IN_ATTRIBUTE_VALUE_STATE] = function characterReferenceInAttributeValueState(cp) {
- var referencedCodePoints = this._consumeCharacterReference(cp, true);
-
- if (!this._ensureHibernation()) {
- if (referencedCodePoints) {
- for (var i = 0; i < referencedCodePoints.length; i++)
- this.currentAttr.value += toChar(referencedCodePoints[i]);
- }
- else
- this.currentAttr.value += '&';
-
- this.state = this.returnState;
- }
-};
-
-
-//12.2.4.42 After attribute value (quoted) state
-//------------------------------------------------------------------
-_[AFTER_ATTRIBUTE_VALUE_QUOTED_STATE] = function afterAttributeValueQuotedState(cp) {
- if (isWhitespace(cp))
- this._leaveAttrValue(BEFORE_ATTRIBUTE_NAME_STATE);
-
- else if (cp === $.SOLIDUS)
- this._leaveAttrValue(SELF_CLOSING_START_TAG_STATE);
-
- else if (cp === $.GREATER_THAN_SIGN) {
- this._leaveAttrValue(DATA_STATE);
- this._emitCurrentToken();
- }
-
- else if (cp === $.EOF)
- this._reconsumeInState(DATA_STATE);
-
- else
- this._reconsumeInState(BEFORE_ATTRIBUTE_NAME_STATE);
-};
-
-
-//12.2.4.43 Self-closing start tag state
-//------------------------------------------------------------------
-_[SELF_CLOSING_START_TAG_STATE] = function selfClosingStartTagState(cp) {
- if (cp === $.GREATER_THAN_SIGN) {
- this.currentToken.selfClosing = true;
- this.state = DATA_STATE;
- this._emitCurrentToken();
- }
-
- else if (cp === $.EOF)
- this._reconsumeInState(DATA_STATE);
-
- else
- this._reconsumeInState(BEFORE_ATTRIBUTE_NAME_STATE);
-};
-
-
-//12.2.4.44 Bogus comment state
-//------------------------------------------------------------------
-_[BOGUS_COMMENT_STATE] = function bogusCommentState() {
- this._createCommentToken();
- this._reconsumeInState(BOGUS_COMMENT_STATE_CONTINUATION);
-};
-
-//HACK: to support streaming and make BOGUS_COMMENT_STATE reentrant we've
-//introduced BOGUS_COMMENT_STATE_CONTINUATION state which will not produce
-//comment token on each call.
-_[BOGUS_COMMENT_STATE_CONTINUATION] = function bogusCommentStateContinuation(cp) {
- while (true) {
- if (cp === $.GREATER_THAN_SIGN) {
- this.state = DATA_STATE;
- break;
- }
-
- else if (cp === $.EOF) {
- this._reconsumeInState(DATA_STATE);
- break;
- }
-
- else {
- this.currentToken.data += cp === $.NULL ? UNICODE.REPLACEMENT_CHARACTER : toChar(cp);
-
- this._hibernationSnapshot();
- cp = this._consume();
-
- if (this._ensureHibernation())
- return;
- }
- }
-
- this._emitCurrentToken();
-};
-
-//12.2.4.45 Markup declaration open state
-//------------------------------------------------------------------
-_[MARKUP_DECLARATION_OPEN_STATE] = function markupDeclarationOpenState(cp) {
- var dashDashMatch = this._consumeSubsequentIfMatch($$.DASH_DASH_STRING, cp, true),
- doctypeMatch = !dashDashMatch && this._consumeSubsequentIfMatch($$.DOCTYPE_STRING, cp, false),
- cdataMatch = !dashDashMatch && !doctypeMatch &&
- this.allowCDATA &&
- this._consumeSubsequentIfMatch($$.CDATA_START_STRING, cp, true);
-
- if (!this._ensureHibernation()) {
- if (dashDashMatch) {
- this._createCommentToken();
- this.state = COMMENT_START_STATE;
- }
-
- else if (doctypeMatch)
- this.state = DOCTYPE_STATE;
-
- else if (cdataMatch)
- this.state = CDATA_SECTION_STATE;
-
- else
- this._reconsumeInState(BOGUS_COMMENT_STATE);
- }
-};
-
-
-//12.2.4.46 Comment start state
-//------------------------------------------------------------------
-_[COMMENT_START_STATE] = function commentStartState(cp) {
- if (cp === $.HYPHEN_MINUS)
- this.state = COMMENT_START_DASH_STATE;
-
- else if (cp === $.NULL) {
- this.currentToken.data += UNICODE.REPLACEMENT_CHARACTER;
- this.state = COMMENT_STATE;
- }
-
- else if (cp === $.GREATER_THAN_SIGN) {
- this.state = DATA_STATE;
- this._emitCurrentToken();
- }
-
- else if (cp === $.EOF) {
- this._emitCurrentToken();
- this._reconsumeInState(DATA_STATE);
- }
-
- else {
- this.currentToken.data += toChar(cp);
- this.state = COMMENT_STATE;
- }
-};
-
-
-//12.2.4.47 Comment start dash state
-//------------------------------------------------------------------
-_[COMMENT_START_DASH_STATE] = function commentStartDashState(cp) {
- if (cp === $.HYPHEN_MINUS)
- this.state = COMMENT_END_STATE;
-
- else if (cp === $.NULL) {
- this.currentToken.data += '-';
- this.currentToken.data += UNICODE.REPLACEMENT_CHARACTER;
- this.state = COMMENT_STATE;
- }
-
- else if (cp === $.GREATER_THAN_SIGN) {
- this.state = DATA_STATE;
- this._emitCurrentToken();
- }
-
- else if (cp === $.EOF) {
- this._emitCurrentToken();
- this._reconsumeInState(DATA_STATE);
- }
-
- else {
- this.currentToken.data += '-';
- this.currentToken.data += toChar(cp);
- this.state = COMMENT_STATE;
- }
-};
-
-
-//12.2.4.48 Comment state
-//------------------------------------------------------------------
-_[COMMENT_STATE] = function commentState(cp) {
- if (cp === $.HYPHEN_MINUS)
- this.state = COMMENT_END_DASH_STATE;
-
- else if (cp === $.NULL)
- this.currentToken.data += UNICODE.REPLACEMENT_CHARACTER;
-
- else if (cp === $.EOF) {
- this._emitCurrentToken();
- this._reconsumeInState(DATA_STATE);
- }
-
- else
- this.currentToken.data += toChar(cp);
-};
-
-
-//12.2.4.49 Comment end dash state
-//------------------------------------------------------------------
-_[COMMENT_END_DASH_STATE] = function commentEndDashState(cp) {
- if (cp === $.HYPHEN_MINUS)
- this.state = COMMENT_END_STATE;
-
- else if (cp === $.NULL) {
- this.currentToken.data += '-';
- this.currentToken.data += UNICODE.REPLACEMENT_CHARACTER;
- this.state = COMMENT_STATE;
- }
-
- else if (cp === $.EOF) {
- this._emitCurrentToken();
- this._reconsumeInState(DATA_STATE);
- }
-
- else {
- this.currentToken.data += '-';
- this.currentToken.data += toChar(cp);
- this.state = COMMENT_STATE;
- }
-};
-
-
-//12.2.4.50 Comment end state
-//------------------------------------------------------------------
-_[COMMENT_END_STATE] = function commentEndState(cp) {
- if (cp === $.GREATER_THAN_SIGN) {
- this.state = DATA_STATE;
- this._emitCurrentToken();
- }
-
- else if (cp === $.EXCLAMATION_MARK)
- this.state = COMMENT_END_BANG_STATE;
-
- else if (cp === $.HYPHEN_MINUS)
- this.currentToken.data += '-';
-
- else if (cp === $.NULL) {
- this.currentToken.data += '--';
- this.currentToken.data += UNICODE.REPLACEMENT_CHARACTER;
- this.state = COMMENT_STATE;
- }
-
- else if (cp === $.EOF) {
- this._reconsumeInState(DATA_STATE);
- this._emitCurrentToken();
- }
-
- else {
- this.currentToken.data += '--';
- this.currentToken.data += toChar(cp);
- this.state = COMMENT_STATE;
- }
-};
-
-
-//12.2.4.51 Comment end bang state
-//------------------------------------------------------------------
-_[COMMENT_END_BANG_STATE] = function commentEndBangState(cp) {
- if (cp === $.HYPHEN_MINUS) {
- this.currentToken.data += '--!';
- this.state = COMMENT_END_DASH_STATE;
- }
-
- else if (cp === $.GREATER_THAN_SIGN) {
- this.state = DATA_STATE;
- this._emitCurrentToken();
- }
-
- else if (cp === $.NULL) {
- this.currentToken.data += '--!';
- this.currentToken.data += UNICODE.REPLACEMENT_CHARACTER;
- this.state = COMMENT_STATE;
- }
-
- else if (cp === $.EOF) {
- this._emitCurrentToken();
- this._reconsumeInState(DATA_STATE);
- }
-
- else {
- this.currentToken.data += '--!';
- this.currentToken.data += toChar(cp);
- this.state = COMMENT_STATE;
- }
-};
-
-
-//12.2.4.52 DOCTYPE state
-//------------------------------------------------------------------
-_[DOCTYPE_STATE] = function doctypeState(cp) {
- if (isWhitespace(cp))
- return;
-
- else if (cp === $.GREATER_THAN_SIGN) {
- this._createDoctypeToken(null);
- this.currentToken.forceQuirks = true;
- this._emitCurrentToken();
- this.state = DATA_STATE;
- }
-
- else if (cp === $.EOF) {
- this._createDoctypeToken(null);
- this.currentToken.forceQuirks = true;
- this._emitCurrentToken();
- this._reconsumeInState(DATA_STATE);
- }
- else {
- this._createDoctypeToken('');
- this._reconsumeInState(DOCTYPE_NAME_STATE);
- }
-};
-
-
-//12.2.4.54 DOCTYPE name state
-//------------------------------------------------------------------
-_[DOCTYPE_NAME_STATE] = function doctypeNameState(cp) {
- if (isWhitespace(cp) || cp === $.GREATER_THAN_SIGN || cp === $.EOF)
- this._reconsumeInState(AFTER_DOCTYPE_NAME_STATE);
-
- else if (isAsciiUpper(cp))
- this.currentToken.name += toAsciiLowerChar(cp);
-
- else if (cp === $.NULL)
- this.currentToken.name += UNICODE.REPLACEMENT_CHARACTER;
-
- else
- this.currentToken.name += toChar(cp);
-};
-
-
-//12.2.4.55 After DOCTYPE name state
-//------------------------------------------------------------------
-_[AFTER_DOCTYPE_NAME_STATE] = function afterDoctypeNameState(cp) {
- if (isWhitespace(cp))
- return;
-
- if (cp === $.GREATER_THAN_SIGN) {
- this.state = DATA_STATE;
- this._emitCurrentToken();
- }
-
- else {
- var publicMatch = this._consumeSubsequentIfMatch($$.PUBLIC_STRING, cp, false),
- systemMatch = !publicMatch && this._consumeSubsequentIfMatch($$.SYSTEM_STRING, cp, false);
-
- if (!this._ensureHibernation()) {
- if (publicMatch)
- this.state = BEFORE_DOCTYPE_PUBLIC_IDENTIFIER_STATE;
-
- else if (systemMatch)
- this.state = BEFORE_DOCTYPE_SYSTEM_IDENTIFIER_STATE;
-
- else {
- this.currentToken.forceQuirks = true;
- this.state = BOGUS_DOCTYPE_STATE;
- }
- }
- }
-};
-
-
-//12.2.4.57 Before DOCTYPE public identifier state
-//------------------------------------------------------------------
-_[BEFORE_DOCTYPE_PUBLIC_IDENTIFIER_STATE] = function beforeDoctypePublicIdentifierState(cp) {
- if (isWhitespace(cp))
- return;
-
- if (cp === $.QUOTATION_MARK) {
- this.currentToken.publicId = '';
- this.state = DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED_STATE;
- }
-
- else if (cp === $.APOSTROPHE) {
- this.currentToken.publicId = '';
- this.state = DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED_STATE;
- }
-
- else {
- this.currentToken.forceQuirks = true;
- this._reconsumeInState(BOGUS_DOCTYPE_STATE);
- }
-};
-
-
-//12.2.4.58 DOCTYPE public identifier (double-quoted) state
-//------------------------------------------------------------------
-_[DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED_STATE] = function doctypePublicIdentifierDoubleQuotedState(cp) {
- if (cp === $.QUOTATION_MARK)
- this.state = BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS_STATE;
-
- else if (cp === $.NULL)
- this.currentToken.publicId += UNICODE.REPLACEMENT_CHARACTER;
-
- else if (cp === $.GREATER_THAN_SIGN) {
- this.currentToken.forceQuirks = true;
- this._emitCurrentToken();
- this.state = DATA_STATE;
- }
-
- else if (cp === $.EOF) {
- this.currentToken.forceQuirks = true;
- this._emitCurrentToken();
- this._reconsumeInState(DATA_STATE);
- }
-
- else
- this.currentToken.publicId += toChar(cp);
-};
-
-
-//12.2.4.59 DOCTYPE public identifier (single-quoted) state
-//------------------------------------------------------------------
-_[DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED_STATE] = function doctypePublicIdentifierSingleQuotedState(cp) {
- if (cp === $.APOSTROPHE)
- this.state = BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS_STATE;
-
- else if (cp === $.NULL)
- this.currentToken.publicId += UNICODE.REPLACEMENT_CHARACTER;
-
- else if (cp === $.GREATER_THAN_SIGN) {
- this.currentToken.forceQuirks = true;
- this._emitCurrentToken();
- this.state = DATA_STATE;
- }
-
- else if (cp === $.EOF) {
- this.currentToken.forceQuirks = true;
- this._emitCurrentToken();
- this._reconsumeInState(DATA_STATE);
- }
-
- else
- this.currentToken.publicId += toChar(cp);
-};
-
-
-//12.2.4.61 Between DOCTYPE public and system identifiers state
-//------------------------------------------------------------------
-_[BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS_STATE] = function betweenDoctypePublicAndSystemIdentifiersState(cp) {
- if (isWhitespace(cp))
- return;
-
- if (cp === $.GREATER_THAN_SIGN) {
- this._emitCurrentToken();
- this.state = DATA_STATE;
- }
-
- else if (cp === $.QUOTATION_MARK) {
- this.currentToken.systemId = '';
- this.state = DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE;
- }
-
-
- else if (cp === $.APOSTROPHE) {
- this.currentToken.systemId = '';
- this.state = DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE;
- }
-
- else {
- this.currentToken.forceQuirks = true;
- this._reconsumeInState(BOGUS_DOCTYPE_STATE);
- }
-};
-
-
-//12.2.4.63 Before DOCTYPE system identifier state
-//------------------------------------------------------------------
-_[BEFORE_DOCTYPE_SYSTEM_IDENTIFIER_STATE] = function beforeDoctypeSystemIdentifierState(cp) {
- if (isWhitespace(cp))
- return;
-
- if (cp === $.QUOTATION_MARK) {
- this.currentToken.systemId = '';
- this.state = DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE;
- }
-
- else if (cp === $.APOSTROPHE) {
- this.currentToken.systemId = '';
- this.state = DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE;
- }
-
- else {
- this.currentToken.forceQuirks = true;
- this._reconsumeInState(BOGUS_DOCTYPE_STATE);
- }
-};
-
-
-//12.2.4.64 DOCTYPE system identifier (double-quoted) state
-//------------------------------------------------------------------
-_[DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE] = function doctypeSystemIdentifierDoubleQuotedState(cp) {
- if (cp === $.QUOTATION_MARK)
- this.state = AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE;
-
- else if (cp === $.GREATER_THAN_SIGN) {
- this.currentToken.forceQuirks = true;
- this._emitCurrentToken();
- this.state = DATA_STATE;
- }
-
- else if (cp === $.NULL)
- this.currentToken.systemId += UNICODE.REPLACEMENT_CHARACTER;
-
- else if (cp === $.EOF) {
- this.currentToken.forceQuirks = true;
- this._emitCurrentToken();
- this._reconsumeInState(DATA_STATE);
- }
-
- else
- this.currentToken.systemId += toChar(cp);
-};
-
-
-//12.2.4.65 DOCTYPE system identifier (single-quoted) state
-//------------------------------------------------------------------
-_[DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE] = function doctypeSystemIdentifierSingleQuotedState(cp) {
- if (cp === $.APOSTROPHE)
- this.state = AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE;
-
- else if (cp === $.GREATER_THAN_SIGN) {
- this.currentToken.forceQuirks = true;
- this._emitCurrentToken();
- this.state = DATA_STATE;
- }
-
- else if (cp === $.NULL)
- this.currentToken.systemId += UNICODE.REPLACEMENT_CHARACTER;
-
- else if (cp === $.EOF) {
- this.currentToken.forceQuirks = true;
- this._emitCurrentToken();
- this._reconsumeInState(DATA_STATE);
- }
-
- else
- this.currentToken.systemId += toChar(cp);
-};
-
-
-//12.2.4.66 After DOCTYPE system identifier state
-//------------------------------------------------------------------
-_[AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE] = function afterDoctypeSystemIdentifierState(cp) {
- if (isWhitespace(cp))
- return;
-
- if (cp === $.GREATER_THAN_SIGN) {
- this._emitCurrentToken();
- this.state = DATA_STATE;
- }
-
- else if (cp === $.EOF) {
- this.currentToken.forceQuirks = true;
- this._emitCurrentToken();
- this._reconsumeInState(DATA_STATE);
- }
-
- else
- this.state = BOGUS_DOCTYPE_STATE;
-};
-
-
-//12.2.4.67 Bogus DOCTYPE state
-//------------------------------------------------------------------
-_[BOGUS_DOCTYPE_STATE] = function bogusDoctypeState(cp) {
- if (cp === $.GREATER_THAN_SIGN) {
- this._emitCurrentToken();
- this.state = DATA_STATE;
- }
-
- else if (cp === $.EOF) {
- this._emitCurrentToken();
- this._reconsumeInState(DATA_STATE);
- }
-};
-
-
-//12.2.4.68 CDATA section state
-//------------------------------------------------------------------
-_[CDATA_SECTION_STATE] = function cdataSectionState(cp) {
- while (true) {
- if (cp === $.EOF) {
- this._reconsumeInState(DATA_STATE);
- break;
- }
-
- else {
- var cdataEndMatch = this._consumeSubsequentIfMatch($$.CDATA_END_STRING, cp, true);
-
- if (this._ensureHibernation())
- break;
-
- if (cdataEndMatch) {
- this.state = DATA_STATE;
- break;
- }
-
- this._emitCodePoint(cp);
-
- this._hibernationSnapshot();
- cp = this._consume();
-
- if (this._ensureHibernation())
- break;
- }
- }
-};
diff --git a/tools/eslint/node_modules/parse5/lib/tokenizer/named_entity_trie.js b/tools/eslint/node_modules/parse5/lib/tokenizer/named_entity_trie.js
deleted file mode 100644
index 2ca2c7e4e9..0000000000
--- a/tools/eslint/node_modules/parse5/lib/tokenizer/named_entity_trie.js
+++ /dev/null
@@ -1,6 +0,0 @@
-'use strict';
-
-//NOTE: this file contains auto-generated trie structure that is used for named entity references consumption
-//(see: http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html#tokenizing-character-references and
-//http://www.whatwg.org/specs/web-apps/current-work/multipage/named-character-references.html#named-character-references)
-module.exports = {65:{l:{69:{l:{108:{l:{105:{l:{103:{l:{59:{c:[198]}},c:[198]}}}}}}},77:{l:{80:{l:{59:{c:[38]}},c:[38]}}},97:{l:{99:{l:{117:{l:{116:{l:{101:{l:{59:{c:[193]}},c:[193]}}}}}}}}},98:{l:{114:{l:{101:{l:{118:{l:{101:{l:{59:{c:[258]}}}}}}}}}}},99:{l:{105:{l:{114:{l:{99:{l:{59:{c:[194]}},c:[194]}}}}},121:{l:{59:{c:[1040]}}}}},102:{l:{114:{l:{59:{c:[120068]}}}}},103:{l:{114:{l:{97:{l:{118:{l:{101:{l:{59:{c:[192]}},c:[192]}}}}}}}}},108:{l:{112:{l:{104:{l:{97:{l:{59:{c:[913]}}}}}}}}},109:{l:{97:{l:{99:{l:{114:{l:{59:{c:[256]}}}}}}}}},110:{l:{100:{l:{59:{c:[10835]}}}}},111:{l:{103:{l:{111:{l:{110:{l:{59:{c:[260]}}}}}}},112:{l:{102:{l:{59:{c:[120120]}}}}}}},112:{l:{112:{l:{108:{l:{121:{l:{70:{l:{117:{l:{110:{l:{99:{l:{116:{l:{105:{l:{111:{l:{110:{l:{59:{c:[8289]}}}}}}}}}}}}}}}}}}}}}}}}},114:{l:{105:{l:{110:{l:{103:{l:{59:{c:[197]}},c:[197]}}}}}}},115:{l:{99:{l:{114:{l:{59:{c:[119964]}}}}},115:{l:{105:{l:{103:{l:{110:{l:{59:{c:[8788]}}}}}}}}}}},116:{l:{105:{l:{108:{l:{100:{l:{101:{l:{59:{c:[195]}},c:[195]}}}}}}}}},117:{l:{109:{l:{108:{l:{59:{c:[196]}},c:[196]}}}}}}},66:{l:{97:{l:{99:{l:{107:{l:{115:{l:{108:{l:{97:{l:{115:{l:{104:{l:{59:{c:[8726]}}}}}}}}}}}}}}},114:{l:{118:{l:{59:{c:[10983]}}},119:{l:{101:{l:{100:{l:{59:{c:[8966]}}}}}}}}}}},99:{l:{121:{l:{59:{c:[1041]}}}}},101:{l:{99:{l:{97:{l:{117:{l:{115:{l:{101:{l:{59:{c:[8757]}}}}}}}}}}},114:{l:{110:{l:{111:{l:{117:{l:{108:{l:{108:{l:{105:{l:{115:{l:{59:{c:[8492]}}}}}}}}}}}}}}}}},116:{l:{97:{l:{59:{c:[914]}}}}}}},102:{l:{114:{l:{59:{c:[120069]}}}}},111:{l:{112:{l:{102:{l:{59:{c:[120121]}}}}}}},114:{l:{101:{l:{118:{l:{101:{l:{59:{c:[728]}}}}}}}}},115:{l:{99:{l:{114:{l:{59:{c:[8492]}}}}}}},117:{l:{109:{l:{112:{l:{101:{l:{113:{l:{59:{c:[8782]}}}}}}}}}}}}},67:{l:{72:{l:{99:{l:{121:{l:{59:{c:[1063]}}}}}}},79:{l:{80:{l:{89:{l:{59:{c:[169]}},c:[169]}}}}},97:{l:{99:{l:{117:{l:{116:{l:{101:{l:{59:{c:[262]}}}}}}}}},112:{l:{59:{c:[8914]},105:{l:{116:{l:{97:{l:{108:{l:{68:{l:{105:{l:{102:{l:{102:{l:{101:{l:{114:{l:{101:{l:{110:{l:{116:{l:{105:{l:{97:{l:{108:{l:{68:{l:{59:{c:[8517]}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},121:{l:{108:{l:{101:{l:{121:{l:{115:{l:{59:{c:[8493]}}}}}}}}}}}}},99:{l:{97:{l:{114:{l:{111:{l:{110:{l:{59:{c:[268]}}}}}}}}},101:{l:{100:{l:{105:{l:{108:{l:{59:{c:[199]}},c:[199]}}}}}}},105:{l:{114:{l:{99:{l:{59:{c:[264]}}}}}}},111:{l:{110:{l:{105:{l:{110:{l:{116:{l:{59:{c:[8752]}}}}}}}}}}}}},100:{l:{111:{l:{116:{l:{59:{c:[266]}}}}}}},101:{l:{100:{l:{105:{l:{108:{l:{108:{l:{97:{l:{59:{c:[184]}}}}}}}}}}},110:{l:{116:{l:{101:{l:{114:{l:{68:{l:{111:{l:{116:{l:{59:{c:[183]}}}}}}}}}}}}}}}}},102:{l:{114:{l:{59:{c:[8493]}}}}},104:{l:{105:{l:{59:{c:[935]}}}}},105:{l:{114:{l:{99:{l:{108:{l:{101:{l:{68:{l:{111:{l:{116:{l:{59:{c:[8857]}}}}}}},77:{l:{105:{l:{110:{l:{117:{l:{115:{l:{59:{c:[8854]}}}}}}}}}}},80:{l:{108:{l:{117:{l:{115:{l:{59:{c:[8853]}}}}}}}}},84:{l:{105:{l:{109:{l:{101:{l:{115:{l:{59:{c:[8855]}}}}}}}}}}}}}}}}}}}}},108:{l:{111:{l:{99:{l:{107:{l:{119:{l:{105:{l:{115:{l:{101:{l:{67:{l:{111:{l:{110:{l:{116:{l:{111:{l:{117:{l:{114:{l:{73:{l:{110:{l:{116:{l:{101:{l:{103:{l:{114:{l:{97:{l:{108:{l:{59:{c:[8754]}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},115:{l:{101:{l:{67:{l:{117:{l:{114:{l:{108:{l:{121:{l:{68:{l:{111:{l:{117:{l:{98:{l:{108:{l:{101:{l:{81:{l:{117:{l:{111:{l:{116:{l:{101:{l:{59:{c:[8221]}}}}}}}}}}}}}}}}}}}}}}},81:{l:{117:{l:{111:{l:{116:{l:{101:{l:{59:{c:[8217]}}}}}}}}}}}}}}}}}}}}}}}}}}}}},111:{l:{108:{l:{111:{l:{110:{l:{59:{c:[8759]},101:{l:{59:{c:[10868]}}}}}}}}},110:{l:{103:{l:{114:{l:{117:{l:{101:{l:{110:{l:{116:{l:{59:{c:[8801]}}}}}}}}}}}}},105:{l:{110:{l:{116:{l:{59:{c:[8751]}}}}}}},116:{l:{111:{l:{117:{l:{114:{l:{73:{l:{110:{l:{116:{l:{101:{l:{103:{l:{114:{l:{97:{l:{108:{l:{59:{c:[8750]}}}}}}}}}}}}}}}}}}}}}}}}}}},112:{l:{102:{l:{59:{c:[8450]}}},114:{l:{111:{l:{100:{l:{117:{l:{99:{l:{116:{l:{59:{c:[8720]}}}}}}}}}}}}}}},117:{l:{110:{l:{116:{l:{101:{l:{114:{l:{67:{l:{108:{l:{111:{l:{99:{l:{107:{l:{119:{l:{105:{l:{115:{l:{101:{l:{67:{l:{111:{l:{110:{l:{116:{l:{111:{l:{117:{l:{114:{l:{73:{l:{110:{l:{116:{l:{101:{l:{103:{l:{114:{l:{97:{l:{108:{l:{59:{c:[8755]}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},114:{l:{111:{l:{115:{l:{115:{l:{59:{c:[10799]}}}}}}}}},115:{l:{99:{l:{114:{l:{59:{c:[119966]}}}}}}},117:{l:{112:{l:{59:{c:[8915]},67:{l:{97:{l:{112:{l:{59:{c:[8781]}}}}}}}}}}}}},68:{l:{68:{l:{59:{c:[8517]},111:{l:{116:{l:{114:{l:{97:{l:{104:{l:{100:{l:{59:{c:[10513]}}}}}}}}}}}}}}},74:{l:{99:{l:{121:{l:{59:{c:[1026]}}}}}}},83:{l:{99:{l:{121:{l:{59:{c:[1029]}}}}}}},90:{l:{99:{l:{121:{l:{59:{c:[1039]}}}}}}},97:{l:{103:{l:{103:{l:{101:{l:{114:{l:{59:{c:[8225]}}}}}}}}},114:{l:{114:{l:{59:{c:[8609]}}}}},115:{l:{104:{l:{118:{l:{59:{c:[10980]}}}}}}}}},99:{l:{97:{l:{114:{l:{111:{l:{110:{l:{59:{c:[270]}}}}}}}}},121:{l:{59:{c:[1044]}}}}},101:{l:{108:{l:{59:{c:[8711]},116:{l:{97:{l:{59:{c:[916]}}}}}}}}},102:{l:{114:{l:{59:{c:[120071]}}}}},105:{l:{97:{l:{99:{l:{114:{l:{105:{l:{116:{l:{105:{l:{99:{l:{97:{l:{108:{l:{65:{l:{99:{l:{117:{l:{116:{l:{101:{l:{59:{c:[180]}}}}}}}}}}},68:{l:{111:{l:{116:{l:{59:{c:[729]}}},117:{l:{98:{l:{108:{l:{101:{l:{65:{l:{99:{l:{117:{l:{116:{l:{101:{l:{59:{c:[733]}}}}}}}}}}}}}}}}}}}}}}},71:{l:{114:{l:{97:{l:{118:{l:{101:{l:{59:{c:[96]}}}}}}}}}}},84:{l:{105:{l:{108:{l:{100:{l:{101:{l:{59:{c:[732]}}}}}}}}}}}}}}}}}}}}}}}}}}},109:{l:{111:{l:{110:{l:{100:{l:{59:{c:[8900]}}}}}}}}}}},102:{l:{102:{l:{101:{l:{114:{l:{101:{l:{110:{l:{116:{l:{105:{l:{97:{l:{108:{l:{68:{l:{59:{c:[8518]}}}}}}}}}}}}}}}}}}}}}}}}},111:{l:{112:{l:{102:{l:{59:{c:[120123]}}}}},116:{l:{59:{c:[168]},68:{l:{111:{l:{116:{l:{59:{c:[8412]}}}}}}},69:{l:{113:{l:{117:{l:{97:{l:{108:{l:{59:{c:[8784]}}}}}}}}}}}}},117:{l:{98:{l:{108:{l:{101:{l:{67:{l:{111:{l:{110:{l:{116:{l:{111:{l:{117:{l:{114:{l:{73:{l:{110:{l:{116:{l:{101:{l:{103:{l:{114:{l:{97:{l:{108:{l:{59:{c:[8751]}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},68:{l:{111:{l:{116:{l:{59:{c:[168]}}},119:{l:{110:{l:{65:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[8659]}}}}}}}}}}}}}}}}}}},76:{l:{101:{l:{102:{l:{116:{l:{65:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[8656]}}}}}}}}}}},82:{l:{105:{l:{103:{l:{104:{l:{116:{l:{65:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[8660]}}}}}}}}}}}}}}}}}}}}},84:{l:{101:{l:{101:{l:{59:{c:[10980]}}}}}}}}}}}}},111:{l:{110:{l:{103:{l:{76:{l:{101:{l:{102:{l:{116:{l:{65:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[10232]}}}}}}}}}}},82:{l:{105:{l:{103:{l:{104:{l:{116:{l:{65:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[10234]}}}}}}}}}}}}}}}}}}}}}}}}}}}}},82:{l:{105:{l:{103:{l:{104:{l:{116:{l:{65:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[10233]}}}}}}}}}}}}}}}}}}}}}}}}}}}}},82:{l:{105:{l:{103:{l:{104:{l:{116:{l:{65:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[8658]}}}}}}}}}}},84:{l:{101:{l:{101:{l:{59:{c:[8872]}}}}}}}}}}}}}}}}},85:{l:{112:{l:{65:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[8657]}}}}}}}}}}},68:{l:{111:{l:{119:{l:{110:{l:{65:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[8661]}}}}}}}}}}}}}}}}}}}}}}},86:{l:{101:{l:{114:{l:{116:{l:{105:{l:{99:{l:{97:{l:{108:{l:{66:{l:{97:{l:{114:{l:{59:{c:[8741]}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},119:{l:{110:{l:{65:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[8595]},66:{l:{97:{l:{114:{l:{59:{c:[10515]}}}}}}},85:{l:{112:{l:{65:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[8693]}}}}}}}}}}}}}}}}}}}}}}}}},66:{l:{114:{l:{101:{l:{118:{l:{101:{l:{59:{c:[785]}}}}}}}}}}},76:{l:{101:{l:{102:{l:{116:{l:{82:{l:{105:{l:{103:{l:{104:{l:{116:{l:{86:{l:{101:{l:{99:{l:{116:{l:{111:{l:{114:{l:{59:{c:[10576]}}}}}}}}}}}}}}}}}}}}}}},84:{l:{101:{l:{101:{l:{86:{l:{101:{l:{99:{l:{116:{l:{111:{l:{114:{l:{59:{c:[10590]}}}}}}}}}}}}}}}}}}},86:{l:{101:{l:{99:{l:{116:{l:{111:{l:{114:{l:{59:{c:[8637]},66:{l:{97:{l:{114:{l:{59:{c:[10582]}}}}}}}}}}}}}}}}}}}}}}}}}}},82:{l:{105:{l:{103:{l:{104:{l:{116:{l:{84:{l:{101:{l:{101:{l:{86:{l:{101:{l:{99:{l:{116:{l:{111:{l:{114:{l:{59:{c:[10591]}}}}}}}}}}}}}}}}}}},86:{l:{101:{l:{99:{l:{116:{l:{111:{l:{114:{l:{59:{c:[8641]},66:{l:{97:{l:{114:{l:{59:{c:[10583]}}}}}}}}}}}}}}}}}}}}}}}}}}}}},84:{l:{101:{l:{101:{l:{59:{c:[8868]},65:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[8615]}}}}}}}}}}}}}}}}},97:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[8659]}}}}}}}}}}}}}}}}},115:{l:{99:{l:{114:{l:{59:{c:[119967]}}}}},116:{l:{114:{l:{111:{l:{107:{l:{59:{c:[272]}}}}}}}}}}}}},69:{l:{78:{l:{71:{l:{59:{c:[330]}}}}},84:{l:{72:{l:{59:{c:[208]}},c:[208]}}},97:{l:{99:{l:{117:{l:{116:{l:{101:{l:{59:{c:[201]}},c:[201]}}}}}}}}},99:{l:{97:{l:{114:{l:{111:{l:{110:{l:{59:{c:[282]}}}}}}}}},105:{l:{114:{l:{99:{l:{59:{c:[202]}},c:[202]}}}}},121:{l:{59:{c:[1069]}}}}},100:{l:{111:{l:{116:{l:{59:{c:[278]}}}}}}},102:{l:{114:{l:{59:{c:[120072]}}}}},103:{l:{114:{l:{97:{l:{118:{l:{101:{l:{59:{c:[200]}},c:[200]}}}}}}}}},108:{l:{101:{l:{109:{l:{101:{l:{110:{l:{116:{l:{59:{c:[8712]}}}}}}}}}}}}},109:{l:{97:{l:{99:{l:{114:{l:{59:{c:[274]}}}}}}},112:{l:{116:{l:{121:{l:{83:{l:{109:{l:{97:{l:{108:{l:{108:{l:{83:{l:{113:{l:{117:{l:{97:{l:{114:{l:{101:{l:{59:{c:[9723]}}}}}}}}}}}}}}}}}}}}}}},86:{l:{101:{l:{114:{l:{121:{l:{83:{l:{109:{l:{97:{l:{108:{l:{108:{l:{83:{l:{113:{l:{117:{l:{97:{l:{114:{l:{101:{l:{59:{c:[9643]}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},111:{l:{103:{l:{111:{l:{110:{l:{59:{c:[280]}}}}}}},112:{l:{102:{l:{59:{c:[120124]}}}}}}},112:{l:{115:{l:{105:{l:{108:{l:{111:{l:{110:{l:{59:{c:[917]}}}}}}}}}}}}},113:{l:{117:{l:{97:{l:{108:{l:{59:{c:[10869]},84:{l:{105:{l:{108:{l:{100:{l:{101:{l:{59:{c:[8770]}}}}}}}}}}}}}}},105:{l:{108:{l:{105:{l:{98:{l:{114:{l:{105:{l:{117:{l:{109:{l:{59:{c:[8652]}}}}}}}}}}}}}}}}}}}}},115:{l:{99:{l:{114:{l:{59:{c:[8496]}}}}},105:{l:{109:{l:{59:{c:[10867]}}}}}}},116:{l:{97:{l:{59:{c:[919]}}}}},117:{l:{109:{l:{108:{l:{59:{c:[203]}},c:[203]}}}}},120:{l:{105:{l:{115:{l:{116:{l:{115:{l:{59:{c:[8707]}}}}}}}}},112:{l:{111:{l:{110:{l:{101:{l:{110:{l:{116:{l:{105:{l:{97:{l:{108:{l:{69:{l:{59:{c:[8519]}}}}}}}}}}}}}}}}}}}}}}}}},70:{l:{99:{l:{121:{l:{59:{c:[1060]}}}}},102:{l:{114:{l:{59:{c:[120073]}}}}},105:{l:{108:{l:{108:{l:{101:{l:{100:{l:{83:{l:{109:{l:{97:{l:{108:{l:{108:{l:{83:{l:{113:{l:{117:{l:{97:{l:{114:{l:{101:{l:{59:{c:[9724]}}}}}}}}}}}}}}}}}}}}}}},86:{l:{101:{l:{114:{l:{121:{l:{83:{l:{109:{l:{97:{l:{108:{l:{108:{l:{83:{l:{113:{l:{117:{l:{97:{l:{114:{l:{101:{l:{59:{c:[9642]}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},111:{l:{112:{l:{102:{l:{59:{c:[120125]}}}}},114:{l:{65:{l:{108:{l:{108:{l:{59:{c:[8704]}}}}}}}}},117:{l:{114:{l:{105:{l:{101:{l:{114:{l:{116:{l:{114:{l:{102:{l:{59:{c:[8497]}}}}}}}}}}}}}}}}}}},115:{l:{99:{l:{114:{l:{59:{c:[8497]}}}}}}}}},71:{l:{74:{l:{99:{l:{121:{l:{59:{c:[1027]}}}}}}},84:{l:{59:{c:[62]}},c:[62]},97:{l:{109:{l:{109:{l:{97:{l:{59:{c:[915]},100:{l:{59:{c:[988]}}}}}}}}}}},98:{l:{114:{l:{101:{l:{118:{l:{101:{l:{59:{c:[286]}}}}}}}}}}},99:{l:{101:{l:{100:{l:{105:{l:{108:{l:{59:{c:[290]}}}}}}}}},105:{l:{114:{l:{99:{l:{59:{c:[284]}}}}}}},121:{l:{59:{c:[1043]}}}}},100:{l:{111:{l:{116:{l:{59:{c:[288]}}}}}}},102:{l:{114:{l:{59:{c:[120074]}}}}},103:{l:{59:{c:[8921]}}},111:{l:{112:{l:{102:{l:{59:{c:[120126]}}}}}}},114:{l:{101:{l:{97:{l:{116:{l:{101:{l:{114:{l:{69:{l:{113:{l:{117:{l:{97:{l:{108:{l:{59:{c:[8805]},76:{l:{101:{l:{115:{l:{115:{l:{59:{c:[8923]}}}}}}}}}}}}}}}}}}},70:{l:{117:{l:{108:{l:{108:{l:{69:{l:{113:{l:{117:{l:{97:{l:{108:{l:{59:{c:[8807]}}}}}}}}}}}}}}}}}}},71:{l:{114:{l:{101:{l:{97:{l:{116:{l:{101:{l:{114:{l:{59:{c:[10914]}}}}}}}}}}}}}}},76:{l:{101:{l:{115:{l:{115:{l:{59:{c:[8823]}}}}}}}}},83:{l:{108:{l:{97:{l:{110:{l:{116:{l:{69:{l:{113:{l:{117:{l:{97:{l:{108:{l:{59:{c:[10878]}}}}}}}}}}}}}}}}}}}}},84:{l:{105:{l:{108:{l:{100:{l:{101:{l:{59:{c:[8819]}}}}}}}}}}}}}}}}}}}}}}},115:{l:{99:{l:{114:{l:{59:{c:[119970]}}}}}}},116:{l:{59:{c:[8811]}}}}},72:{l:{65:{l:{82:{l:{68:{l:{99:{l:{121:{l:{59:{c:[1066]}}}}}}}}}}},97:{l:{99:{l:{101:{l:{107:{l:{59:{c:[711]}}}}}}},116:{l:{59:{c:[94]}}}}},99:{l:{105:{l:{114:{l:{99:{l:{59:{c:[292]}}}}}}}}},102:{l:{114:{l:{59:{c:[8460]}}}}},105:{l:{108:{l:{98:{l:{101:{l:{114:{l:{116:{l:{83:{l:{112:{l:{97:{l:{99:{l:{101:{l:{59:{c:[8459]}}}}}}}}}}}}}}}}}}}}}}},111:{l:{112:{l:{102:{l:{59:{c:[8461]}}}}},114:{l:{105:{l:{122:{l:{111:{l:{110:{l:{116:{l:{97:{l:{108:{l:{76:{l:{105:{l:{110:{l:{101:{l:{59:{c:[9472]}}}}}}}}}}}}}}}}}}}}}}}}}}},115:{l:{99:{l:{114:{l:{59:{c:[8459]}}}}},116:{l:{114:{l:{111:{l:{107:{l:{59:{c:[294]}}}}}}}}}}},117:{l:{109:{l:{112:{l:{68:{l:{111:{l:{119:{l:{110:{l:{72:{l:{117:{l:{109:{l:{112:{l:{59:{c:[8782]}}}}}}}}}}}}}}}}},69:{l:{113:{l:{117:{l:{97:{l:{108:{l:{59:{c:[8783]}}}}}}}}}}}}}}}}}}},73:{l:{69:{l:{99:{l:{121:{l:{59:{c:[1045]}}}}}}},74:{l:{108:{l:{105:{l:{103:{l:{59:{c:[306]}}}}}}}}},79:{l:{99:{l:{121:{l:{59:{c:[1025]}}}}}}},97:{l:{99:{l:{117:{l:{116:{l:{101:{l:{59:{c:[205]}},c:[205]}}}}}}}}},99:{l:{105:{l:{114:{l:{99:{l:{59:{c:[206]}},c:[206]}}}}},121:{l:{59:{c:[1048]}}}}},100:{l:{111:{l:{116:{l:{59:{c:[304]}}}}}}},102:{l:{114:{l:{59:{c:[8465]}}}}},103:{l:{114:{l:{97:{l:{118:{l:{101:{l:{59:{c:[204]}},c:[204]}}}}}}}}},109:{l:{59:{c:[8465]},97:{l:{99:{l:{114:{l:{59:{c:[298]}}}}},103:{l:{105:{l:{110:{l:{97:{l:{114:{l:{121:{l:{73:{l:{59:{c:[8520]}}}}}}}}}}}}}}}}},112:{l:{108:{l:{105:{l:{101:{l:{115:{l:{59:{c:[8658]}}}}}}}}}}}}},110:{l:{116:{l:{59:{c:[8748]},101:{l:{103:{l:{114:{l:{97:{l:{108:{l:{59:{c:[8747]}}}}}}}}},114:{l:{115:{l:{101:{l:{99:{l:{116:{l:{105:{l:{111:{l:{110:{l:{59:{c:[8898]}}}}}}}}}}}}}}}}}}}}},118:{l:{105:{l:{115:{l:{105:{l:{98:{l:{108:{l:{101:{l:{67:{l:{111:{l:{109:{l:{109:{l:{97:{l:{59:{c:[8291]}}}}}}}}}}},84:{l:{105:{l:{109:{l:{101:{l:{115:{l:{59:{c:[8290]}}}}}}}}}}}}}}}}}}}}}}}}}}},111:{l:{103:{l:{111:{l:{110:{l:{59:{c:[302]}}}}}}},112:{l:{102:{l:{59:{c:[120128]}}}}},116:{l:{97:{l:{59:{c:[921]}}}}}}},115:{l:{99:{l:{114:{l:{59:{c:[8464]}}}}}}},116:{l:{105:{l:{108:{l:{100:{l:{101:{l:{59:{c:[296]}}}}}}}}}}},117:{l:{107:{l:{99:{l:{121:{l:{59:{c:[1030]}}}}}}},109:{l:{108:{l:{59:{c:[207]}},c:[207]}}}}}}},74:{l:{99:{l:{105:{l:{114:{l:{99:{l:{59:{c:[308]}}}}}}},121:{l:{59:{c:[1049]}}}}},102:{l:{114:{l:{59:{c:[120077]}}}}},111:{l:{112:{l:{102:{l:{59:{c:[120129]}}}}}}},115:{l:{99:{l:{114:{l:{59:{c:[119973]}}}}},101:{l:{114:{l:{99:{l:{121:{l:{59:{c:[1032]}}}}}}}}}}},117:{l:{107:{l:{99:{l:{121:{l:{59:{c:[1028]}}}}}}}}}}},75:{l:{72:{l:{99:{l:{121:{l:{59:{c:[1061]}}}}}}},74:{l:{99:{l:{121:{l:{59:{c:[1036]}}}}}}},97:{l:{112:{l:{112:{l:{97:{l:{59:{c:[922]}}}}}}}}},99:{l:{101:{l:{100:{l:{105:{l:{108:{l:{59:{c:[310]}}}}}}}}},121:{l:{59:{c:[1050]}}}}},102:{l:{114:{l:{59:{c:[120078]}}}}},111:{l:{112:{l:{102:{l:{59:{c:[120130]}}}}}}},115:{l:{99:{l:{114:{l:{59:{c:[119974]}}}}}}}}},76:{l:{74:{l:{99:{l:{121:{l:{59:{c:[1033]}}}}}}},84:{l:{59:{c:[60]}},c:[60]},97:{l:{99:{l:{117:{l:{116:{l:{101:{l:{59:{c:[313]}}}}}}}}},109:{l:{98:{l:{100:{l:{97:{l:{59:{c:[923]}}}}}}}}},110:{l:{103:{l:{59:{c:[10218]}}}}},112:{l:{108:{l:{97:{l:{99:{l:{101:{l:{116:{l:{114:{l:{102:{l:{59:{c:[8466]}}}}}}}}}}}}}}}}},114:{l:{114:{l:{59:{c:[8606]}}}}}}},99:{l:{97:{l:{114:{l:{111:{l:{110:{l:{59:{c:[317]}}}}}}}}},101:{l:{100:{l:{105:{l:{108:{l:{59:{c:[315]}}}}}}}}},121:{l:{59:{c:[1051]}}}}},101:{l:{102:{l:{116:{l:{65:{l:{110:{l:{103:{l:{108:{l:{101:{l:{66:{l:{114:{l:{97:{l:{99:{l:{107:{l:{101:{l:{116:{l:{59:{c:[10216]}}}}}}}}}}}}}}}}}}}}}}},114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[8592]},66:{l:{97:{l:{114:{l:{59:{c:[8676]}}}}}}},82:{l:{105:{l:{103:{l:{104:{l:{116:{l:{65:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[8646]}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},67:{l:{101:{l:{105:{l:{108:{l:{105:{l:{110:{l:{103:{l:{59:{c:[8968]}}}}}}}}}}}}}}},68:{l:{111:{l:{117:{l:{98:{l:{108:{l:{101:{l:{66:{l:{114:{l:{97:{l:{99:{l:{107:{l:{101:{l:{116:{l:{59:{c:[10214]}}}}}}}}}}}}}}}}}}}}}}},119:{l:{110:{l:{84:{l:{101:{l:{101:{l:{86:{l:{101:{l:{99:{l:{116:{l:{111:{l:{114:{l:{59:{c:[10593]}}}}}}}}}}}}}}}}}}},86:{l:{101:{l:{99:{l:{116:{l:{111:{l:{114:{l:{59:{c:[8643]},66:{l:{97:{l:{114:{l:{59:{c:[10585]}}}}}}}}}}}}}}}}}}}}}}}}}}},70:{l:{108:{l:{111:{l:{111:{l:{114:{l:{59:{c:[8970]}}}}}}}}}}},82:{l:{105:{l:{103:{l:{104:{l:{116:{l:{65:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[8596]}}}}}}}}}}},86:{l:{101:{l:{99:{l:{116:{l:{111:{l:{114:{l:{59:{c:[10574]}}}}}}}}}}}}}}}}}}}}}}},84:{l:{101:{l:{101:{l:{59:{c:[8867]},65:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[8612]}}}}}}}}}}},86:{l:{101:{l:{99:{l:{116:{l:{111:{l:{114:{l:{59:{c:[10586]}}}}}}}}}}}}}}}}},114:{l:{105:{l:{97:{l:{110:{l:{103:{l:{108:{l:{101:{l:{59:{c:[8882]},66:{l:{97:{l:{114:{l:{59:{c:[10703]}}}}}}},69:{l:{113:{l:{117:{l:{97:{l:{108:{l:{59:{c:[8884]}}}}}}}}}}}}}}}}}}}}}}}}}}},85:{l:{112:{l:{68:{l:{111:{l:{119:{l:{110:{l:{86:{l:{101:{l:{99:{l:{116:{l:{111:{l:{114:{l:{59:{c:[10577]}}}}}}}}}}}}}}}}}}}}},84:{l:{101:{l:{101:{l:{86:{l:{101:{l:{99:{l:{116:{l:{111:{l:{114:{l:{59:{c:[10592]}}}}}}}}}}}}}}}}}}},86:{l:{101:{l:{99:{l:{116:{l:{111:{l:{114:{l:{59:{c:[8639]},66:{l:{97:{l:{114:{l:{59:{c:[10584]}}}}}}}}}}}}}}}}}}}}}}},86:{l:{101:{l:{99:{l:{116:{l:{111:{l:{114:{l:{59:{c:[8636]},66:{l:{97:{l:{114:{l:{59:{c:[10578]}}}}}}}}}}}}}}}}}}},97:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[8656]}}}}}}}}}}},114:{l:{105:{l:{103:{l:{104:{l:{116:{l:{97:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[8660]}}}}}}}}}}}}}}}}}}}}}}}}},115:{l:{115:{l:{69:{l:{113:{l:{117:{l:{97:{l:{108:{l:{71:{l:{114:{l:{101:{l:{97:{l:{116:{l:{101:{l:{114:{l:{59:{c:[8922]}}}}}}}}}}}}}}}}}}}}}}}}},70:{l:{117:{l:{108:{l:{108:{l:{69:{l:{113:{l:{117:{l:{97:{l:{108:{l:{59:{c:[8806]}}}}}}}}}}}}}}}}}}},71:{l:{114:{l:{101:{l:{97:{l:{116:{l:{101:{l:{114:{l:{59:{c:[8822]}}}}}}}}}}}}}}},76:{l:{101:{l:{115:{l:{115:{l:{59:{c:[10913]}}}}}}}}},83:{l:{108:{l:{97:{l:{110:{l:{116:{l:{69:{l:{113:{l:{117:{l:{97:{l:{108:{l:{59:{c:[10877]}}}}}}}}}}}}}}}}}}}}},84:{l:{105:{l:{108:{l:{100:{l:{101:{l:{59:{c:[8818]}}}}}}}}}}}}}}}}},102:{l:{114:{l:{59:{c:[120079]}}}}},108:{l:{59:{c:[8920]},101:{l:{102:{l:{116:{l:{97:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[8666]}}}}}}}}}}}}}}}}}}},109:{l:{105:{l:{100:{l:{111:{l:{116:{l:{59:{c:[319]}}}}}}}}}}},111:{l:{110:{l:{103:{l:{76:{l:{101:{l:{102:{l:{116:{l:{65:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[10229]}}}}}}}}}}},82:{l:{105:{l:{103:{l:{104:{l:{116:{l:{65:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[10231]}}}}}}}}}}}}}}}}}}}}}}}}}}}}},82:{l:{105:{l:{103:{l:{104:{l:{116:{l:{65:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[10230]}}}}}}}}}}}}}}}}}}}}},108:{l:{101:{l:{102:{l:{116:{l:{97:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[10232]}}}}}}}}}}},114:{l:{105:{l:{103:{l:{104:{l:{116:{l:{97:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[10234]}}}}}}}}}}}}}}}}}}}}}}}}}}}}},114:{l:{105:{l:{103:{l:{104:{l:{116:{l:{97:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[10233]}}}}}}}}}}}}}}}}}}}}}}}}},112:{l:{102:{l:{59:{c:[120131]}}}}},119:{l:{101:{l:{114:{l:{76:{l:{101:{l:{102:{l:{116:{l:{65:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[8601]}}}}}}}}}}}}}}}}}}},82:{l:{105:{l:{103:{l:{104:{l:{116:{l:{65:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[8600]}}}}}}}}}}}}}}}}}}}}}}}}}}}}},115:{l:{99:{l:{114:{l:{59:{c:[8466]}}}}},104:{l:{59:{c:[8624]}}},116:{l:{114:{l:{111:{l:{107:{l:{59:{c:[321]}}}}}}}}}}},116:{l:{59:{c:[8810]}}}}},77:{l:{97:{l:{112:{l:{59:{c:[10501]}}}}},99:{l:{121:{l:{59:{c:[1052]}}}}},101:{l:{100:{l:{105:{l:{117:{l:{109:{l:{83:{l:{112:{l:{97:{l:{99:{l:{101:{l:{59:{c:[8287]}}}}}}}}}}}}}}}}}}},108:{l:{108:{l:{105:{l:{110:{l:{116:{l:{114:{l:{102:{l:{59:{c:[8499]}}}}}}}}}}}}}}}}},102:{l:{114:{l:{59:{c:[120080]}}}}},105:{l:{110:{l:{117:{l:{115:{l:{80:{l:{108:{l:{117:{l:{115:{l:{59:{c:[8723]}}}}}}}}}}}}}}}}},111:{l:{112:{l:{102:{l:{59:{c:[120132]}}}}}}},115:{l:{99:{l:{114:{l:{59:{c:[8499]}}}}}}},117:{l:{59:{c:[924]}}}}},78:{l:{74:{l:{99:{l:{121:{l:{59:{c:[1034]}}}}}}},97:{l:{99:{l:{117:{l:{116:{l:{101:{l:{59:{c:[323]}}}}}}}}}}},99:{l:{97:{l:{114:{l:{111:{l:{110:{l:{59:{c:[327]}}}}}}}}},101:{l:{100:{l:{105:{l:{108:{l:{59:{c:[325]}}}}}}}}},121:{l:{59:{c:[1053]}}}}},101:{l:{103:{l:{97:{l:{116:{l:{105:{l:{118:{l:{101:{l:{77:{l:{101:{l:{100:{l:{105:{l:{117:{l:{109:{l:{83:{l:{112:{l:{97:{l:{99:{l:{101:{l:{59:{c:[8203]}}}}}}}}}}}}}}}}}}}}}}},84:{l:{104:{l:{105:{l:{99:{l:{107:{l:{83:{l:{112:{l:{97:{l:{99:{l:{101:{l:{59:{c:[8203]}}}}}}}}}}}}}}},110:{l:{83:{l:{112:{l:{97:{l:{99:{l:{101:{l:{59:{c:[8203]}}}}}}}}}}}}}}}}}}},86:{l:{101:{l:{114:{l:{121:{l:{84:{l:{104:{l:{105:{l:{110:{l:{83:{l:{112:{l:{97:{l:{99:{l:{101:{l:{59:{c:[8203]}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},115:{l:{116:{l:{101:{l:{100:{l:{71:{l:{114:{l:{101:{l:{97:{l:{116:{l:{101:{l:{114:{l:{71:{l:{114:{l:{101:{l:{97:{l:{116:{l:{101:{l:{114:{l:{59:{c:[8811]}}}}}}}}}}}}}}}}}}}}}}}}}}}}},76:{l:{101:{l:{115:{l:{115:{l:{76:{l:{101:{l:{115:{l:{115:{l:{59:{c:[8810]}}}}}}}}}}}}}}}}}}}}}}}}},119:{l:{76:{l:{105:{l:{110:{l:{101:{l:{59:{c:[10]}}}}}}}}}}}}},102:{l:{114:{l:{59:{c:[120081]}}}}},111:{l:{66:{l:{114:{l:{101:{l:{97:{l:{107:{l:{59:{c:[8288]}}}}}}}}}}},110:{l:{66:{l:{114:{l:{101:{l:{97:{l:{107:{l:{105:{l:{110:{l:{103:{l:{83:{l:{112:{l:{97:{l:{99:{l:{101:{l:{59:{c:[160]}}}}}}}}}}}}}}}}}}}}}}}}}}}}},112:{l:{102:{l:{59:{c:[8469]}}}}},116:{l:{59:{c:[10988]},67:{l:{111:{l:{110:{l:{103:{l:{114:{l:{117:{l:{101:{l:{110:{l:{116:{l:{59:{c:[8802]}}}}}}}}}}}}}}}}},117:{l:{112:{l:{67:{l:{97:{l:{112:{l:{59:{c:[8813]}}}}}}}}}}}}},68:{l:{111:{l:{117:{l:{98:{l:{108:{l:{101:{l:{86:{l:{101:{l:{114:{l:{116:{l:{105:{l:{99:{l:{97:{l:{108:{l:{66:{l:{97:{l:{114:{l:{59:{c:[8742]}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},69:{l:{108:{l:{101:{l:{109:{l:{101:{l:{110:{l:{116:{l:{59:{c:[8713]}}}}}}}}}}}}},113:{l:{117:{l:{97:{l:{108:{l:{59:{c:[8800]},84:{l:{105:{l:{108:{l:{100:{l:{101:{l:{59:{c:[8770,824]}}}}}}}}}}}}}}}}}}},120:{l:{105:{l:{115:{l:{116:{l:{115:{l:{59:{c:[8708]}}}}}}}}}}}}},71:{l:{114:{l:{101:{l:{97:{l:{116:{l:{101:{l:{114:{l:{59:{c:[8815]},69:{l:{113:{l:{117:{l:{97:{l:{108:{l:{59:{c:[8817]}}}}}}}}}}},70:{l:{117:{l:{108:{l:{108:{l:{69:{l:{113:{l:{117:{l:{97:{l:{108:{l:{59:{c:[8807,824]}}}}}}}}}}}}}}}}}}},71:{l:{114:{l:{101:{l:{97:{l:{116:{l:{101:{l:{114:{l:{59:{c:[8811,824]}}}}}}}}}}}}}}},76:{l:{101:{l:{115:{l:{115:{l:{59:{c:[8825]}}}}}}}}},83:{l:{108:{l:{97:{l:{110:{l:{116:{l:{69:{l:{113:{l:{117:{l:{97:{l:{108:{l:{59:{c:[10878,824]}}}}}}}}}}}}}}}}}}}}},84:{l:{105:{l:{108:{l:{100:{l:{101:{l:{59:{c:[8821]}}}}}}}}}}}}}}}}}}}}}}}}},72:{l:{117:{l:{109:{l:{112:{l:{68:{l:{111:{l:{119:{l:{110:{l:{72:{l:{117:{l:{109:{l:{112:{l:{59:{c:[8782,824]}}}}}}}}}}}}}}}}},69:{l:{113:{l:{117:{l:{97:{l:{108:{l:{59:{c:[8783,824]}}}}}}}}}}}}}}}}}}},76:{l:{101:{l:{102:{l:{116:{l:{84:{l:{114:{l:{105:{l:{97:{l:{110:{l:{103:{l:{108:{l:{101:{l:{59:{c:[8938]},66:{l:{97:{l:{114:{l:{59:{c:[10703,824]}}}}}}},69:{l:{113:{l:{117:{l:{97:{l:{108:{l:{59:{c:[8940]}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},115:{l:{115:{l:{59:{c:[8814]},69:{l:{113:{l:{117:{l:{97:{l:{108:{l:{59:{c:[8816]}}}}}}}}}}},71:{l:{114:{l:{101:{l:{97:{l:{116:{l:{101:{l:{114:{l:{59:{c:[8824]}}}}}}}}}}}}}}},76:{l:{101:{l:{115:{l:{115:{l:{59:{c:[8810,824]}}}}}}}}},83:{l:{108:{l:{97:{l:{110:{l:{116:{l:{69:{l:{113:{l:{117:{l:{97:{l:{108:{l:{59:{c:[10877,824]}}}}}}}}}}}}}}}}}}}}},84:{l:{105:{l:{108:{l:{100:{l:{101:{l:{59:{c:[8820]}}}}}}}}}}}}}}}}}}},78:{l:{101:{l:{115:{l:{116:{l:{101:{l:{100:{l:{71:{l:{114:{l:{101:{l:{97:{l:{116:{l:{101:{l:{114:{l:{71:{l:{114:{l:{101:{l:{97:{l:{116:{l:{101:{l:{114:{l:{59:{c:[10914,824]}}}}}}}}}}}}}}}}}}}}}}}}}}}}},76:{l:{101:{l:{115:{l:{115:{l:{76:{l:{101:{l:{115:{l:{115:{l:{59:{c:[10913,824]}}}}}}}}}}}}}}}}}}}}}}}}}}}}},80:{l:{114:{l:{101:{l:{99:{l:{101:{l:{100:{l:{101:{l:{115:{l:{59:{c:[8832]},69:{l:{113:{l:{117:{l:{97:{l:{108:{l:{59:{c:[10927,824]}}}}}}}}}}},83:{l:{108:{l:{97:{l:{110:{l:{116:{l:{69:{l:{113:{l:{117:{l:{97:{l:{108:{l:{59:{c:[8928]}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},82:{l:{101:{l:{118:{l:{101:{l:{114:{l:{115:{l:{101:{l:{69:{l:{108:{l:{101:{l:{109:{l:{101:{l:{110:{l:{116:{l:{59:{c:[8716]}}}}}}}}}}}}}}}}}}}}}}}}}}},105:{l:{103:{l:{104:{l:{116:{l:{84:{l:{114:{l:{105:{l:{97:{l:{110:{l:{103:{l:{108:{l:{101:{l:{59:{c:[8939]},66:{l:{97:{l:{114:{l:{59:{c:[10704,824]}}}}}}},69:{l:{113:{l:{117:{l:{97:{l:{108:{l:{59:{c:[8941]}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},83:{l:{113:{l:{117:{l:{97:{l:{114:{l:{101:{l:{83:{l:{117:{l:{98:{l:{115:{l:{101:{l:{116:{l:{59:{c:[8847,824]},69:{l:{113:{l:{117:{l:{97:{l:{108:{l:{59:{c:[8930]}}}}}}}}}}}}}}}}}}},112:{l:{101:{l:{114:{l:{115:{l:{101:{l:{116:{l:{59:{c:[8848,824]},69:{l:{113:{l:{117:{l:{97:{l:{108:{l:{59:{c:[8931]}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},117:{l:{98:{l:{115:{l:{101:{l:{116:{l:{59:{c:[8834,8402]},69:{l:{113:{l:{117:{l:{97:{l:{108:{l:{59:{c:[8840]}}}}}}}}}}}}}}}}}}},99:{l:{99:{l:{101:{l:{101:{l:{100:{l:{115:{l:{59:{c:[8833]},69:{l:{113:{l:{117:{l:{97:{l:{108:{l:{59:{c:[10928,824]}}}}}}}}}}},83:{l:{108:{l:{97:{l:{110:{l:{116:{l:{69:{l:{113:{l:{117:{l:{97:{l:{108:{l:{59:{c:[8929]}}}}}}}}}}}}}}}}}}}}},84:{l:{105:{l:{108:{l:{100:{l:{101:{l:{59:{c:[8831,824]}}}}}}}}}}}}}}}}}}}}}}},112:{l:{101:{l:{114:{l:{115:{l:{101:{l:{116:{l:{59:{c:[8835,8402]},69:{l:{113:{l:{117:{l:{97:{l:{108:{l:{59:{c:[8841]}}}}}}}}}}}}}}}}}}}}}}}}}}},84:{l:{105:{l:{108:{l:{100:{l:{101:{l:{59:{c:[8769]},69:{l:{113:{l:{117:{l:{97:{l:{108:{l:{59:{c:[8772]}}}}}}}}}}},70:{l:{117:{l:{108:{l:{108:{l:{69:{l:{113:{l:{117:{l:{97:{l:{108:{l:{59:{c:[8775]}}}}}}}}}}}}}}}}}}},84:{l:{105:{l:{108:{l:{100:{l:{101:{l:{59:{c:[8777]}}}}}}}}}}}}}}}}}}}}},86:{l:{101:{l:{114:{l:{116:{l:{105:{l:{99:{l:{97:{l:{108:{l:{66:{l:{97:{l:{114:{l:{59:{c:[8740]}}}}}}}}}}}}}}}}}}}}}}}}}}},115:{l:{99:{l:{114:{l:{59:{c:[119977]}}}}}}},116:{l:{105:{l:{108:{l:{100:{l:{101:{l:{59:{c:[209]}},c:[209]}}}}}}}}},117:{l:{59:{c:[925]}}}}},79:{l:{69:{l:{108:{l:{105:{l:{103:{l:{59:{c:[338]}}}}}}}}},97:{l:{99:{l:{117:{l:{116:{l:{101:{l:{59:{c:[211]}},c:[211]}}}}}}}}},99:{l:{105:{l:{114:{l:{99:{l:{59:{c:[212]}},c:[212]}}}}},121:{l:{59:{c:[1054]}}}}},100:{l:{98:{l:{108:{l:{97:{l:{99:{l:{59:{c:[336]}}}}}}}}}}},102:{l:{114:{l:{59:{c:[120082]}}}}},103:{l:{114:{l:{97:{l:{118:{l:{101:{l:{59:{c:[210]}},c:[210]}}}}}}}}},109:{l:{97:{l:{99:{l:{114:{l:{59:{c:[332]}}}}}}},101:{l:{103:{l:{97:{l:{59:{c:[937]}}}}}}},105:{l:{99:{l:{114:{l:{111:{l:{110:{l:{59:{c:[927]}}}}}}}}}}}}},111:{l:{112:{l:{102:{l:{59:{c:[120134]}}}}}}},112:{l:{101:{l:{110:{l:{67:{l:{117:{l:{114:{l:{108:{l:{121:{l:{68:{l:{111:{l:{117:{l:{98:{l:{108:{l:{101:{l:{81:{l:{117:{l:{111:{l:{116:{l:{101:{l:{59:{c:[8220]}}}}}}}}}}}}}}}}}}}}}}},81:{l:{117:{l:{111:{l:{116:{l:{101:{l:{59:{c:[8216]}}}}}}}}}}}}}}}}}}}}}}}}}}},114:{l:{59:{c:[10836]}}},115:{l:{99:{l:{114:{l:{59:{c:[119978]}}}}},108:{l:{97:{l:{115:{l:{104:{l:{59:{c:[216]}},c:[216]}}}}}}}}},116:{l:{105:{l:{108:{l:{100:{l:{101:{l:{59:{c:[213]}},c:[213]}}}}},109:{l:{101:{l:{115:{l:{59:{c:[10807]}}}}}}}}}}},117:{l:{109:{l:{108:{l:{59:{c:[214]}},c:[214]}}}}},118:{l:{101:{l:{114:{l:{66:{l:{97:{l:{114:{l:{59:{c:[8254]}}}}},114:{l:{97:{l:{99:{l:{101:{l:{59:{c:[9182]}}},107:{l:{101:{l:{116:{l:{59:{c:[9140]}}}}}}}}}}}}}}},80:{l:{97:{l:{114:{l:{101:{l:{110:{l:{116:{l:{104:{l:{101:{l:{115:{l:{105:{l:{115:{l:{59:{c:[9180]}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},80:{l:{97:{l:{114:{l:{116:{l:{105:{l:{97:{l:{108:{l:{68:{l:{59:{c:[8706]}}}}}}}}}}}}}}},99:{l:{121:{l:{59:{c:[1055]}}}}},102:{l:{114:{l:{59:{c:[120083]}}}}},104:{l:{105:{l:{59:{c:[934]}}}}},105:{l:{59:{c:[928]}}},108:{l:{117:{l:{115:{l:{77:{l:{105:{l:{110:{l:{117:{l:{115:{l:{59:{c:[177]}}}}}}}}}}}}}}}}},111:{l:{105:{l:{110:{l:{99:{l:{97:{l:{114:{l:{101:{l:{112:{l:{108:{l:{97:{l:{110:{l:{101:{l:{59:{c:[8460]}}}}}}}}}}}}}}}}}}}}}}},112:{l:{102:{l:{59:{c:[8473]}}}}}}},114:{l:{59:{c:[10939]},101:{l:{99:{l:{101:{l:{100:{l:{101:{l:{115:{l:{59:{c:[8826]},69:{l:{113:{l:{117:{l:{97:{l:{108:{l:{59:{c:[10927]}}}}}}}}}}},83:{l:{108:{l:{97:{l:{110:{l:{116:{l:{69:{l:{113:{l:{117:{l:{97:{l:{108:{l:{59:{c:[8828]}}}}}}}}}}}}}}}}}}}}},84:{l:{105:{l:{108:{l:{100:{l:{101:{l:{59:{c:[8830]}}}}}}}}}}}}}}}}}}}}}}},105:{l:{109:{l:{101:{l:{59:{c:[8243]}}}}}}},111:{l:{100:{l:{117:{l:{99:{l:{116:{l:{59:{c:[8719]}}}}}}}}},112:{l:{111:{l:{114:{l:{116:{l:{105:{l:{111:{l:{110:{l:{59:{c:[8759]},97:{l:{108:{l:{59:{c:[8733]}}}}}}}}}}}}}}}}}}}}}}},115:{l:{99:{l:{114:{l:{59:{c:[119979]}}}}},105:{l:{59:{c:[936]}}}}}}},81:{l:{85:{l:{79:{l:{84:{l:{59:{c:[34]}},c:[34]}}}}},102:{l:{114:{l:{59:{c:[120084]}}}}},111:{l:{112:{l:{102:{l:{59:{c:[8474]}}}}}}},115:{l:{99:{l:{114:{l:{59:{c:[119980]}}}}}}}}},82:{l:{66:{l:{97:{l:{114:{l:{114:{l:{59:{c:[10512]}}}}}}}}},69:{l:{71:{l:{59:{c:[174]}},c:[174]}}},97:{l:{99:{l:{117:{l:{116:{l:{101:{l:{59:{c:[340]}}}}}}}}},110:{l:{103:{l:{59:{c:[10219]}}}}},114:{l:{114:{l:{59:{c:[8608]},116:{l:{108:{l:{59:{c:[10518]}}}}}}}}}}},99:{l:{97:{l:{114:{l:{111:{l:{110:{l:{59:{c:[344]}}}}}}}}},101:{l:{100:{l:{105:{l:{108:{l:{59:{c:[342]}}}}}}}}},121:{l:{59:{c:[1056]}}}}},101:{l:{59:{c:[8476]},118:{l:{101:{l:{114:{l:{115:{l:{101:{l:{69:{l:{108:{l:{101:{l:{109:{l:{101:{l:{110:{l:{116:{l:{59:{c:[8715]}}}}}}}}}}}}},113:{l:{117:{l:{105:{l:{108:{l:{105:{l:{98:{l:{114:{l:{105:{l:{117:{l:{109:{l:{59:{c:[8651]}}}}}}}}}}}}}}}}}}}}}}},85:{l:{112:{l:{69:{l:{113:{l:{117:{l:{105:{l:{108:{l:{105:{l:{98:{l:{114:{l:{105:{l:{117:{l:{109:{l:{59:{c:[10607]}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},102:{l:{114:{l:{59:{c:[8476]}}}}},104:{l:{111:{l:{59:{c:[929]}}}}},105:{l:{103:{l:{104:{l:{116:{l:{65:{l:{110:{l:{103:{l:{108:{l:{101:{l:{66:{l:{114:{l:{97:{l:{99:{l:{107:{l:{101:{l:{116:{l:{59:{c:[10217]}}}}}}}}}}}}}}}}}}}}}}},114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[8594]},66:{l:{97:{l:{114:{l:{59:{c:[8677]}}}}}}},76:{l:{101:{l:{102:{l:{116:{l:{65:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[8644]}}}}}}}}}}}}}}}}}}}}}}}}}}}}},67:{l:{101:{l:{105:{l:{108:{l:{105:{l:{110:{l:{103:{l:{59:{c:[8969]}}}}}}}}}}}}}}},68:{l:{111:{l:{117:{l:{98:{l:{108:{l:{101:{l:{66:{l:{114:{l:{97:{l:{99:{l:{107:{l:{101:{l:{116:{l:{59:{c:[10215]}}}}}}}}}}}}}}}}}}}}}}},119:{l:{110:{l:{84:{l:{101:{l:{101:{l:{86:{l:{101:{l:{99:{l:{116:{l:{111:{l:{114:{l:{59:{c:[10589]}}}}}}}}}}}}}}}}}}},86:{l:{101:{l:{99:{l:{116:{l:{111:{l:{114:{l:{59:{c:[8642]},66:{l:{97:{l:{114:{l:{59:{c:[10581]}}}}}}}}}}}}}}}}}}}}}}}}}}},70:{l:{108:{l:{111:{l:{111:{l:{114:{l:{59:{c:[8971]}}}}}}}}}}},84:{l:{101:{l:{101:{l:{59:{c:[8866]},65:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[8614]}}}}}}}}}}},86:{l:{101:{l:{99:{l:{116:{l:{111:{l:{114:{l:{59:{c:[10587]}}}}}}}}}}}}}}}}},114:{l:{105:{l:{97:{l:{110:{l:{103:{l:{108:{l:{101:{l:{59:{c:[8883]},66:{l:{97:{l:{114:{l:{59:{c:[10704]}}}}}}},69:{l:{113:{l:{117:{l:{97:{l:{108:{l:{59:{c:[8885]}}}}}}}}}}}}}}}}}}}}}}}}}}},85:{l:{112:{l:{68:{l:{111:{l:{119:{l:{110:{l:{86:{l:{101:{l:{99:{l:{116:{l:{111:{l:{114:{l:{59:{c:[10575]}}}}}}}}}}}}}}}}}}}}},84:{l:{101:{l:{101:{l:{86:{l:{101:{l:{99:{l:{116:{l:{111:{l:{114:{l:{59:{c:[10588]}}}}}}}}}}}}}}}}}}},86:{l:{101:{l:{99:{l:{116:{l:{111:{l:{114:{l:{59:{c:[8638]},66:{l:{97:{l:{114:{l:{59:{c:[10580]}}}}}}}}}}}}}}}}}}}}}}},86:{l:{101:{l:{99:{l:{116:{l:{111:{l:{114:{l:{59:{c:[8640]},66:{l:{97:{l:{114:{l:{59:{c:[10579]}}}}}}}}}}}}}}}}}}},97:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[8658]}}}}}}}}}}}}}}}}}}},111:{l:{112:{l:{102:{l:{59:{c:[8477]}}}}},117:{l:{110:{l:{100:{l:{73:{l:{109:{l:{112:{l:{108:{l:{105:{l:{101:{l:{115:{l:{59:{c:[10608]}}}}}}}}}}}}}}}}}}}}}}},114:{l:{105:{l:{103:{l:{104:{l:{116:{l:{97:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[8667]}}}}}}}}}}}}}}}}}}}}},115:{l:{99:{l:{114:{l:{59:{c:[8475]}}}}},104:{l:{59:{c:[8625]}}}}},117:{l:{108:{l:{101:{l:{68:{l:{101:{l:{108:{l:{97:{l:{121:{l:{101:{l:{100:{l:{59:{c:[10740]}}}}}}}}}}}}}}}}}}}}}}},83:{l:{72:{l:{67:{l:{72:{l:{99:{l:{121:{l:{59:{c:[1065]}}}}}}}}},99:{l:{121:{l:{59:{c:[1064]}}}}}}},79:{l:{70:{l:{84:{l:{99:{l:{121:{l:{59:{c:[1068]}}}}}}}}}}},97:{l:{99:{l:{117:{l:{116:{l:{101:{l:{59:{c:[346]}}}}}}}}}}},99:{l:{59:{c:[10940]},97:{l:{114:{l:{111:{l:{110:{l:{59:{c:[352]}}}}}}}}},101:{l:{100:{l:{105:{l:{108:{l:{59:{c:[350]}}}}}}}}},105:{l:{114:{l:{99:{l:{59:{c:[348]}}}}}}},121:{l:{59:{c:[1057]}}}}},102:{l:{114:{l:{59:{c:[120086]}}}}},104:{l:{111:{l:{114:{l:{116:{l:{68:{l:{111:{l:{119:{l:{110:{l:{65:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[8595]}}}}}}}}}}}}}}}}}}},76:{l:{101:{l:{102:{l:{116:{l:{65:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[8592]}}}}}}}}}}}}}}}}}}},82:{l:{105:{l:{103:{l:{104:{l:{116:{l:{65:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[8594]}}}}}}}}}}}}}}}}}}}}},85:{l:{112:{l:{65:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[8593]}}}}}}}}}}}}}}}}}}}}}}},105:{l:{103:{l:{109:{l:{97:{l:{59:{c:[931]}}}}}}}}},109:{l:{97:{l:{108:{l:{108:{l:{67:{l:{105:{l:{114:{l:{99:{l:{108:{l:{101:{l:{59:{c:[8728]}}}}}}}}}}}}}}}}}}}}},111:{l:{112:{l:{102:{l:{59:{c:[120138]}}}}}}},113:{l:{114:{l:{116:{l:{59:{c:[8730]}}}}},117:{l:{97:{l:{114:{l:{101:{l:{59:{c:[9633]},73:{l:{110:{l:{116:{l:{101:{l:{114:{l:{115:{l:{101:{l:{99:{l:{116:{l:{105:{l:{111:{l:{110:{l:{59:{c:[8851]}}}}}}}}}}}}}}}}}}}}}}}}},83:{l:{117:{l:{98:{l:{115:{l:{101:{l:{116:{l:{59:{c:[8847]},69:{l:{113:{l:{117:{l:{97:{l:{108:{l:{59:{c:[8849]}}}}}}}}}}}}}}}}}}},112:{l:{101:{l:{114:{l:{115:{l:{101:{l:{116:{l:{59:{c:[8848]},69:{l:{113:{l:{117:{l:{97:{l:{108:{l:{59:{c:[8850]}}}}}}}}}}}}}}}}}}}}}}}}}}},85:{l:{110:{l:{105:{l:{111:{l:{110:{l:{59:{c:[8852]}}}}}}}}}}}}}}}}}}}}},115:{l:{99:{l:{114:{l:{59:{c:[119982]}}}}}}},116:{l:{97:{l:{114:{l:{59:{c:[8902]}}}}}}},117:{l:{98:{l:{59:{c:[8912]},115:{l:{101:{l:{116:{l:{59:{c:[8912]},69:{l:{113:{l:{117:{l:{97:{l:{108:{l:{59:{c:[8838]}}}}}}}}}}}}}}}}}}},99:{l:{99:{l:{101:{l:{101:{l:{100:{l:{115:{l:{59:{c:[8827]},69:{l:{113:{l:{117:{l:{97:{l:{108:{l:{59:{c:[10928]}}}}}}}}}}},83:{l:{108:{l:{97:{l:{110:{l:{116:{l:{69:{l:{113:{l:{117:{l:{97:{l:{108:{l:{59:{c:[8829]}}}}}}}}}}}}}}}}}}}}},84:{l:{105:{l:{108:{l:{100:{l:{101:{l:{59:{c:[8831]}}}}}}}}}}}}}}}}}}}}},104:{l:{84:{l:{104:{l:{97:{l:{116:{l:{59:{c:[8715]}}}}}}}}}}}}},109:{l:{59:{c:[8721]}}},112:{l:{59:{c:[8913]},101:{l:{114:{l:{115:{l:{101:{l:{116:{l:{59:{c:[8835]},69:{l:{113:{l:{117:{l:{97:{l:{108:{l:{59:{c:[8839]}}}}}}}}}}}}}}}}}}}}},115:{l:{101:{l:{116:{l:{59:{c:[8913]}}}}}}}}}}}}},84:{l:{72:{l:{79:{l:{82:{l:{78:{l:{59:{c:[222]}},c:[222]}}}}}}},82:{l:{65:{l:{68:{l:{69:{l:{59:{c:[8482]}}}}}}}}},83:{l:{72:{l:{99:{l:{121:{l:{59:{c:[1035]}}}}}}},99:{l:{121:{l:{59:{c:[1062]}}}}}}},97:{l:{98:{l:{59:{c:[9]}}},117:{l:{59:{c:[932]}}}}},99:{l:{97:{l:{114:{l:{111:{l:{110:{l:{59:{c:[356]}}}}}}}}},101:{l:{100:{l:{105:{l:{108:{l:{59:{c:[354]}}}}}}}}},121:{l:{59:{c:[1058]}}}}},102:{l:{114:{l:{59:{c:[120087]}}}}},104:{l:{101:{l:{114:{l:{101:{l:{102:{l:{111:{l:{114:{l:{101:{l:{59:{c:[8756]}}}}}}}}}}}}},116:{l:{97:{l:{59:{c:[920]}}}}}}},105:{l:{99:{l:{107:{l:{83:{l:{112:{l:{97:{l:{99:{l:{101:{l:{59:{c:[8287,8202]}}}}}}}}}}}}}}},110:{l:{83:{l:{112:{l:{97:{l:{99:{l:{101:{l:{59:{c:[8201]}}}}}}}}}}}}}}}}},105:{l:{108:{l:{100:{l:{101:{l:{59:{c:[8764]},69:{l:{113:{l:{117:{l:{97:{l:{108:{l:{59:{c:[8771]}}}}}}}}}}},70:{l:{117:{l:{108:{l:{108:{l:{69:{l:{113:{l:{117:{l:{97:{l:{108:{l:{59:{c:[8773]}}}}}}}}}}}}}}}}}}},84:{l:{105:{l:{108:{l:{100:{l:{101:{l:{59:{c:[8776]}}}}}}}}}}}}}}}}}}},111:{l:{112:{l:{102:{l:{59:{c:[120139]}}}}}}},114:{l:{105:{l:{112:{l:{108:{l:{101:{l:{68:{l:{111:{l:{116:{l:{59:{c:[8411]}}}}}}}}}}}}}}}}},115:{l:{99:{l:{114:{l:{59:{c:[119983]}}}}},116:{l:{114:{l:{111:{l:{107:{l:{59:{c:[358]}}}}}}}}}}}}},85:{l:{97:{l:{99:{l:{117:{l:{116:{l:{101:{l:{59:{c:[218]}},c:[218]}}}}}}},114:{l:{114:{l:{59:{c:[8607]},111:{l:{99:{l:{105:{l:{114:{l:{59:{c:[10569]}}}}}}}}}}}}}}},98:{l:{114:{l:{99:{l:{121:{l:{59:{c:[1038]}}}}},101:{l:{118:{l:{101:{l:{59:{c:[364]}}}}}}}}}}},99:{l:{105:{l:{114:{l:{99:{l:{59:{c:[219]}},c:[219]}}}}},121:{l:{59:{c:[1059]}}}}},100:{l:{98:{l:{108:{l:{97:{l:{99:{l:{59:{c:[368]}}}}}}}}}}},102:{l:{114:{l:{59:{c:[120088]}}}}},103:{l:{114:{l:{97:{l:{118:{l:{101:{l:{59:{c:[217]}},c:[217]}}}}}}}}},109:{l:{97:{l:{99:{l:{114:{l:{59:{c:[362]}}}}}}}}},110:{l:{100:{l:{101:{l:{114:{l:{66:{l:{97:{l:{114:{l:{59:{c:[95]}}}}},114:{l:{97:{l:{99:{l:{101:{l:{59:{c:[9183]}}},107:{l:{101:{l:{116:{l:{59:{c:[9141]}}}}}}}}}}}}}}},80:{l:{97:{l:{114:{l:{101:{l:{110:{l:{116:{l:{104:{l:{101:{l:{115:{l:{105:{l:{115:{l:{59:{c:[9181]}}}}}}}}}}}}}}}}}}}}}}}}}}}}},105:{l:{111:{l:{110:{l:{59:{c:[8899]},80:{l:{108:{l:{117:{l:{115:{l:{59:{c:[8846]}}}}}}}}}}}}}}}}},111:{l:{103:{l:{111:{l:{110:{l:{59:{c:[370]}}}}}}},112:{l:{102:{l:{59:{c:[120140]}}}}}}},112:{l:{65:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[8593]},66:{l:{97:{l:{114:{l:{59:{c:[10514]}}}}}}},68:{l:{111:{l:{119:{l:{110:{l:{65:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[8645]}}}}}}}}}}}}}}}}}}}}}}}}}}}}},68:{l:{111:{l:{119:{l:{110:{l:{65:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[8597]}}}}}}}}}}}}}}}}}}},69:{l:{113:{l:{117:{l:{105:{l:{108:{l:{105:{l:{98:{l:{114:{l:{105:{l:{117:{l:{109:{l:{59:{c:[10606]}}}}}}}}}}}}}}}}}}}}}}},84:{l:{101:{l:{101:{l:{59:{c:[8869]},65:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[8613]}}}}}}}}}}}}}}}}},97:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[8657]}}}}}}}}}}},100:{l:{111:{l:{119:{l:{110:{l:{97:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[8661]}}}}}}}}}}}}}}}}}}},112:{l:{101:{l:{114:{l:{76:{l:{101:{l:{102:{l:{116:{l:{65:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[8598]}}}}}}}}}}}}}}}}}}},82:{l:{105:{l:{103:{l:{104:{l:{116:{l:{65:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[8599]}}}}}}}}}}}}}}}}}}}}}}}}}}},115:{l:{105:{l:{59:{c:[978]},108:{l:{111:{l:{110:{l:{59:{c:[933]}}}}}}}}}}}}},114:{l:{105:{l:{110:{l:{103:{l:{59:{c:[366]}}}}}}}}},115:{l:{99:{l:{114:{l:{59:{c:[119984]}}}}}}},116:{l:{105:{l:{108:{l:{100:{l:{101:{l:{59:{c:[360]}}}}}}}}}}},117:{l:{109:{l:{108:{l:{59:{c:[220]}},c:[220]}}}}}}},86:{l:{68:{l:{97:{l:{115:{l:{104:{l:{59:{c:[8875]}}}}}}}}},98:{l:{97:{l:{114:{l:{59:{c:[10987]}}}}}}},99:{l:{121:{l:{59:{c:[1042]}}}}},100:{l:{97:{l:{115:{l:{104:{l:{59:{c:[8873]},108:{l:{59:{c:[10982]}}}}}}}}}}},101:{l:{101:{l:{59:{c:[8897]}}},114:{l:{98:{l:{97:{l:{114:{l:{59:{c:[8214]}}}}}}},116:{l:{59:{c:[8214]},105:{l:{99:{l:{97:{l:{108:{l:{66:{l:{97:{l:{114:{l:{59:{c:[8739]}}}}}}},76:{l:{105:{l:{110:{l:{101:{l:{59:{c:[124]}}}}}}}}},83:{l:{101:{l:{112:{l:{97:{l:{114:{l:{97:{l:{116:{l:{111:{l:{114:{l:{59:{c:[10072]}}}}}}}}}}}}}}}}}}},84:{l:{105:{l:{108:{l:{100:{l:{101:{l:{59:{c:[8768]}}}}}}}}}}}}}}}}}}}}},121:{l:{84:{l:{104:{l:{105:{l:{110:{l:{83:{l:{112:{l:{97:{l:{99:{l:{101:{l:{59:{c:[8202]}}}}}}}}}}}}}}}}}}}}}}}}},102:{l:{114:{l:{59:{c:[120089]}}}}},111:{l:{112:{l:{102:{l:{59:{c:[120141]}}}}}}},115:{l:{99:{l:{114:{l:{59:{c:[119985]}}}}}}},118:{l:{100:{l:{97:{l:{115:{l:{104:{l:{59:{c:[8874]}}}}}}}}}}}}},87:{l:{99:{l:{105:{l:{114:{l:{99:{l:{59:{c:[372]}}}}}}}}},101:{l:{100:{l:{103:{l:{101:{l:{59:{c:[8896]}}}}}}}}},102:{l:{114:{l:{59:{c:[120090]}}}}},111:{l:{112:{l:{102:{l:{59:{c:[120142]}}}}}}},115:{l:{99:{l:{114:{l:{59:{c:[119986]}}}}}}}}},88:{l:{102:{l:{114:{l:{59:{c:[120091]}}}}},105:{l:{59:{c:[926]}}},111:{l:{112:{l:{102:{l:{59:{c:[120143]}}}}}}},115:{l:{99:{l:{114:{l:{59:{c:[119987]}}}}}}}}},89:{l:{65:{l:{99:{l:{121:{l:{59:{c:[1071]}}}}}}},73:{l:{99:{l:{121:{l:{59:{c:[1031]}}}}}}},85:{l:{99:{l:{121:{l:{59:{c:[1070]}}}}}}},97:{l:{99:{l:{117:{l:{116:{l:{101:{l:{59:{c:[221]}},c:[221]}}}}}}}}},99:{l:{105:{l:{114:{l:{99:{l:{59:{c:[374]}}}}}}},121:{l:{59:{c:[1067]}}}}},102:{l:{114:{l:{59:{c:[120092]}}}}},111:{l:{112:{l:{102:{l:{59:{c:[120144]}}}}}}},115:{l:{99:{l:{114:{l:{59:{c:[119988]}}}}}}},117:{l:{109:{l:{108:{l:{59:{c:[376]}}}}}}}}},90:{l:{72:{l:{99:{l:{121:{l:{59:{c:[1046]}}}}}}},97:{l:{99:{l:{117:{l:{116:{l:{101:{l:{59:{c:[377]}}}}}}}}}}},99:{l:{97:{l:{114:{l:{111:{l:{110:{l:{59:{c:[381]}}}}}}}}},121:{l:{59:{c:[1047]}}}}},100:{l:{111:{l:{116:{l:{59:{c:[379]}}}}}}},101:{l:{114:{l:{111:{l:{87:{l:{105:{l:{100:{l:{116:{l:{104:{l:{83:{l:{112:{l:{97:{l:{99:{l:{101:{l:{59:{c:[8203]}}}}}}}}}}}}}}}}}}}}}}}}},116:{l:{97:{l:{59:{c:[918]}}}}}}},102:{l:{114:{l:{59:{c:[8488]}}}}},111:{l:{112:{l:{102:{l:{59:{c:[8484]}}}}}}},115:{l:{99:{l:{114:{l:{59:{c:[119989]}}}}}}}}},97:{l:{97:{l:{99:{l:{117:{l:{116:{l:{101:{l:{59:{c:[225]}},c:[225]}}}}}}}}},98:{l:{114:{l:{101:{l:{118:{l:{101:{l:{59:{c:[259]}}}}}}}}}}},99:{l:{59:{c:[8766]},69:{l:{59:{c:[8766,819]}}},100:{l:{59:{c:[8767]}}},105:{l:{114:{l:{99:{l:{59:{c:[226]}},c:[226]}}}}},117:{l:{116:{l:{101:{l:{59:{c:[180]}},c:[180]}}}}},121:{l:{59:{c:[1072]}}}}},101:{l:{108:{l:{105:{l:{103:{l:{59:{c:[230]}},c:[230]}}}}}}},102:{l:{59:{c:[8289]},114:{l:{59:{c:[120094]}}}}},103:{l:{114:{l:{97:{l:{118:{l:{101:{l:{59:{c:[224]}},c:[224]}}}}}}}}},108:{l:{101:{l:{102:{l:{115:{l:{121:{l:{109:{l:{59:{c:[8501]}}}}}}}}},112:{l:{104:{l:{59:{c:[8501]}}}}}}},112:{l:{104:{l:{97:{l:{59:{c:[945]}}}}}}}}},109:{l:{97:{l:{99:{l:{114:{l:{59:{c:[257]}}}}},108:{l:{103:{l:{59:{c:[10815]}}}}}}},112:{l:{59:{c:[38]}},c:[38]}}},110:{l:{100:{l:{59:{c:[8743]},97:{l:{110:{l:{100:{l:{59:{c:[10837]}}}}}}},100:{l:{59:{c:[10844]}}},115:{l:{108:{l:{111:{l:{112:{l:{101:{l:{59:{c:[10840]}}}}}}}}}}},118:{l:{59:{c:[10842]}}}}},103:{l:{59:{c:[8736]},101:{l:{59:{c:[10660]}}},108:{l:{101:{l:{59:{c:[8736]}}}}},109:{l:{115:{l:{100:{l:{59:{c:[8737]},97:{l:{97:{l:{59:{c:[10664]}}},98:{l:{59:{c:[10665]}}},99:{l:{59:{c:[10666]}}},100:{l:{59:{c:[10667]}}},101:{l:{59:{c:[10668]}}},102:{l:{59:{c:[10669]}}},103:{l:{59:{c:[10670]}}},104:{l:{59:{c:[10671]}}}}}}}}}}},114:{l:{116:{l:{59:{c:[8735]},118:{l:{98:{l:{59:{c:[8894]},100:{l:{59:{c:[10653]}}}}}}}}}}},115:{l:{112:{l:{104:{l:{59:{c:[8738]}}}}},116:{l:{59:{c:[197]}}}}},122:{l:{97:{l:{114:{l:{114:{l:{59:{c:[9084]}}}}}}}}}}}}},111:{l:{103:{l:{111:{l:{110:{l:{59:{c:[261]}}}}}}},112:{l:{102:{l:{59:{c:[120146]}}}}}}},112:{l:{59:{c:[8776]},69:{l:{59:{c:[10864]}}},97:{l:{99:{l:{105:{l:{114:{l:{59:{c:[10863]}}}}}}}}},101:{l:{59:{c:[8778]}}},105:{l:{100:{l:{59:{c:[8779]}}}}},111:{l:{115:{l:{59:{c:[39]}}}}},112:{l:{114:{l:{111:{l:{120:{l:{59:{c:[8776]},101:{l:{113:{l:{59:{c:[8778]}}}}}}}}}}}}}}},114:{l:{105:{l:{110:{l:{103:{l:{59:{c:[229]}},c:[229]}}}}}}},115:{l:{99:{l:{114:{l:{59:{c:[119990]}}}}},116:{l:{59:{c:[42]}}},121:{l:{109:{l:{112:{l:{59:{c:[8776]},101:{l:{113:{l:{59:{c:[8781]}}}}}}}}}}}}},116:{l:{105:{l:{108:{l:{100:{l:{101:{l:{59:{c:[227]}},c:[227]}}}}}}}}},117:{l:{109:{l:{108:{l:{59:{c:[228]}},c:[228]}}}}},119:{l:{99:{l:{111:{l:{110:{l:{105:{l:{110:{l:{116:{l:{59:{c:[8755]}}}}}}}}}}}}},105:{l:{110:{l:{116:{l:{59:{c:[10769]}}}}}}}}}}},98:{l:{78:{l:{111:{l:{116:{l:{59:{c:[10989]}}}}}}},97:{l:{99:{l:{107:{l:{99:{l:{111:{l:{110:{l:{103:{l:{59:{c:[8780]}}}}}}}}},101:{l:{112:{l:{115:{l:{105:{l:{108:{l:{111:{l:{110:{l:{59:{c:[1014]}}}}}}}}}}}}}}},112:{l:{114:{l:{105:{l:{109:{l:{101:{l:{59:{c:[8245]}}}}}}}}}}},115:{l:{105:{l:{109:{l:{59:{c:[8765]},101:{l:{113:{l:{59:{c:[8909]}}}}}}}}}}}}}}},114:{l:{118:{l:{101:{l:{101:{l:{59:{c:[8893]}}}}}}},119:{l:{101:{l:{100:{l:{59:{c:[8965]},103:{l:{101:{l:{59:{c:[8965]}}}}}}}}}}}}}}},98:{l:{114:{l:{107:{l:{59:{c:[9141]},116:{l:{98:{l:{114:{l:{107:{l:{59:{c:[9142]}}}}}}}}}}}}}}},99:{l:{111:{l:{110:{l:{103:{l:{59:{c:[8780]}}}}}}},121:{l:{59:{c:[1073]}}}}},100:{l:{113:{l:{117:{l:{111:{l:{59:{c:[8222]}}}}}}}}},101:{l:{99:{l:{97:{l:{117:{l:{115:{l:{59:{c:[8757]},101:{l:{59:{c:[8757]}}}}}}}}}}},109:{l:{112:{l:{116:{l:{121:{l:{118:{l:{59:{c:[10672]}}}}}}}}}}},112:{l:{115:{l:{105:{l:{59:{c:[1014]}}}}}}},114:{l:{110:{l:{111:{l:{117:{l:{59:{c:[8492]}}}}}}}}},116:{l:{97:{l:{59:{c:[946]}}},104:{l:{59:{c:[8502]}}},119:{l:{101:{l:{101:{l:{110:{l:{59:{c:[8812]}}}}}}}}}}}}},102:{l:{114:{l:{59:{c:[120095]}}}}},105:{l:{103:{l:{99:{l:{97:{l:{112:{l:{59:{c:[8898]}}}}},105:{l:{114:{l:{99:{l:{59:{c:[9711]}}}}}}},117:{l:{112:{l:{59:{c:[8899]}}}}}}},111:{l:{100:{l:{111:{l:{116:{l:{59:{c:[10752]}}}}}}},112:{l:{108:{l:{117:{l:{115:{l:{59:{c:[10753]}}}}}}}}},116:{l:{105:{l:{109:{l:{101:{l:{115:{l:{59:{c:[10754]}}}}}}}}}}}}},115:{l:{113:{l:{99:{l:{117:{l:{112:{l:{59:{c:[10758]}}}}}}}}},116:{l:{97:{l:{114:{l:{59:{c:[9733]}}}}}}}}},116:{l:{114:{l:{105:{l:{97:{l:{110:{l:{103:{l:{108:{l:{101:{l:{100:{l:{111:{l:{119:{l:{110:{l:{59:{c:[9661]}}}}}}}}},117:{l:{112:{l:{59:{c:[9651]}}}}}}}}}}}}}}}}}}}}},117:{l:{112:{l:{108:{l:{117:{l:{115:{l:{59:{c:[10756]}}}}}}}}}}},118:{l:{101:{l:{101:{l:{59:{c:[8897]}}}}}}},119:{l:{101:{l:{100:{l:{103:{l:{101:{l:{59:{c:[8896]}}}}}}}}}}}}}}},107:{l:{97:{l:{114:{l:{111:{l:{119:{l:{59:{c:[10509]}}}}}}}}}}},108:{l:{97:{l:{99:{l:{107:{l:{108:{l:{111:{l:{122:{l:{101:{l:{110:{l:{103:{l:{101:{l:{59:{c:[10731]}}}}}}}}}}}}}}},115:{l:{113:{l:{117:{l:{97:{l:{114:{l:{101:{l:{59:{c:[9642]}}}}}}}}}}}}},116:{l:{114:{l:{105:{l:{97:{l:{110:{l:{103:{l:{108:{l:{101:{l:{59:{c:[9652]},100:{l:{111:{l:{119:{l:{110:{l:{59:{c:[9662]}}}}}}}}},108:{l:{101:{l:{102:{l:{116:{l:{59:{c:[9666]}}}}}}}}},114:{l:{105:{l:{103:{l:{104:{l:{116:{l:{59:{c:[9656]}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},110:{l:{107:{l:{59:{c:[9251]}}}}}}},107:{l:{49:{l:{50:{l:{59:{c:[9618]}}},52:{l:{59:{c:[9617]}}}}},51:{l:{52:{l:{59:{c:[9619]}}}}}}},111:{l:{99:{l:{107:{l:{59:{c:[9608]}}}}}}}}},110:{l:{101:{l:{59:{c:[61,8421]},113:{l:{117:{l:{105:{l:{118:{l:{59:{c:[8801,8421]}}}}}}}}}}},111:{l:{116:{l:{59:{c:[8976]}}}}}}},111:{l:{112:{l:{102:{l:{59:{c:[120147]}}}}},116:{l:{59:{c:[8869]},116:{l:{111:{l:{109:{l:{59:{c:[8869]}}}}}}}}},119:{l:{116:{l:{105:{l:{101:{l:{59:{c:[8904]}}}}}}}}},120:{l:{68:{l:{76:{l:{59:{c:[9559]}}},82:{l:{59:{c:[9556]}}},108:{l:{59:{c:[9558]}}},114:{l:{59:{c:[9555]}}}}},72:{l:{59:{c:[9552]},68:{l:{59:{c:[9574]}}},85:{l:{59:{c:[9577]}}},100:{l:{59:{c:[9572]}}},117:{l:{59:{c:[9575]}}}}},85:{l:{76:{l:{59:{c:[9565]}}},82:{l:{59:{c:[9562]}}},108:{l:{59:{c:[9564]}}},114:{l:{59:{c:[9561]}}}}},86:{l:{59:{c:[9553]},72:{l:{59:{c:[9580]}}},76:{l:{59:{c:[9571]}}},82:{l:{59:{c:[9568]}}},104:{l:{59:{c:[9579]}}},108:{l:{59:{c:[9570]}}},114:{l:{59:{c:[9567]}}}}},98:{l:{111:{l:{120:{l:{59:{c:[10697]}}}}}}},100:{l:{76:{l:{59:{c:[9557]}}},82:{l:{59:{c:[9554]}}},108:{l:{59:{c:[9488]}}},114:{l:{59:{c:[9484]}}}}},104:{l:{59:{c:[9472]},68:{l:{59:{c:[9573]}}},85:{l:{59:{c:[9576]}}},100:{l:{59:{c:[9516]}}},117:{l:{59:{c:[9524]}}}}},109:{l:{105:{l:{110:{l:{117:{l:{115:{l:{59:{c:[8863]}}}}}}}}}}},112:{l:{108:{l:{117:{l:{115:{l:{59:{c:[8862]}}}}}}}}},116:{l:{105:{l:{109:{l:{101:{l:{115:{l:{59:{c:[8864]}}}}}}}}}}},117:{l:{76:{l:{59:{c:[9563]}}},82:{l:{59:{c:[9560]}}},108:{l:{59:{c:[9496]}}},114:{l:{59:{c:[9492]}}}}},118:{l:{59:{c:[9474]},72:{l:{59:{c:[9578]}}},76:{l:{59:{c:[9569]}}},82:{l:{59:{c:[9566]}}},104:{l:{59:{c:[9532]}}},108:{l:{59:{c:[9508]}}},114:{l:{59:{c:[9500]}}}}}}}}},112:{l:{114:{l:{105:{l:{109:{l:{101:{l:{59:{c:[8245]}}}}}}}}}}},114:{l:{101:{l:{118:{l:{101:{l:{59:{c:[728]}}}}}}},118:{l:{98:{l:{97:{l:{114:{l:{59:{c:[166]}},c:[166]}}}}}}}}},115:{l:{99:{l:{114:{l:{59:{c:[119991]}}}}},101:{l:{109:{l:{105:{l:{59:{c:[8271]}}}}}}},105:{l:{109:{l:{59:{c:[8765]},101:{l:{59:{c:[8909]}}}}}}},111:{l:{108:{l:{59:{c:[92]},98:{l:{59:{c:[10693]}}},104:{l:{115:{l:{117:{l:{98:{l:{59:{c:[10184]}}}}}}}}}}}}}}},117:{l:{108:{l:{108:{l:{59:{c:[8226]},101:{l:{116:{l:{59:{c:[8226]}}}}}}}}},109:{l:{112:{l:{59:{c:[8782]},69:{l:{59:{c:[10926]}}},101:{l:{59:{c:[8783]},113:{l:{59:{c:[8783]}}}}}}}}}}}}},99:{l:{97:{l:{99:{l:{117:{l:{116:{l:{101:{l:{59:{c:[263]}}}}}}}}},112:{l:{59:{c:[8745]},97:{l:{110:{l:{100:{l:{59:{c:[10820]}}}}}}},98:{l:{114:{l:{99:{l:{117:{l:{112:{l:{59:{c:[10825]}}}}}}}}}}},99:{l:{97:{l:{112:{l:{59:{c:[10827]}}}}},117:{l:{112:{l:{59:{c:[10823]}}}}}}},100:{l:{111:{l:{116:{l:{59:{c:[10816]}}}}}}},115:{l:{59:{c:[8745,65024]}}}}},114:{l:{101:{l:{116:{l:{59:{c:[8257]}}}}},111:{l:{110:{l:{59:{c:[711]}}}}}}}}},99:{l:{97:{l:{112:{l:{115:{l:{59:{c:[10829]}}}}},114:{l:{111:{l:{110:{l:{59:{c:[269]}}}}}}}}},101:{l:{100:{l:{105:{l:{108:{l:{59:{c:[231]}},c:[231]}}}}}}},105:{l:{114:{l:{99:{l:{59:{c:[265]}}}}}}},117:{l:{112:{l:{115:{l:{59:{c:[10828]},115:{l:{109:{l:{59:{c:[10832]}}}}}}}}}}}}},100:{l:{111:{l:{116:{l:{59:{c:[267]}}}}}}},101:{l:{100:{l:{105:{l:{108:{l:{59:{c:[184]}},c:[184]}}}}},109:{l:{112:{l:{116:{l:{121:{l:{118:{l:{59:{c:[10674]}}}}}}}}}}},110:{l:{116:{l:{59:{c:[162]},101:{l:{114:{l:{100:{l:{111:{l:{116:{l:{59:{c:[183]}}}}}}}}}}}},c:[162]}}}}},102:{l:{114:{l:{59:{c:[120096]}}}}},104:{l:{99:{l:{121:{l:{59:{c:[1095]}}}}},101:{l:{99:{l:{107:{l:{59:{c:[10003]},109:{l:{97:{l:{114:{l:{107:{l:{59:{c:[10003]}}}}}}}}}}}}}}},105:{l:{59:{c:[967]}}}}},105:{l:{114:{l:{59:{c:[9675]},69:{l:{59:{c:[10691]}}},99:{l:{59:{c:[710]},101:{l:{113:{l:{59:{c:[8791]}}}}},108:{l:{101:{l:{97:{l:{114:{l:{114:{l:{111:{l:{119:{l:{108:{l:{101:{l:{102:{l:{116:{l:{59:{c:[8634]}}}}}}}}},114:{l:{105:{l:{103:{l:{104:{l:{116:{l:{59:{c:[8635]}}}}}}}}}}}}}}}}}}}}},100:{l:{82:{l:{59:{c:[174]}}},83:{l:{59:{c:[9416]}}},97:{l:{115:{l:{116:{l:{59:{c:[8859]}}}}}}},99:{l:{105:{l:{114:{l:{99:{l:{59:{c:[8858]}}}}}}}}},100:{l:{97:{l:{115:{l:{104:{l:{59:{c:[8861]}}}}}}}}}}}}}}}}},101:{l:{59:{c:[8791]}}},102:{l:{110:{l:{105:{l:{110:{l:{116:{l:{59:{c:[10768]}}}}}}}}}}},109:{l:{105:{l:{100:{l:{59:{c:[10991]}}}}}}},115:{l:{99:{l:{105:{l:{114:{l:{59:{c:[10690]}}}}}}}}}}}}},108:{l:{117:{l:{98:{l:{115:{l:{59:{c:[9827]},117:{l:{105:{l:{116:{l:{59:{c:[9827]}}}}}}}}}}}}}}},111:{l:{108:{l:{111:{l:{110:{l:{59:{c:[58]},101:{l:{59:{c:[8788]},113:{l:{59:{c:[8788]}}}}}}}}}}},109:{l:{109:{l:{97:{l:{59:{c:[44]},116:{l:{59:{c:[64]}}}}}}},112:{l:{59:{c:[8705]},102:{l:{110:{l:{59:{c:[8728]}}}}},108:{l:{101:{l:{109:{l:{101:{l:{110:{l:{116:{l:{59:{c:[8705]}}}}}}}}},120:{l:{101:{l:{115:{l:{59:{c:[8450]}}}}}}}}}}}}}}},110:{l:{103:{l:{59:{c:[8773]},100:{l:{111:{l:{116:{l:{59:{c:[10861]}}}}}}}}},105:{l:{110:{l:{116:{l:{59:{c:[8750]}}}}}}}}},112:{l:{102:{l:{59:{c:[120148]}}},114:{l:{111:{l:{100:{l:{59:{c:[8720]}}}}}}},121:{l:{59:{c:[169]},115:{l:{114:{l:{59:{c:[8471]}}}}}},c:[169]}}}}},114:{l:{97:{l:{114:{l:{114:{l:{59:{c:[8629]}}}}}}},111:{l:{115:{l:{115:{l:{59:{c:[10007]}}}}}}}}},115:{l:{99:{l:{114:{l:{59:{c:[119992]}}}}},117:{l:{98:{l:{59:{c:[10959]},101:{l:{59:{c:[10961]}}}}},112:{l:{59:{c:[10960]},101:{l:{59:{c:[10962]}}}}}}}}},116:{l:{100:{l:{111:{l:{116:{l:{59:{c:[8943]}}}}}}}}},117:{l:{100:{l:{97:{l:{114:{l:{114:{l:{108:{l:{59:{c:[10552]}}},114:{l:{59:{c:[10549]}}}}}}}}}}},101:{l:{112:{l:{114:{l:{59:{c:[8926]}}}}},115:{l:{99:{l:{59:{c:[8927]}}}}}}},108:{l:{97:{l:{114:{l:{114:{l:{59:{c:[8630]},112:{l:{59:{c:[10557]}}}}}}}}}}},112:{l:{59:{c:[8746]},98:{l:{114:{l:{99:{l:{97:{l:{112:{l:{59:{c:[10824]}}}}}}}}}}},99:{l:{97:{l:{112:{l:{59:{c:[10822]}}}}},117:{l:{112:{l:{59:{c:[10826]}}}}}}},100:{l:{111:{l:{116:{l:{59:{c:[8845]}}}}}}},111:{l:{114:{l:{59:{c:[10821]}}}}},115:{l:{59:{c:[8746,65024]}}}}},114:{l:{97:{l:{114:{l:{114:{l:{59:{c:[8631]},109:{l:{59:{c:[10556]}}}}}}}}},108:{l:{121:{l:{101:{l:{113:{l:{112:{l:{114:{l:{101:{l:{99:{l:{59:{c:[8926]}}}}}}}}},115:{l:{117:{l:{99:{l:{99:{l:{59:{c:[8927]}}}}}}}}}}}}},118:{l:{101:{l:{101:{l:{59:{c:[8910]}}}}}}},119:{l:{101:{l:{100:{l:{103:{l:{101:{l:{59:{c:[8911]}}}}}}}}}}}}}}},114:{l:{101:{l:{110:{l:{59:{c:[164]}},c:[164]}}}}},118:{l:{101:{l:{97:{l:{114:{l:{114:{l:{111:{l:{119:{l:{108:{l:{101:{l:{102:{l:{116:{l:{59:{c:[8630]}}}}}}}}},114:{l:{105:{l:{103:{l:{104:{l:{116:{l:{59:{c:[8631]}}}}}}}}}}}}}}}}}}}}}}}}}}},118:{l:{101:{l:{101:{l:{59:{c:[8910]}}}}}}},119:{l:{101:{l:{100:{l:{59:{c:[8911]}}}}}}}}},119:{l:{99:{l:{111:{l:{110:{l:{105:{l:{110:{l:{116:{l:{59:{c:[8754]}}}}}}}}}}}}},105:{l:{110:{l:{116:{l:{59:{c:[8753]}}}}}}}}},121:{l:{108:{l:{99:{l:{116:{l:{121:{l:{59:{c:[9005]}}}}}}}}}}}}},100:{l:{65:{l:{114:{l:{114:{l:{59:{c:[8659]}}}}}}},72:{l:{97:{l:{114:{l:{59:{c:[10597]}}}}}}},97:{l:{103:{l:{103:{l:{101:{l:{114:{l:{59:{c:[8224]}}}}}}}}},108:{l:{101:{l:{116:{l:{104:{l:{59:{c:[8504]}}}}}}}}},114:{l:{114:{l:{59:{c:[8595]}}}}},115:{l:{104:{l:{59:{c:[8208]},118:{l:{59:{c:[8867]}}}}}}}}},98:{l:{107:{l:{97:{l:{114:{l:{111:{l:{119:{l:{59:{c:[10511]}}}}}}}}}}},108:{l:{97:{l:{99:{l:{59:{c:[733]}}}}}}}}},99:{l:{97:{l:{114:{l:{111:{l:{110:{l:{59:{c:[271]}}}}}}}}},121:{l:{59:{c:[1076]}}}}},100:{l:{59:{c:[8518]},97:{l:{103:{l:{103:{l:{101:{l:{114:{l:{59:{c:[8225]}}}}}}}}},114:{l:{114:{l:{59:{c:[8650]}}}}}}},111:{l:{116:{l:{115:{l:{101:{l:{113:{l:{59:{c:[10871]}}}}}}}}}}}}},101:{l:{103:{l:{59:{c:[176]}},c:[176]},108:{l:{116:{l:{97:{l:{59:{c:[948]}}}}}}},109:{l:{112:{l:{116:{l:{121:{l:{118:{l:{59:{c:[10673]}}}}}}}}}}}}},102:{l:{105:{l:{115:{l:{104:{l:{116:{l:{59:{c:[10623]}}}}}}}}},114:{l:{59:{c:[120097]}}}}},104:{l:{97:{l:{114:{l:{108:{l:{59:{c:[8643]}}},114:{l:{59:{c:[8642]}}}}}}}}},105:{l:{97:{l:{109:{l:{59:{c:[8900]},111:{l:{110:{l:{100:{l:{59:{c:[8900]},115:{l:{117:{l:{105:{l:{116:{l:{59:{c:[9830]}}}}}}}}}}}}}}},115:{l:{59:{c:[9830]}}}}}}},101:{l:{59:{c:[168]}}},103:{l:{97:{l:{109:{l:{109:{l:{97:{l:{59:{c:[989]}}}}}}}}}}},115:{l:{105:{l:{110:{l:{59:{c:[8946]}}}}}}},118:{l:{59:{c:[247]},105:{l:{100:{l:{101:{l:{59:{c:[247]},111:{l:{110:{l:{116:{l:{105:{l:{109:{l:{101:{l:{115:{l:{59:{c:[8903]}}}}}}}}}}}}}}}},c:[247]}}}}},111:{l:{110:{l:{120:{l:{59:{c:[8903]}}}}}}}}}}},106:{l:{99:{l:{121:{l:{59:{c:[1106]}}}}}}},108:{l:{99:{l:{111:{l:{114:{l:{110:{l:{59:{c:[8990]}}}}}}},114:{l:{111:{l:{112:{l:{59:{c:[8973]}}}}}}}}}}},111:{l:{108:{l:{108:{l:{97:{l:{114:{l:{59:{c:[36]}}}}}}}}},112:{l:{102:{l:{59:{c:[120149]}}}}},116:{l:{59:{c:[729]},101:{l:{113:{l:{59:{c:[8784]},100:{l:{111:{l:{116:{l:{59:{c:[8785]}}}}}}}}}}},109:{l:{105:{l:{110:{l:{117:{l:{115:{l:{59:{c:[8760]}}}}}}}}}}},112:{l:{108:{l:{117:{l:{115:{l:{59:{c:[8724]}}}}}}}}},115:{l:{113:{l:{117:{l:{97:{l:{114:{l:{101:{l:{59:{c:[8865]}}}}}}}}}}}}}}},117:{l:{98:{l:{108:{l:{101:{l:{98:{l:{97:{l:{114:{l:{119:{l:{101:{l:{100:{l:{103:{l:{101:{l:{59:{c:[8966]}}}}}}}}}}}}}}}}}}}}}}}}},119:{l:{110:{l:{97:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[8595]}}}}}}}}}}},100:{l:{111:{l:{119:{l:{110:{l:{97:{l:{114:{l:{114:{l:{111:{l:{119:{l:{115:{l:{59:{c:[8650]}}}}}}}}}}}}}}}}}}}}},104:{l:{97:{l:{114:{l:{112:{l:{111:{l:{111:{l:{110:{l:{108:{l:{101:{l:{102:{l:{116:{l:{59:{c:[8643]}}}}}}}}},114:{l:{105:{l:{103:{l:{104:{l:{116:{l:{59:{c:[8642]}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},114:{l:{98:{l:{107:{l:{97:{l:{114:{l:{111:{l:{119:{l:{59:{c:[10512]}}}}}}}}}}}}},99:{l:{111:{l:{114:{l:{110:{l:{59:{c:[8991]}}}}}}},114:{l:{111:{l:{112:{l:{59:{c:[8972]}}}}}}}}}}},115:{l:{99:{l:{114:{l:{59:{c:[119993]}}},121:{l:{59:{c:[1109]}}}}},111:{l:{108:{l:{59:{c:[10742]}}}}},116:{l:{114:{l:{111:{l:{107:{l:{59:{c:[273]}}}}}}}}}}},116:{l:{100:{l:{111:{l:{116:{l:{59:{c:[8945]}}}}}}},114:{l:{105:{l:{59:{c:[9663]},102:{l:{59:{c:[9662]}}}}}}}}},117:{l:{97:{l:{114:{l:{114:{l:{59:{c:[8693]}}}}}}},104:{l:{97:{l:{114:{l:{59:{c:[10607]}}}}}}}}},119:{l:{97:{l:{110:{l:{103:{l:{108:{l:{101:{l:{59:{c:[10662]}}}}}}}}}}}}},122:{l:{99:{l:{121:{l:{59:{c:[1119]}}}}},105:{l:{103:{l:{114:{l:{97:{l:{114:{l:{114:{l:{59:{c:[10239]}}}}}}}}}}}}}}}}},101:{l:{68:{l:{68:{l:{111:{l:{116:{l:{59:{c:[10871]}}}}}}},111:{l:{116:{l:{59:{c:[8785]}}}}}}},97:{l:{99:{l:{117:{l:{116:{l:{101:{l:{59:{c:[233]}},c:[233]}}}}}}},115:{l:{116:{l:{101:{l:{114:{l:{59:{c:[10862]}}}}}}}}}}},99:{l:{97:{l:{114:{l:{111:{l:{110:{l:{59:{c:[283]}}}}}}}}},105:{l:{114:{l:{59:{c:[8790]},99:{l:{59:{c:[234]}},c:[234]}}}}},111:{l:{108:{l:{111:{l:{110:{l:{59:{c:[8789]}}}}}}}}},121:{l:{59:{c:[1101]}}}}},100:{l:{111:{l:{116:{l:{59:{c:[279]}}}}}}},101:{l:{59:{c:[8519]}}},102:{l:{68:{l:{111:{l:{116:{l:{59:{c:[8786]}}}}}}},114:{l:{59:{c:[120098]}}}}},103:{l:{59:{c:[10906]},114:{l:{97:{l:{118:{l:{101:{l:{59:{c:[232]}},c:[232]}}}}}}},115:{l:{59:{c:[10902]},100:{l:{111:{l:{116:{l:{59:{c:[10904]}}}}}}}}}}},108:{l:{59:{c:[10905]},105:{l:{110:{l:{116:{l:{101:{l:{114:{l:{115:{l:{59:{c:[9191]}}}}}}}}}}}}},108:{l:{59:{c:[8467]}}},115:{l:{59:{c:[10901]},100:{l:{111:{l:{116:{l:{59:{c:[10903]}}}}}}}}}}},109:{l:{97:{l:{99:{l:{114:{l:{59:{c:[275]}}}}}}},112:{l:{116:{l:{121:{l:{59:{c:[8709]},115:{l:{101:{l:{116:{l:{59:{c:[8709]}}}}}}},118:{l:{59:{c:[8709]}}}}}}}}},115:{l:{112:{l:{49:{l:{51:{l:{59:{c:[8196]}}},52:{l:{59:{c:[8197]}}}}},59:{c:[8195]}}}}}}},110:{l:{103:{l:{59:{c:[331]}}},115:{l:{112:{l:{59:{c:[8194]}}}}}}},111:{l:{103:{l:{111:{l:{110:{l:{59:{c:[281]}}}}}}},112:{l:{102:{l:{59:{c:[120150]}}}}}}},112:{l:{97:{l:{114:{l:{59:{c:[8917]},115:{l:{108:{l:{59:{c:[10723]}}}}}}}}},108:{l:{117:{l:{115:{l:{59:{c:[10865]}}}}}}},115:{l:{105:{l:{59:{c:[949]},108:{l:{111:{l:{110:{l:{59:{c:[949]}}}}}}},118:{l:{59:{c:[1013]}}}}}}}}},113:{l:{99:{l:{105:{l:{114:{l:{99:{l:{59:{c:[8790]}}}}}}},111:{l:{108:{l:{111:{l:{110:{l:{59:{c:[8789]}}}}}}}}}}},115:{l:{105:{l:{109:{l:{59:{c:[8770]}}}}},108:{l:{97:{l:{110:{l:{116:{l:{103:{l:{116:{l:{114:{l:{59:{c:[10902]}}}}}}},108:{l:{101:{l:{115:{l:{115:{l:{59:{c:[10901]}}}}}}}}}}}}}}}}}}},117:{l:{97:{l:{108:{l:{115:{l:{59:{c:[61]}}}}}}},101:{l:{115:{l:{116:{l:{59:{c:[8799]}}}}}}},105:{l:{118:{l:{59:{c:[8801]},68:{l:{68:{l:{59:{c:[10872]}}}}}}}}}}},118:{l:{112:{l:{97:{l:{114:{l:{115:{l:{108:{l:{59:{c:[10725]}}}}}}}}}}}}}}},114:{l:{68:{l:{111:{l:{116:{l:{59:{c:[8787]}}}}}}},97:{l:{114:{l:{114:{l:{59:{c:[10609]}}}}}}}}},115:{l:{99:{l:{114:{l:{59:{c:[8495]}}}}},100:{l:{111:{l:{116:{l:{59:{c:[8784]}}}}}}},105:{l:{109:{l:{59:{c:[8770]}}}}}}},116:{l:{97:{l:{59:{c:[951]}}},104:{l:{59:{c:[240]}},c:[240]}}},117:{l:{109:{l:{108:{l:{59:{c:[235]}},c:[235]}}},114:{l:{111:{l:{59:{c:[8364]}}}}}}},120:{l:{99:{l:{108:{l:{59:{c:[33]}}}}},105:{l:{115:{l:{116:{l:{59:{c:[8707]}}}}}}},112:{l:{101:{l:{99:{l:{116:{l:{97:{l:{116:{l:{105:{l:{111:{l:{110:{l:{59:{c:[8496]}}}}}}}}}}}}}}}}},111:{l:{110:{l:{101:{l:{110:{l:{116:{l:{105:{l:{97:{l:{108:{l:{101:{l:{59:{c:[8519]}}}}}}}}}}}}}}}}}}}}}}}}},102:{l:{97:{l:{108:{l:{108:{l:{105:{l:{110:{l:{103:{l:{100:{l:{111:{l:{116:{l:{115:{l:{101:{l:{113:{l:{59:{c:[8786]}}}}}}}}}}}}}}}}}}}}}}}}},99:{l:{121:{l:{59:{c:[1092]}}}}},101:{l:{109:{l:{97:{l:{108:{l:{101:{l:{59:{c:[9792]}}}}}}}}}}},102:{l:{105:{l:{108:{l:{105:{l:{103:{l:{59:{c:[64259]}}}}}}}}},108:{l:{105:{l:{103:{l:{59:{c:[64256]}}}}},108:{l:{105:{l:{103:{l:{59:{c:[64260]}}}}}}}}},114:{l:{59:{c:[120099]}}}}},105:{l:{108:{l:{105:{l:{103:{l:{59:{c:[64257]}}}}}}}}},106:{l:{108:{l:{105:{l:{103:{l:{59:{c:[102,106]}}}}}}}}},108:{l:{97:{l:{116:{l:{59:{c:[9837]}}}}},108:{l:{105:{l:{103:{l:{59:{c:[64258]}}}}}}},116:{l:{110:{l:{115:{l:{59:{c:[9649]}}}}}}}}},110:{l:{111:{l:{102:{l:{59:{c:[402]}}}}}}},111:{l:{112:{l:{102:{l:{59:{c:[120151]}}}}},114:{l:{97:{l:{108:{l:{108:{l:{59:{c:[8704]}}}}}}},107:{l:{59:{c:[8916]},118:{l:{59:{c:[10969]}}}}}}}}},112:{l:{97:{l:{114:{l:{116:{l:{105:{l:{110:{l:{116:{l:{59:{c:[10765]}}}}}}}}}}}}}}},114:{l:{97:{l:{99:{l:{49:{l:{50:{l:{59:{c:[189]}},c:[189]},51:{l:{59:{c:[8531]}}},52:{l:{59:{c:[188]}},c:[188]},53:{l:{59:{c:[8533]}}},54:{l:{59:{c:[8537]}}},56:{l:{59:{c:[8539]}}}}},50:{l:{51:{l:{59:{c:[8532]}}},53:{l:{59:{c:[8534]}}}}},51:{l:{52:{l:{59:{c:[190]}},c:[190]},53:{l:{59:{c:[8535]}}},56:{l:{59:{c:[8540]}}}}},52:{l:{53:{l:{59:{c:[8536]}}}}},53:{l:{54:{l:{59:{c:[8538]}}},56:{l:{59:{c:[8541]}}}}},55:{l:{56:{l:{59:{c:[8542]}}}}}}},115:{l:{108:{l:{59:{c:[8260]}}}}}}},111:{l:{119:{l:{110:{l:{59:{c:[8994]}}}}}}}}},115:{l:{99:{l:{114:{l:{59:{c:[119995]}}}}}}}}},103:{l:{69:{l:{59:{c:[8807]},108:{l:{59:{c:[10892]}}}}},97:{l:{99:{l:{117:{l:{116:{l:{101:{l:{59:{c:[501]}}}}}}}}},109:{l:{109:{l:{97:{l:{59:{c:[947]},100:{l:{59:{c:[989]}}}}}}}}},112:{l:{59:{c:[10886]}}}}},98:{l:{114:{l:{101:{l:{118:{l:{101:{l:{59:{c:[287]}}}}}}}}}}},99:{l:{105:{l:{114:{l:{99:{l:{59:{c:[285]}}}}}}},121:{l:{59:{c:[1075]}}}}},100:{l:{111:{l:{116:{l:{59:{c:[289]}}}}}}},101:{l:{59:{c:[8805]},108:{l:{59:{c:[8923]}}},113:{l:{59:{c:[8805]},113:{l:{59:{c:[8807]}}},115:{l:{108:{l:{97:{l:{110:{l:{116:{l:{59:{c:[10878]}}}}}}}}}}}}},115:{l:{59:{c:[10878]},99:{l:{99:{l:{59:{c:[10921]}}}}},100:{l:{111:{l:{116:{l:{59:{c:[10880]},111:{l:{59:{c:[10882]},108:{l:{59:{c:[10884]}}}}}}}}}}},108:{l:{59:{c:[8923,65024]},101:{l:{115:{l:{59:{c:[10900]}}}}}}}}}}},102:{l:{114:{l:{59:{c:[120100]}}}}},103:{l:{59:{c:[8811]},103:{l:{59:{c:[8921]}}}}},105:{l:{109:{l:{101:{l:{108:{l:{59:{c:[8503]}}}}}}}}},106:{l:{99:{l:{121:{l:{59:{c:[1107]}}}}}}},108:{l:{59:{c:[8823]},69:{l:{59:{c:[10898]}}},97:{l:{59:{c:[10917]}}},106:{l:{59:{c:[10916]}}}}},110:{l:{69:{l:{59:{c:[8809]}}},97:{l:{112:{l:{59:{c:[10890]},112:{l:{114:{l:{111:{l:{120:{l:{59:{c:[10890]}}}}}}}}}}}}},101:{l:{59:{c:[10888]},113:{l:{59:{c:[10888]},113:{l:{59:{c:[8809]}}}}}}},115:{l:{105:{l:{109:{l:{59:{c:[8935]}}}}}}}}},111:{l:{112:{l:{102:{l:{59:{c:[120152]}}}}}}},114:{l:{97:{l:{118:{l:{101:{l:{59:{c:[96]}}}}}}}}},115:{l:{99:{l:{114:{l:{59:{c:[8458]}}}}},105:{l:{109:{l:{59:{c:[8819]},101:{l:{59:{c:[10894]}}},108:{l:{59:{c:[10896]}}}}}}}}},116:{l:{59:{c:[62]},99:{l:{99:{l:{59:{c:[10919]}}},105:{l:{114:{l:{59:{c:[10874]}}}}}}},100:{l:{111:{l:{116:{l:{59:{c:[8919]}}}}}}},108:{l:{80:{l:{97:{l:{114:{l:{59:{c:[10645]}}}}}}}}},113:{l:{117:{l:{101:{l:{115:{l:{116:{l:{59:{c:[10876]}}}}}}}}}}},114:{l:{97:{l:{112:{l:{112:{l:{114:{l:{111:{l:{120:{l:{59:{c:[10886]}}}}}}}}}}},114:{l:{114:{l:{59:{c:[10616]}}}}}}},100:{l:{111:{l:{116:{l:{59:{c:[8919]}}}}}}},101:{l:{113:{l:{108:{l:{101:{l:{115:{l:{115:{l:{59:{c:[8923]}}}}}}}}},113:{l:{108:{l:{101:{l:{115:{l:{115:{l:{59:{c:[10892]}}}}}}}}}}}}}}},108:{l:{101:{l:{115:{l:{115:{l:{59:{c:[8823]}}}}}}}}},115:{l:{105:{l:{109:{l:{59:{c:[8819]}}}}}}}}}},c:[62]},118:{l:{101:{l:{114:{l:{116:{l:{110:{l:{101:{l:{113:{l:{113:{l:{59:{c:[8809,65024]}}}}}}}}}}}}}}},110:{l:{69:{l:{59:{c:[8809,65024]}}}}}}}}},104:{l:{65:{l:{114:{l:{114:{l:{59:{c:[8660]}}}}}}},97:{l:{105:{l:{114:{l:{115:{l:{112:{l:{59:{c:[8202]}}}}}}}}},108:{l:{102:{l:{59:{c:[189]}}}}},109:{l:{105:{l:{108:{l:{116:{l:{59:{c:[8459]}}}}}}}}},114:{l:{100:{l:{99:{l:{121:{l:{59:{c:[1098]}}}}}}},114:{l:{59:{c:[8596]},99:{l:{105:{l:{114:{l:{59:{c:[10568]}}}}}}},119:{l:{59:{c:[8621]}}}}}}}}},98:{l:{97:{l:{114:{l:{59:{c:[8463]}}}}}}},99:{l:{105:{l:{114:{l:{99:{l:{59:{c:[293]}}}}}}}}},101:{l:{97:{l:{114:{l:{116:{l:{115:{l:{59:{c:[9829]},117:{l:{105:{l:{116:{l:{59:{c:[9829]}}}}}}}}}}}}}}},108:{l:{108:{l:{105:{l:{112:{l:{59:{c:[8230]}}}}}}}}},114:{l:{99:{l:{111:{l:{110:{l:{59:{c:[8889]}}}}}}}}}}},102:{l:{114:{l:{59:{c:[120101]}}}}},107:{l:{115:{l:{101:{l:{97:{l:{114:{l:{111:{l:{119:{l:{59:{c:[10533]}}}}}}}}}}},119:{l:{97:{l:{114:{l:{111:{l:{119:{l:{59:{c:[10534]}}}}}}}}}}}}}}},111:{l:{97:{l:{114:{l:{114:{l:{59:{c:[8703]}}}}}}},109:{l:{116:{l:{104:{l:{116:{l:{59:{c:[8763]}}}}}}}}},111:{l:{107:{l:{108:{l:{101:{l:{102:{l:{116:{l:{97:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[8617]}}}}}}}}}}}}}}}}}}},114:{l:{105:{l:{103:{l:{104:{l:{116:{l:{97:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[8618]}}}}}}}}}}}}}}}}}}}}}}}}},112:{l:{102:{l:{59:{c:[120153]}}}}},114:{l:{98:{l:{97:{l:{114:{l:{59:{c:[8213]}}}}}}}}}}},115:{l:{99:{l:{114:{l:{59:{c:[119997]}}}}},108:{l:{97:{l:{115:{l:{104:{l:{59:{c:[8463]}}}}}}}}},116:{l:{114:{l:{111:{l:{107:{l:{59:{c:[295]}}}}}}}}}}},121:{l:{98:{l:{117:{l:{108:{l:{108:{l:{59:{c:[8259]}}}}}}}}},112:{l:{104:{l:{101:{l:{110:{l:{59:{c:[8208]}}}}}}}}}}}}},105:{l:{97:{l:{99:{l:{117:{l:{116:{l:{101:{l:{59:{c:[237]}},c:[237]}}}}}}}}},99:{l:{59:{c:[8291]},105:{l:{114:{l:{99:{l:{59:{c:[238]}},c:[238]}}}}},121:{l:{59:{c:[1080]}}}}},101:{l:{99:{l:{121:{l:{59:{c:[1077]}}}}},120:{l:{99:{l:{108:{l:{59:{c:[161]}},c:[161]}}}}}}},102:{l:{102:{l:{59:{c:[8660]}}},114:{l:{59:{c:[120102]}}}}},103:{l:{114:{l:{97:{l:{118:{l:{101:{l:{59:{c:[236]}},c:[236]}}}}}}}}},105:{l:{59:{c:[8520]},105:{l:{105:{l:{110:{l:{116:{l:{59:{c:[10764]}}}}}}},110:{l:{116:{l:{59:{c:[8749]}}}}}}},110:{l:{102:{l:{105:{l:{110:{l:{59:{c:[10716]}}}}}}}}},111:{l:{116:{l:{97:{l:{59:{c:[8489]}}}}}}}}},106:{l:{108:{l:{105:{l:{103:{l:{59:{c:[307]}}}}}}}}},109:{l:{97:{l:{99:{l:{114:{l:{59:{c:[299]}}}}},103:{l:{101:{l:{59:{c:[8465]}}},108:{l:{105:{l:{110:{l:{101:{l:{59:{c:[8464]}}}}}}}}},112:{l:{97:{l:{114:{l:{116:{l:{59:{c:[8465]}}}}}}}}}}},116:{l:{104:{l:{59:{c:[305]}}}}}}},111:{l:{102:{l:{59:{c:[8887]}}}}},112:{l:{101:{l:{100:{l:{59:{c:[437]}}}}}}}}},110:{l:{59:{c:[8712]},99:{l:{97:{l:{114:{l:{101:{l:{59:{c:[8453]}}}}}}}}},102:{l:{105:{l:{110:{l:{59:{c:[8734]},116:{l:{105:{l:{101:{l:{59:{c:[10717]}}}}}}}}}}}}},111:{l:{100:{l:{111:{l:{116:{l:{59:{c:[305]}}}}}}}}},116:{l:{59:{c:[8747]},99:{l:{97:{l:{108:{l:{59:{c:[8890]}}}}}}},101:{l:{103:{l:{101:{l:{114:{l:{115:{l:{59:{c:[8484]}}}}}}}}},114:{l:{99:{l:{97:{l:{108:{l:{59:{c:[8890]}}}}}}}}}}},108:{l:{97:{l:{114:{l:{104:{l:{107:{l:{59:{c:[10775]}}}}}}}}}}},112:{l:{114:{l:{111:{l:{100:{l:{59:{c:[10812]}}}}}}}}}}}}},111:{l:{99:{l:{121:{l:{59:{c:[1105]}}}}},103:{l:{111:{l:{110:{l:{59:{c:[303]}}}}}}},112:{l:{102:{l:{59:{c:[120154]}}}}},116:{l:{97:{l:{59:{c:[953]}}}}}}},112:{l:{114:{l:{111:{l:{100:{l:{59:{c:[10812]}}}}}}}}},113:{l:{117:{l:{101:{l:{115:{l:{116:{l:{59:{c:[191]}},c:[191]}}}}}}}}},115:{l:{99:{l:{114:{l:{59:{c:[119998]}}}}},105:{l:{110:{l:{59:{c:[8712]},69:{l:{59:{c:[8953]}}},100:{l:{111:{l:{116:{l:{59:{c:[8949]}}}}}}},115:{l:{59:{c:[8948]},118:{l:{59:{c:[8947]}}}}},118:{l:{59:{c:[8712]}}}}}}}}},116:{l:{59:{c:[8290]},105:{l:{108:{l:{100:{l:{101:{l:{59:{c:[297]}}}}}}}}}}},117:{l:{107:{l:{99:{l:{121:{l:{59:{c:[1110]}}}}}}},109:{l:{108:{l:{59:{c:[239]}},c:[239]}}}}}}},106:{l:{99:{l:{105:{l:{114:{l:{99:{l:{59:{c:[309]}}}}}}},121:{l:{59:{c:[1081]}}}}},102:{l:{114:{l:{59:{c:[120103]}}}}},109:{l:{97:{l:{116:{l:{104:{l:{59:{c:[567]}}}}}}}}},111:{l:{112:{l:{102:{l:{59:{c:[120155]}}}}}}},115:{l:{99:{l:{114:{l:{59:{c:[119999]}}}}},101:{l:{114:{l:{99:{l:{121:{l:{59:{c:[1112]}}}}}}}}}}},117:{l:{107:{l:{99:{l:{121:{l:{59:{c:[1108]}}}}}}}}}}},107:{l:{97:{l:{112:{l:{112:{l:{97:{l:{59:{c:[954]},118:{l:{59:{c:[1008]}}}}}}}}}}},99:{l:{101:{l:{100:{l:{105:{l:{108:{l:{59:{c:[311]}}}}}}}}},121:{l:{59:{c:[1082]}}}}},102:{l:{114:{l:{59:{c:[120104]}}}}},103:{l:{114:{l:{101:{l:{101:{l:{110:{l:{59:{c:[312]}}}}}}}}}}},104:{l:{99:{l:{121:{l:{59:{c:[1093]}}}}}}},106:{l:{99:{l:{121:{l:{59:{c:[1116]}}}}}}},111:{l:{112:{l:{102:{l:{59:{c:[120156]}}}}}}},115:{l:{99:{l:{114:{l:{59:{c:[120000]}}}}}}}}},108:{l:{65:{l:{97:{l:{114:{l:{114:{l:{59:{c:[8666]}}}}}}},114:{l:{114:{l:{59:{c:[8656]}}}}},116:{l:{97:{l:{105:{l:{108:{l:{59:{c:[10523]}}}}}}}}}}},66:{l:{97:{l:{114:{l:{114:{l:{59:{c:[10510]}}}}}}}}},69:{l:{59:{c:[8806]},103:{l:{59:{c:[10891]}}}}},72:{l:{97:{l:{114:{l:{59:{c:[10594]}}}}}}},97:{l:{99:{l:{117:{l:{116:{l:{101:{l:{59:{c:[314]}}}}}}}}},101:{l:{109:{l:{112:{l:{116:{l:{121:{l:{118:{l:{59:{c:[10676]}}}}}}}}}}}}},103:{l:{114:{l:{97:{l:{110:{l:{59:{c:[8466]}}}}}}}}},109:{l:{98:{l:{100:{l:{97:{l:{59:{c:[955]}}}}}}}}},110:{l:{103:{l:{59:{c:[10216]},100:{l:{59:{c:[10641]}}},108:{l:{101:{l:{59:{c:[10216]}}}}}}}}},112:{l:{59:{c:[10885]}}},113:{l:{117:{l:{111:{l:{59:{c:[171]}},c:[171]}}}}},114:{l:{114:{l:{59:{c:[8592]},98:{l:{59:{c:[8676]},102:{l:{115:{l:{59:{c:[10527]}}}}}}},102:{l:{115:{l:{59:{c:[10525]}}}}},104:{l:{107:{l:{59:{c:[8617]}}}}},108:{l:{112:{l:{59:{c:[8619]}}}}},112:{l:{108:{l:{59:{c:[10553]}}}}},115:{l:{105:{l:{109:{l:{59:{c:[10611]}}}}}}},116:{l:{108:{l:{59:{c:[8610]}}}}}}}}},116:{l:{59:{c:[10923]},97:{l:{105:{l:{108:{l:{59:{c:[10521]}}}}}}},101:{l:{59:{c:[10925]},115:{l:{59:{c:[10925,65024]}}}}}}}}},98:{l:{97:{l:{114:{l:{114:{l:{59:{c:[10508]}}}}}}},98:{l:{114:{l:{107:{l:{59:{c:[10098]}}}}}}},114:{l:{97:{l:{99:{l:{101:{l:{59:{c:[123]}}},107:{l:{59:{c:[91]}}}}}}},107:{l:{101:{l:{59:{c:[10635]}}},115:{l:{108:{l:{100:{l:{59:{c:[10639]}}},117:{l:{59:{c:[10637]}}}}}}}}}}}}},99:{l:{97:{l:{114:{l:{111:{l:{110:{l:{59:{c:[318]}}}}}}}}},101:{l:{100:{l:{105:{l:{108:{l:{59:{c:[316]}}}}}}},105:{l:{108:{l:{59:{c:[8968]}}}}}}},117:{l:{98:{l:{59:{c:[123]}}}}},121:{l:{59:{c:[1083]}}}}},100:{l:{99:{l:{97:{l:{59:{c:[10550]}}}}},113:{l:{117:{l:{111:{l:{59:{c:[8220]},114:{l:{59:{c:[8222]}}}}}}}}},114:{l:{100:{l:{104:{l:{97:{l:{114:{l:{59:{c:[10599]}}}}}}}}},117:{l:{115:{l:{104:{l:{97:{l:{114:{l:{59:{c:[10571]}}}}}}}}}}}}},115:{l:{104:{l:{59:{c:[8626]}}}}}}},101:{l:{59:{c:[8804]},102:{l:{116:{l:{97:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[8592]},116:{l:{97:{l:{105:{l:{108:{l:{59:{c:[8610]}}}}}}}}}}}}}}}}}}},104:{l:{97:{l:{114:{l:{112:{l:{111:{l:{111:{l:{110:{l:{100:{l:{111:{l:{119:{l:{110:{l:{59:{c:[8637]}}}}}}}}},117:{l:{112:{l:{59:{c:[8636]}}}}}}}}}}}}}}}}}}},108:{l:{101:{l:{102:{l:{116:{l:{97:{l:{114:{l:{114:{l:{111:{l:{119:{l:{115:{l:{59:{c:[8647]}}}}}}}}}}}}}}}}}}}}},114:{l:{105:{l:{103:{l:{104:{l:{116:{l:{97:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[8596]},115:{l:{59:{c:[8646]}}}}}}}}}}}}},104:{l:{97:{l:{114:{l:{112:{l:{111:{l:{111:{l:{110:{l:{115:{l:{59:{c:[8651]}}}}}}}}}}}}}}}}},115:{l:{113:{l:{117:{l:{105:{l:{103:{l:{97:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[8621]}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},116:{l:{104:{l:{114:{l:{101:{l:{101:{l:{116:{l:{105:{l:{109:{l:{101:{l:{115:{l:{59:{c:[8907]}}}}}}}}}}}}}}}}}}}}}}}}},103:{l:{59:{c:[8922]}}},113:{l:{59:{c:[8804]},113:{l:{59:{c:[8806]}}},115:{l:{108:{l:{97:{l:{110:{l:{116:{l:{59:{c:[10877]}}}}}}}}}}}}},115:{l:{59:{c:[10877]},99:{l:{99:{l:{59:{c:[10920]}}}}},100:{l:{111:{l:{116:{l:{59:{c:[10879]},111:{l:{59:{c:[10881]},114:{l:{59:{c:[10883]}}}}}}}}}}},103:{l:{59:{c:[8922,65024]},101:{l:{115:{l:{59:{c:[10899]}}}}}}},115:{l:{97:{l:{112:{l:{112:{l:{114:{l:{111:{l:{120:{l:{59:{c:[10885]}}}}}}}}}}}}},100:{l:{111:{l:{116:{l:{59:{c:[8918]}}}}}}},101:{l:{113:{l:{103:{l:{116:{l:{114:{l:{59:{c:[8922]}}}}}}},113:{l:{103:{l:{116:{l:{114:{l:{59:{c:[10891]}}}}}}}}}}}}},103:{l:{116:{l:{114:{l:{59:{c:[8822]}}}}}}},115:{l:{105:{l:{109:{l:{59:{c:[8818]}}}}}}}}}}}}},102:{l:{105:{l:{115:{l:{104:{l:{116:{l:{59:{c:[10620]}}}}}}}}},108:{l:{111:{l:{111:{l:{114:{l:{59:{c:[8970]}}}}}}}}},114:{l:{59:{c:[120105]}}}}},103:{l:{59:{c:[8822]},69:{l:{59:{c:[10897]}}}}},104:{l:{97:{l:{114:{l:{100:{l:{59:{c:[8637]}}},117:{l:{59:{c:[8636]},108:{l:{59:{c:[10602]}}}}}}}}},98:{l:{108:{l:{107:{l:{59:{c:[9604]}}}}}}}}},106:{l:{99:{l:{121:{l:{59:{c:[1113]}}}}}}},108:{l:{59:{c:[8810]},97:{l:{114:{l:{114:{l:{59:{c:[8647]}}}}}}},99:{l:{111:{l:{114:{l:{110:{l:{101:{l:{114:{l:{59:{c:[8990]}}}}}}}}}}}}},104:{l:{97:{l:{114:{l:{100:{l:{59:{c:[10603]}}}}}}}}},116:{l:{114:{l:{105:{l:{59:{c:[9722]}}}}}}}}},109:{l:{105:{l:{100:{l:{111:{l:{116:{l:{59:{c:[320]}}}}}}}}},111:{l:{117:{l:{115:{l:{116:{l:{59:{c:[9136]},97:{l:{99:{l:{104:{l:{101:{l:{59:{c:[9136]}}}}}}}}}}}}}}}}}}},110:{l:{69:{l:{59:{c:[8808]}}},97:{l:{112:{l:{59:{c:[10889]},112:{l:{114:{l:{111:{l:{120:{l:{59:{c:[10889]}}}}}}}}}}}}},101:{l:{59:{c:[10887]},113:{l:{59:{c:[10887]},113:{l:{59:{c:[8808]}}}}}}},115:{l:{105:{l:{109:{l:{59:{c:[8934]}}}}}}}}},111:{l:{97:{l:{110:{l:{103:{l:{59:{c:[10220]}}}}},114:{l:{114:{l:{59:{c:[8701]}}}}}}},98:{l:{114:{l:{107:{l:{59:{c:[10214]}}}}}}},110:{l:{103:{l:{108:{l:{101:{l:{102:{l:{116:{l:{97:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[10229]}}}}}}}}}}},114:{l:{105:{l:{103:{l:{104:{l:{116:{l:{97:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[10231]}}}}}}}}}}}}}}}}}}}}}}}}}}}}},109:{l:{97:{l:{112:{l:{115:{l:{116:{l:{111:{l:{59:{c:[10236]}}}}}}}}}}}}},114:{l:{105:{l:{103:{l:{104:{l:{116:{l:{97:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[10230]}}}}}}}}}}}}}}}}}}}}}}}}},111:{l:{112:{l:{97:{l:{114:{l:{114:{l:{111:{l:{119:{l:{108:{l:{101:{l:{102:{l:{116:{l:{59:{c:[8619]}}}}}}}}},114:{l:{105:{l:{103:{l:{104:{l:{116:{l:{59:{c:[8620]}}}}}}}}}}}}}}}}}}}}}}}}},112:{l:{97:{l:{114:{l:{59:{c:[10629]}}}}},102:{l:{59:{c:[120157]}}},108:{l:{117:{l:{115:{l:{59:{c:[10797]}}}}}}}}},116:{l:{105:{l:{109:{l:{101:{l:{115:{l:{59:{c:[10804]}}}}}}}}}}},119:{l:{97:{l:{115:{l:{116:{l:{59:{c:[8727]}}}}}}},98:{l:{97:{l:{114:{l:{59:{c:[95]}}}}}}}}},122:{l:{59:{c:[9674]},101:{l:{110:{l:{103:{l:{101:{l:{59:{c:[9674]}}}}}}}}},102:{l:{59:{c:[10731]}}}}}}},112:{l:{97:{l:{114:{l:{59:{c:[40]},108:{l:{116:{l:{59:{c:[10643]}}}}}}}}}}},114:{l:{97:{l:{114:{l:{114:{l:{59:{c:[8646]}}}}}}},99:{l:{111:{l:{114:{l:{110:{l:{101:{l:{114:{l:{59:{c:[8991]}}}}}}}}}}}}},104:{l:{97:{l:{114:{l:{59:{c:[8651]},100:{l:{59:{c:[10605]}}}}}}}}},109:{l:{59:{c:[8206]}}},116:{l:{114:{l:{105:{l:{59:{c:[8895]}}}}}}}}},115:{l:{97:{l:{113:{l:{117:{l:{111:{l:{59:{c:[8249]}}}}}}}}},99:{l:{114:{l:{59:{c:[120001]}}}}},104:{l:{59:{c:[8624]}}},105:{l:{109:{l:{59:{c:[8818]},101:{l:{59:{c:[10893]}}},103:{l:{59:{c:[10895]}}}}}}},113:{l:{98:{l:{59:{c:[91]}}},117:{l:{111:{l:{59:{c:[8216]},114:{l:{59:{c:[8218]}}}}}}}}},116:{l:{114:{l:{111:{l:{107:{l:{59:{c:[322]}}}}}}}}}}},116:{l:{59:{c:[60]},99:{l:{99:{l:{59:{c:[10918]}}},105:{l:{114:{l:{59:{c:[10873]}}}}}}},100:{l:{111:{l:{116:{l:{59:{c:[8918]}}}}}}},104:{l:{114:{l:{101:{l:{101:{l:{59:{c:[8907]}}}}}}}}},105:{l:{109:{l:{101:{l:{115:{l:{59:{c:[8905]}}}}}}}}},108:{l:{97:{l:{114:{l:{114:{l:{59:{c:[10614]}}}}}}}}},113:{l:{117:{l:{101:{l:{115:{l:{116:{l:{59:{c:[10875]}}}}}}}}}}},114:{l:{80:{l:{97:{l:{114:{l:{59:{c:[10646]}}}}}}},105:{l:{59:{c:[9667]},101:{l:{59:{c:[8884]}}},102:{l:{59:{c:[9666]}}}}}}}},c:[60]},117:{l:{114:{l:{100:{l:{115:{l:{104:{l:{97:{l:{114:{l:{59:{c:[10570]}}}}}}}}}}},117:{l:{104:{l:{97:{l:{114:{l:{59:{c:[10598]}}}}}}}}}}}}},118:{l:{101:{l:{114:{l:{116:{l:{110:{l:{101:{l:{113:{l:{113:{l:{59:{c:[8808,65024]}}}}}}}}}}}}}}},110:{l:{69:{l:{59:{c:[8808,65024]}}}}}}}}},109:{l:{68:{l:{68:{l:{111:{l:{116:{l:{59:{c:[8762]}}}}}}}}},97:{l:{99:{l:{114:{l:{59:{c:[175]}},c:[175]}}},108:{l:{101:{l:{59:{c:[9794]}}},116:{l:{59:{c:[10016]},101:{l:{115:{l:{101:{l:{59:{c:[10016]}}}}}}}}}}},112:{l:{59:{c:[8614]},115:{l:{116:{l:{111:{l:{59:{c:[8614]},100:{l:{111:{l:{119:{l:{110:{l:{59:{c:[8615]}}}}}}}}},108:{l:{101:{l:{102:{l:{116:{l:{59:{c:[8612]}}}}}}}}},117:{l:{112:{l:{59:{c:[8613]}}}}}}}}}}}}},114:{l:{107:{l:{101:{l:{114:{l:{59:{c:[9646]}}}}}}}}}}},99:{l:{111:{l:{109:{l:{109:{l:{97:{l:{59:{c:[10793]}}}}}}}}},121:{l:{59:{c:[1084]}}}}},100:{l:{97:{l:{115:{l:{104:{l:{59:{c:[8212]}}}}}}}}},101:{l:{97:{l:{115:{l:{117:{l:{114:{l:{101:{l:{100:{l:{97:{l:{110:{l:{103:{l:{108:{l:{101:{l:{59:{c:[8737]}}}}}}}}}}}}}}}}}}}}}}}}},102:{l:{114:{l:{59:{c:[120106]}}}}},104:{l:{111:{l:{59:{c:[8487]}}}}},105:{l:{99:{l:{114:{l:{111:{l:{59:{c:[181]}},c:[181]}}}}},100:{l:{59:{c:[8739]},97:{l:{115:{l:{116:{l:{59:{c:[42]}}}}}}},99:{l:{105:{l:{114:{l:{59:{c:[10992]}}}}}}},100:{l:{111:{l:{116:{l:{59:{c:[183]}},c:[183]}}}}}}},110:{l:{117:{l:{115:{l:{59:{c:[8722]},98:{l:{59:{c:[8863]}}},100:{l:{59:{c:[8760]},117:{l:{59:{c:[10794]}}}}}}}}}}}}},108:{l:{99:{l:{112:{l:{59:{c:[10971]}}}}},100:{l:{114:{l:{59:{c:[8230]}}}}}}},110:{l:{112:{l:{108:{l:{117:{l:{115:{l:{59:{c:[8723]}}}}}}}}}}},111:{l:{100:{l:{101:{l:{108:{l:{115:{l:{59:{c:[8871]}}}}}}}}},112:{l:{102:{l:{59:{c:[120158]}}}}}}},112:{l:{59:{c:[8723]}}},115:{l:{99:{l:{114:{l:{59:{c:[120002]}}}}},116:{l:{112:{l:{111:{l:{115:{l:{59:{c:[8766]}}}}}}}}}}},117:{l:{59:{c:[956]},108:{l:{116:{l:{105:{l:{109:{l:{97:{l:{112:{l:{59:{c:[8888]}}}}}}}}}}}}},109:{l:{97:{l:{112:{l:{59:{c:[8888]}}}}}}}}}}},110:{l:{71:{l:{103:{l:{59:{c:[8921,824]}}},116:{l:{59:{c:[8811,8402]},118:{l:{59:{c:[8811,824]}}}}}}},76:{l:{101:{l:{102:{l:{116:{l:{97:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[8653]}}}}}}}}}}},114:{l:{105:{l:{103:{l:{104:{l:{116:{l:{97:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[8654]}}}}}}}}}}}}}}}}}}}}}}}}}}},108:{l:{59:{c:[8920,824]}}},116:{l:{59:{c:[8810,8402]},118:{l:{59:{c:[8810,824]}}}}}}},82:{l:{105:{l:{103:{l:{104:{l:{116:{l:{97:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[8655]}}}}}}}}}}}}}}}}}}}}},86:{l:{68:{l:{97:{l:{115:{l:{104:{l:{59:{c:[8879]}}}}}}}}},100:{l:{97:{l:{115:{l:{104:{l:{59:{c:[8878]}}}}}}}}}}},97:{l:{98:{l:{108:{l:{97:{l:{59:{c:[8711]}}}}}}},99:{l:{117:{l:{116:{l:{101:{l:{59:{c:[324]}}}}}}}}},110:{l:{103:{l:{59:{c:[8736,8402]}}}}},112:{l:{59:{c:[8777]},69:{l:{59:{c:[10864,824]}}},105:{l:{100:{l:{59:{c:[8779,824]}}}}},111:{l:{115:{l:{59:{c:[329]}}}}},112:{l:{114:{l:{111:{l:{120:{l:{59:{c:[8777]}}}}}}}}}}},116:{l:{117:{l:{114:{l:{59:{c:[9838]},97:{l:{108:{l:{59:{c:[9838]},115:{l:{59:{c:[8469]}}}}}}}}}}}}}}},98:{l:{115:{l:{112:{l:{59:{c:[160]}},c:[160]}}},117:{l:{109:{l:{112:{l:{59:{c:[8782,824]},101:{l:{59:{c:[8783,824]}}}}}}}}}}},99:{l:{97:{l:{112:{l:{59:{c:[10819]}}},114:{l:{111:{l:{110:{l:{59:{c:[328]}}}}}}}}},101:{l:{100:{l:{105:{l:{108:{l:{59:{c:[326]}}}}}}}}},111:{l:{110:{l:{103:{l:{59:{c:[8775]},100:{l:{111:{l:{116:{l:{59:{c:[10861,824]}}}}}}}}}}}}},117:{l:{112:{l:{59:{c:[10818]}}}}},121:{l:{59:{c:[1085]}}}}},100:{l:{97:{l:{115:{l:{104:{l:{59:{c:[8211]}}}}}}}}},101:{l:{59:{c:[8800]},65:{l:{114:{l:{114:{l:{59:{c:[8663]}}}}}}},97:{l:{114:{l:{104:{l:{107:{l:{59:{c:[10532]}}}}},114:{l:{59:{c:[8599]},111:{l:{119:{l:{59:{c:[8599]}}}}}}}}}}},100:{l:{111:{l:{116:{l:{59:{c:[8784,824]}}}}}}},113:{l:{117:{l:{105:{l:{118:{l:{59:{c:[8802]}}}}}}}}},115:{l:{101:{l:{97:{l:{114:{l:{59:{c:[10536]}}}}}}},105:{l:{109:{l:{59:{c:[8770,824]}}}}}}},120:{l:{105:{l:{115:{l:{116:{l:{59:{c:[8708]},115:{l:{59:{c:[8708]}}}}}}}}}}}}},102:{l:{114:{l:{59:{c:[120107]}}}}},103:{l:{69:{l:{59:{c:[8807,824]}}},101:{l:{59:{c:[8817]},113:{l:{59:{c:[8817]},113:{l:{59:{c:[8807,824]}}},115:{l:{108:{l:{97:{l:{110:{l:{116:{l:{59:{c:[10878,824]}}}}}}}}}}}}},115:{l:{59:{c:[10878,824]}}}}},115:{l:{105:{l:{109:{l:{59:{c:[8821]}}}}}}},116:{l:{59:{c:[8815]},114:{l:{59:{c:[8815]}}}}}}},104:{l:{65:{l:{114:{l:{114:{l:{59:{c:[8654]}}}}}}},97:{l:{114:{l:{114:{l:{59:{c:[8622]}}}}}}},112:{l:{97:{l:{114:{l:{59:{c:[10994]}}}}}}}}},105:{l:{59:{c:[8715]},115:{l:{59:{c:[8956]},100:{l:{59:{c:[8954]}}}}},118:{l:{59:{c:[8715]}}}}},106:{l:{99:{l:{121:{l:{59:{c:[1114]}}}}}}},108:{l:{65:{l:{114:{l:{114:{l:{59:{c:[8653]}}}}}}},69:{l:{59:{c:[8806,824]}}},97:{l:{114:{l:{114:{l:{59:{c:[8602]}}}}}}},100:{l:{114:{l:{59:{c:[8229]}}}}},101:{l:{59:{c:[8816]},102:{l:{116:{l:{97:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[8602]}}}}}}}}}}},114:{l:{105:{l:{103:{l:{104:{l:{116:{l:{97:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[8622]}}}}}}}}}}}}}}}}}}}}}}}}},113:{l:{59:{c:[8816]},113:{l:{59:{c:[8806,824]}}},115:{l:{108:{l:{97:{l:{110:{l:{116:{l:{59:{c:[10877,824]}}}}}}}}}}}}},115:{l:{59:{c:[10877,824]},115:{l:{59:{c:[8814]}}}}}}},115:{l:{105:{l:{109:{l:{59:{c:[8820]}}}}}}},116:{l:{59:{c:[8814]},114:{l:{105:{l:{59:{c:[8938]},101:{l:{59:{c:[8940]}}}}}}}}}}},109:{l:{105:{l:{100:{l:{59:{c:[8740]}}}}}}},111:{l:{112:{l:{102:{l:{59:{c:[120159]}}}}},116:{l:{59:{c:[172]},105:{l:{110:{l:{59:{c:[8713]},69:{l:{59:{c:[8953,824]}}},100:{l:{111:{l:{116:{l:{59:{c:[8949,824]}}}}}}},118:{l:{97:{l:{59:{c:[8713]}}},98:{l:{59:{c:[8951]}}},99:{l:{59:{c:[8950]}}}}}}}}},110:{l:{105:{l:{59:{c:[8716]},118:{l:{97:{l:{59:{c:[8716]}}},98:{l:{59:{c:[8958]}}},99:{l:{59:{c:[8957]}}}}}}}}}},c:[172]}}},112:{l:{97:{l:{114:{l:{59:{c:[8742]},97:{l:{108:{l:{108:{l:{101:{l:{108:{l:{59:{c:[8742]}}}}}}}}}}},115:{l:{108:{l:{59:{c:[11005,8421]}}}}},116:{l:{59:{c:[8706,824]}}}}}}},111:{l:{108:{l:{105:{l:{110:{l:{116:{l:{59:{c:[10772]}}}}}}}}}}},114:{l:{59:{c:[8832]},99:{l:{117:{l:{101:{l:{59:{c:[8928]}}}}}}},101:{l:{59:{c:[10927,824]},99:{l:{59:{c:[8832]},101:{l:{113:{l:{59:{c:[10927,824]}}}}}}}}}}}}},114:{l:{65:{l:{114:{l:{114:{l:{59:{c:[8655]}}}}}}},97:{l:{114:{l:{114:{l:{59:{c:[8603]},99:{l:{59:{c:[10547,824]}}},119:{l:{59:{c:[8605,824]}}}}}}}}},105:{l:{103:{l:{104:{l:{116:{l:{97:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[8603]}}}}}}}}}}}}}}}}}}},116:{l:{114:{l:{105:{l:{59:{c:[8939]},101:{l:{59:{c:[8941]}}}}}}}}}}},115:{l:{99:{l:{59:{c:[8833]},99:{l:{117:{l:{101:{l:{59:{c:[8929]}}}}}}},101:{l:{59:{c:[10928,824]}}},114:{l:{59:{c:[120003]}}}}},104:{l:{111:{l:{114:{l:{116:{l:{109:{l:{105:{l:{100:{l:{59:{c:[8740]}}}}}}},112:{l:{97:{l:{114:{l:{97:{l:{108:{l:{108:{l:{101:{l:{108:{l:{59:{c:[8742]}}}}}}}}}}}}}}}}}}}}}}}}},105:{l:{109:{l:{59:{c:[8769]},101:{l:{59:{c:[8772]},113:{l:{59:{c:[8772]}}}}}}}}},109:{l:{105:{l:{100:{l:{59:{c:[8740]}}}}}}},112:{l:{97:{l:{114:{l:{59:{c:[8742]}}}}}}},113:{l:{115:{l:{117:{l:{98:{l:{101:{l:{59:{c:[8930]}}}}},112:{l:{101:{l:{59:{c:[8931]}}}}}}}}}}},117:{l:{98:{l:{59:{c:[8836]},69:{l:{59:{c:[10949,824]}}},101:{l:{59:{c:[8840]}}},115:{l:{101:{l:{116:{l:{59:{c:[8834,8402]},101:{l:{113:{l:{59:{c:[8840]},113:{l:{59:{c:[10949,824]}}}}}}}}}}}}}}},99:{l:{99:{l:{59:{c:[8833]},101:{l:{113:{l:{59:{c:[10928,824]}}}}}}}}},112:{l:{59:{c:[8837]},69:{l:{59:{c:[10950,824]}}},101:{l:{59:{c:[8841]}}},115:{l:{101:{l:{116:{l:{59:{c:[8835,8402]},101:{l:{113:{l:{59:{c:[8841]},113:{l:{59:{c:[10950,824]}}}}}}}}}}}}}}}}}}},116:{l:{103:{l:{108:{l:{59:{c:[8825]}}}}},105:{l:{108:{l:{100:{l:{101:{l:{59:{c:[241]}},c:[241]}}}}}}},108:{l:{103:{l:{59:{c:[8824]}}}}},114:{l:{105:{l:{97:{l:{110:{l:{103:{l:{108:{l:{101:{l:{108:{l:{101:{l:{102:{l:{116:{l:{59:{c:[8938]},101:{l:{113:{l:{59:{c:[8940]}}}}}}}}}}}}},114:{l:{105:{l:{103:{l:{104:{l:{116:{l:{59:{c:[8939]},101:{l:{113:{l:{59:{c:[8941]}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},117:{l:{59:{c:[957]},109:{l:{59:{c:[35]},101:{l:{114:{l:{111:{l:{59:{c:[8470]}}}}}}},115:{l:{112:{l:{59:{c:[8199]}}}}}}}}},118:{l:{68:{l:{97:{l:{115:{l:{104:{l:{59:{c:[8877]}}}}}}}}},72:{l:{97:{l:{114:{l:{114:{l:{59:{c:[10500]}}}}}}}}},97:{l:{112:{l:{59:{c:[8781,8402]}}}}},100:{l:{97:{l:{115:{l:{104:{l:{59:{c:[8876]}}}}}}}}},103:{l:{101:{l:{59:{c:[8805,8402]}}},116:{l:{59:{c:[62,8402]}}}}},105:{l:{110:{l:{102:{l:{105:{l:{110:{l:{59:{c:[10718]}}}}}}}}}}},108:{l:{65:{l:{114:{l:{114:{l:{59:{c:[10498]}}}}}}},101:{l:{59:{c:[8804,8402]}}},116:{l:{59:{c:[60,8402]},114:{l:{105:{l:{101:{l:{59:{c:[8884,8402]}}}}}}}}}}},114:{l:{65:{l:{114:{l:{114:{l:{59:{c:[10499]}}}}}}},116:{l:{114:{l:{105:{l:{101:{l:{59:{c:[8885,8402]}}}}}}}}}}},115:{l:{105:{l:{109:{l:{59:{c:[8764,8402]}}}}}}}}},119:{l:{65:{l:{114:{l:{114:{l:{59:{c:[8662]}}}}}}},97:{l:{114:{l:{104:{l:{107:{l:{59:{c:[10531]}}}}},114:{l:{59:{c:[8598]},111:{l:{119:{l:{59:{c:[8598]}}}}}}}}}}},110:{l:{101:{l:{97:{l:{114:{l:{59:{c:[10535]}}}}}}}}}}}}},111:{l:{83:{l:{59:{c:[9416]}}},97:{l:{99:{l:{117:{l:{116:{l:{101:{l:{59:{c:[243]}},c:[243]}}}}}}},115:{l:{116:{l:{59:{c:[8859]}}}}}}},99:{l:{105:{l:{114:{l:{59:{c:[8858]},99:{l:{59:{c:[244]}},c:[244]}}}}},121:{l:{59:{c:[1086]}}}}},100:{l:{97:{l:{115:{l:{104:{l:{59:{c:[8861]}}}}}}},98:{l:{108:{l:{97:{l:{99:{l:{59:{c:[337]}}}}}}}}},105:{l:{118:{l:{59:{c:[10808]}}}}},111:{l:{116:{l:{59:{c:[8857]}}}}},115:{l:{111:{l:{108:{l:{100:{l:{59:{c:[10684]}}}}}}}}}}},101:{l:{108:{l:{105:{l:{103:{l:{59:{c:[339]}}}}}}}}},102:{l:{99:{l:{105:{l:{114:{l:{59:{c:[10687]}}}}}}},114:{l:{59:{c:[120108]}}}}},103:{l:{111:{l:{110:{l:{59:{c:[731]}}}}},114:{l:{97:{l:{118:{l:{101:{l:{59:{c:[242]}},c:[242]}}}}}}},116:{l:{59:{c:[10689]}}}}},104:{l:{98:{l:{97:{l:{114:{l:{59:{c:[10677]}}}}}}},109:{l:{59:{c:[937]}}}}},105:{l:{110:{l:{116:{l:{59:{c:[8750]}}}}}}},108:{l:{97:{l:{114:{l:{114:{l:{59:{c:[8634]}}}}}}},99:{l:{105:{l:{114:{l:{59:{c:[10686]}}}}},114:{l:{111:{l:{115:{l:{115:{l:{59:{c:[10683]}}}}}}}}}}},105:{l:{110:{l:{101:{l:{59:{c:[8254]}}}}}}},116:{l:{59:{c:[10688]}}}}},109:{l:{97:{l:{99:{l:{114:{l:{59:{c:[333]}}}}}}},101:{l:{103:{l:{97:{l:{59:{c:[969]}}}}}}},105:{l:{99:{l:{114:{l:{111:{l:{110:{l:{59:{c:[959]}}}}}}}}},100:{l:{59:{c:[10678]}}},110:{l:{117:{l:{115:{l:{59:{c:[8854]}}}}}}}}}}},111:{l:{112:{l:{102:{l:{59:{c:[120160]}}}}}}},112:{l:{97:{l:{114:{l:{59:{c:[10679]}}}}},101:{l:{114:{l:{112:{l:{59:{c:[10681]}}}}}}},108:{l:{117:{l:{115:{l:{59:{c:[8853]}}}}}}}}},114:{l:{59:{c:[8744]},97:{l:{114:{l:{114:{l:{59:{c:[8635]}}}}}}},100:{l:{59:{c:[10845]},101:{l:{114:{l:{59:{c:[8500]},111:{l:{102:{l:{59:{c:[8500]}}}}}}}}},102:{l:{59:{c:[170]}},c:[170]},109:{l:{59:{c:[186]}},c:[186]}}},105:{l:{103:{l:{111:{l:{102:{l:{59:{c:[8886]}}}}}}}}},111:{l:{114:{l:{59:{c:[10838]}}}}},115:{l:{108:{l:{111:{l:{112:{l:{101:{l:{59:{c:[10839]}}}}}}}}}}},118:{l:{59:{c:[10843]}}}}},115:{l:{99:{l:{114:{l:{59:{c:[8500]}}}}},108:{l:{97:{l:{115:{l:{104:{l:{59:{c:[248]}},c:[248]}}}}}}},111:{l:{108:{l:{59:{c:[8856]}}}}}}},116:{l:{105:{l:{108:{l:{100:{l:{101:{l:{59:{c:[245]}},c:[245]}}}}},109:{l:{101:{l:{115:{l:{59:{c:[8855]},97:{l:{115:{l:{59:{c:[10806]}}}}}}}}}}}}}}},117:{l:{109:{l:{108:{l:{59:{c:[246]}},c:[246]}}}}},118:{l:{98:{l:{97:{l:{114:{l:{59:{c:[9021]}}}}}}}}}}},112:{l:{97:{l:{114:{l:{59:{c:[8741]},97:{l:{59:{c:[182]},108:{l:{108:{l:{101:{l:{108:{l:{59:{c:[8741]}}}}}}}}}},c:[182]},115:{l:{105:{l:{109:{l:{59:{c:[10995]}}}}},108:{l:{59:{c:[11005]}}}}},116:{l:{59:{c:[8706]}}}}}}},99:{l:{121:{l:{59:{c:[1087]}}}}},101:{l:{114:{l:{99:{l:{110:{l:{116:{l:{59:{c:[37]}}}}}}},105:{l:{111:{l:{100:{l:{59:{c:[46]}}}}}}},109:{l:{105:{l:{108:{l:{59:{c:[8240]}}}}}}},112:{l:{59:{c:[8869]}}},116:{l:{101:{l:{110:{l:{107:{l:{59:{c:[8241]}}}}}}}}}}}}},102:{l:{114:{l:{59:{c:[120109]}}}}},104:{l:{105:{l:{59:{c:[966]},118:{l:{59:{c:[981]}}}}},109:{l:{109:{l:{97:{l:{116:{l:{59:{c:[8499]}}}}}}}}},111:{l:{110:{l:{101:{l:{59:{c:[9742]}}}}}}}}},105:{l:{59:{c:[960]},116:{l:{99:{l:{104:{l:{102:{l:{111:{l:{114:{l:{107:{l:{59:{c:[8916]}}}}}}}}}}}}}}},118:{l:{59:{c:[982]}}}}},108:{l:{97:{l:{110:{l:{99:{l:{107:{l:{59:{c:[8463]},104:{l:{59:{c:[8462]}}}}}}},107:{l:{118:{l:{59:{c:[8463]}}}}}}}}},117:{l:{115:{l:{59:{c:[43]},97:{l:{99:{l:{105:{l:{114:{l:{59:{c:[10787]}}}}}}}}},98:{l:{59:{c:[8862]}}},99:{l:{105:{l:{114:{l:{59:{c:[10786]}}}}}}},100:{l:{111:{l:{59:{c:[8724]}}},117:{l:{59:{c:[10789]}}}}},101:{l:{59:{c:[10866]}}},109:{l:{110:{l:{59:{c:[177]}},c:[177]}}},115:{l:{105:{l:{109:{l:{59:{c:[10790]}}}}}}},116:{l:{119:{l:{111:{l:{59:{c:[10791]}}}}}}}}}}}}},109:{l:{59:{c:[177]}}},111:{l:{105:{l:{110:{l:{116:{l:{105:{l:{110:{l:{116:{l:{59:{c:[10773]}}}}}}}}}}}}},112:{l:{102:{l:{59:{c:[120161]}}}}},117:{l:{110:{l:{100:{l:{59:{c:[163]}},c:[163]}}}}}}},114:{l:{59:{c:[8826]},69:{l:{59:{c:[10931]}}},97:{l:{112:{l:{59:{c:[10935]}}}}},99:{l:{117:{l:{101:{l:{59:{c:[8828]}}}}}}},101:{l:{59:{c:[10927]},99:{l:{59:{c:[8826]},97:{l:{112:{l:{112:{l:{114:{l:{111:{l:{120:{l:{59:{c:[10935]}}}}}}}}}}}}},99:{l:{117:{l:{114:{l:{108:{l:{121:{l:{101:{l:{113:{l:{59:{c:[8828]}}}}}}}}}}}}}}},101:{l:{113:{l:{59:{c:[10927]}}}}},110:{l:{97:{l:{112:{l:{112:{l:{114:{l:{111:{l:{120:{l:{59:{c:[10937]}}}}}}}}}}}}},101:{l:{113:{l:{113:{l:{59:{c:[10933]}}}}}}},115:{l:{105:{l:{109:{l:{59:{c:[8936]}}}}}}}}},115:{l:{105:{l:{109:{l:{59:{c:[8830]}}}}}}}}}}},105:{l:{109:{l:{101:{l:{59:{c:[8242]},115:{l:{59:{c:[8473]}}}}}}}}},110:{l:{69:{l:{59:{c:[10933]}}},97:{l:{112:{l:{59:{c:[10937]}}}}},115:{l:{105:{l:{109:{l:{59:{c:[8936]}}}}}}}}},111:{l:{100:{l:{59:{c:[8719]}}},102:{l:{97:{l:{108:{l:{97:{l:{114:{l:{59:{c:[9006]}}}}}}}}},108:{l:{105:{l:{110:{l:{101:{l:{59:{c:[8978]}}}}}}}}},115:{l:{117:{l:{114:{l:{102:{l:{59:{c:[8979]}}}}}}}}}}},112:{l:{59:{c:[8733]},116:{l:{111:{l:{59:{c:[8733]}}}}}}}}},115:{l:{105:{l:{109:{l:{59:{c:[8830]}}}}}}},117:{l:{114:{l:{101:{l:{108:{l:{59:{c:[8880]}}}}}}}}}}},115:{l:{99:{l:{114:{l:{59:{c:[120005]}}}}},105:{l:{59:{c:[968]}}}}},117:{l:{110:{l:{99:{l:{115:{l:{112:{l:{59:{c:[8200]}}}}}}}}}}}}},113:{l:{102:{l:{114:{l:{59:{c:[120110]}}}}},105:{l:{110:{l:{116:{l:{59:{c:[10764]}}}}}}},111:{l:{112:{l:{102:{l:{59:{c:[120162]}}}}}}},112:{l:{114:{l:{105:{l:{109:{l:{101:{l:{59:{c:[8279]}}}}}}}}}}},115:{l:{99:{l:{114:{l:{59:{c:[120006]}}}}}}},117:{l:{97:{l:{116:{l:{101:{l:{114:{l:{110:{l:{105:{l:{111:{l:{110:{l:{115:{l:{59:{c:[8461]}}}}}}}}}}}}}}},105:{l:{110:{l:{116:{l:{59:{c:[10774]}}}}}}}}}}},101:{l:{115:{l:{116:{l:{59:{c:[63]},101:{l:{113:{l:{59:{c:[8799]}}}}}}}}}}},111:{l:{116:{l:{59:{c:[34]}},c:[34]}}}}}}},114:{l:{65:{l:{97:{l:{114:{l:{114:{l:{59:{c:[8667]}}}}}}},114:{l:{114:{l:{59:{c:[8658]}}}}},116:{l:{97:{l:{105:{l:{108:{l:{59:{c:[10524]}}}}}}}}}}},66:{l:{97:{l:{114:{l:{114:{l:{59:{c:[10511]}}}}}}}}},72:{l:{97:{l:{114:{l:{59:{c:[10596]}}}}}}},97:{l:{99:{l:{101:{l:{59:{c:[8765,817]}}},117:{l:{116:{l:{101:{l:{59:{c:[341]}}}}}}}}},100:{l:{105:{l:{99:{l:{59:{c:[8730]}}}}}}},101:{l:{109:{l:{112:{l:{116:{l:{121:{l:{118:{l:{59:{c:[10675]}}}}}}}}}}}}},110:{l:{103:{l:{59:{c:[10217]},100:{l:{59:{c:[10642]}}},101:{l:{59:{c:[10661]}}},108:{l:{101:{l:{59:{c:[10217]}}}}}}}}},113:{l:{117:{l:{111:{l:{59:{c:[187]}},c:[187]}}}}},114:{l:{114:{l:{59:{c:[8594]},97:{l:{112:{l:{59:{c:[10613]}}}}},98:{l:{59:{c:[8677]},102:{l:{115:{l:{59:{c:[10528]}}}}}}},99:{l:{59:{c:[10547]}}},102:{l:{115:{l:{59:{c:[10526]}}}}},104:{l:{107:{l:{59:{c:[8618]}}}}},108:{l:{112:{l:{59:{c:[8620]}}}}},112:{l:{108:{l:{59:{c:[10565]}}}}},115:{l:{105:{l:{109:{l:{59:{c:[10612]}}}}}}},116:{l:{108:{l:{59:{c:[8611]}}}}},119:{l:{59:{c:[8605]}}}}}}},116:{l:{97:{l:{105:{l:{108:{l:{59:{c:[10522]}}}}}}},105:{l:{111:{l:{59:{c:[8758]},110:{l:{97:{l:{108:{l:{115:{l:{59:{c:[8474]}}}}}}}}}}}}}}}}},98:{l:{97:{l:{114:{l:{114:{l:{59:{c:[10509]}}}}}}},98:{l:{114:{l:{107:{l:{59:{c:[10099]}}}}}}},114:{l:{97:{l:{99:{l:{101:{l:{59:{c:[125]}}},107:{l:{59:{c:[93]}}}}}}},107:{l:{101:{l:{59:{c:[10636]}}},115:{l:{108:{l:{100:{l:{59:{c:[10638]}}},117:{l:{59:{c:[10640]}}}}}}}}}}}}},99:{l:{97:{l:{114:{l:{111:{l:{110:{l:{59:{c:[345]}}}}}}}}},101:{l:{100:{l:{105:{l:{108:{l:{59:{c:[343]}}}}}}},105:{l:{108:{l:{59:{c:[8969]}}}}}}},117:{l:{98:{l:{59:{c:[125]}}}}},121:{l:{59:{c:[1088]}}}}},100:{l:{99:{l:{97:{l:{59:{c:[10551]}}}}},108:{l:{100:{l:{104:{l:{97:{l:{114:{l:{59:{c:[10601]}}}}}}}}}}},113:{l:{117:{l:{111:{l:{59:{c:[8221]},114:{l:{59:{c:[8221]}}}}}}}}},115:{l:{104:{l:{59:{c:[8627]}}}}}}},101:{l:{97:{l:{108:{l:{59:{c:[8476]},105:{l:{110:{l:{101:{l:{59:{c:[8475]}}}}}}},112:{l:{97:{l:{114:{l:{116:{l:{59:{c:[8476]}}}}}}}}},115:{l:{59:{c:[8477]}}}}}}},99:{l:{116:{l:{59:{c:[9645]}}}}},103:{l:{59:{c:[174]}},c:[174]}}},102:{l:{105:{l:{115:{l:{104:{l:{116:{l:{59:{c:[10621]}}}}}}}}},108:{l:{111:{l:{111:{l:{114:{l:{59:{c:[8971]}}}}}}}}},114:{l:{59:{c:[120111]}}}}},104:{l:{97:{l:{114:{l:{100:{l:{59:{c:[8641]}}},117:{l:{59:{c:[8640]},108:{l:{59:{c:[10604]}}}}}}}}},111:{l:{59:{c:[961]},118:{l:{59:{c:[1009]}}}}}}},105:{l:{103:{l:{104:{l:{116:{l:{97:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[8594]},116:{l:{97:{l:{105:{l:{108:{l:{59:{c:[8611]}}}}}}}}}}}}}}}}}}},104:{l:{97:{l:{114:{l:{112:{l:{111:{l:{111:{l:{110:{l:{100:{l:{111:{l:{119:{l:{110:{l:{59:{c:[8641]}}}}}}}}},117:{l:{112:{l:{59:{c:[8640]}}}}}}}}}}}}}}}}}}},108:{l:{101:{l:{102:{l:{116:{l:{97:{l:{114:{l:{114:{l:{111:{l:{119:{l:{115:{l:{59:{c:[8644]}}}}}}}}}}}}},104:{l:{97:{l:{114:{l:{112:{l:{111:{l:{111:{l:{110:{l:{115:{l:{59:{c:[8652]}}}}}}}}}}}}}}}}}}}}}}}}},114:{l:{105:{l:{103:{l:{104:{l:{116:{l:{97:{l:{114:{l:{114:{l:{111:{l:{119:{l:{115:{l:{59:{c:[8649]}}}}}}}}}}}}}}}}}}}}}}},115:{l:{113:{l:{117:{l:{105:{l:{103:{l:{97:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[8605]}}}}}}}}}}}}}}}}}}}}},116:{l:{104:{l:{114:{l:{101:{l:{101:{l:{116:{l:{105:{l:{109:{l:{101:{l:{115:{l:{59:{c:[8908]}}}}}}}}}}}}}}}}}}}}}}}}}}},110:{l:{103:{l:{59:{c:[730]}}}}},115:{l:{105:{l:{110:{l:{103:{l:{100:{l:{111:{l:{116:{l:{115:{l:{101:{l:{113:{l:{59:{c:[8787]}}}}}}}}}}}}}}}}}}}}}}},108:{l:{97:{l:{114:{l:{114:{l:{59:{c:[8644]}}}}}}},104:{l:{97:{l:{114:{l:{59:{c:[8652]}}}}}}},109:{l:{59:{c:[8207]}}}}},109:{l:{111:{l:{117:{l:{115:{l:{116:{l:{59:{c:[9137]},97:{l:{99:{l:{104:{l:{101:{l:{59:{c:[9137]}}}}}}}}}}}}}}}}}}},110:{l:{109:{l:{105:{l:{100:{l:{59:{c:[10990]}}}}}}}}},111:{l:{97:{l:{110:{l:{103:{l:{59:{c:[10221]}}}}},114:{l:{114:{l:{59:{c:[8702]}}}}}}},98:{l:{114:{l:{107:{l:{59:{c:[10215]}}}}}}},112:{l:{97:{l:{114:{l:{59:{c:[10630]}}}}},102:{l:{59:{c:[120163]}}},108:{l:{117:{l:{115:{l:{59:{c:[10798]}}}}}}}}},116:{l:{105:{l:{109:{l:{101:{l:{115:{l:{59:{c:[10805]}}}}}}}}}}}}},112:{l:{97:{l:{114:{l:{59:{c:[41]},103:{l:{116:{l:{59:{c:[10644]}}}}}}}}},112:{l:{111:{l:{108:{l:{105:{l:{110:{l:{116:{l:{59:{c:[10770]}}}}}}}}}}}}}}},114:{l:{97:{l:{114:{l:{114:{l:{59:{c:[8649]}}}}}}}}},115:{l:{97:{l:{113:{l:{117:{l:{111:{l:{59:{c:[8250]}}}}}}}}},99:{l:{114:{l:{59:{c:[120007]}}}}},104:{l:{59:{c:[8625]}}},113:{l:{98:{l:{59:{c:[93]}}},117:{l:{111:{l:{59:{c:[8217]},114:{l:{59:{c:[8217]}}}}}}}}}}},116:{l:{104:{l:{114:{l:{101:{l:{101:{l:{59:{c:[8908]}}}}}}}}},105:{l:{109:{l:{101:{l:{115:{l:{59:{c:[8906]}}}}}}}}},114:{l:{105:{l:{59:{c:[9657]},101:{l:{59:{c:[8885]}}},102:{l:{59:{c:[9656]}}},108:{l:{116:{l:{114:{l:{105:{l:{59:{c:[10702]}}}}}}}}}}}}}}},117:{l:{108:{l:{117:{l:{104:{l:{97:{l:{114:{l:{59:{c:[10600]}}}}}}}}}}}}},120:{l:{59:{c:[8478]}}}}},115:{l:{97:{l:{99:{l:{117:{l:{116:{l:{101:{l:{59:{c:[347]}}}}}}}}}}},98:{l:{113:{l:{117:{l:{111:{l:{59:{c:[8218]}}}}}}}}},99:{l:{59:{c:[8827]},69:{l:{59:{c:[10932]}}},97:{l:{112:{l:{59:{c:[10936]}}},114:{l:{111:{l:{110:{l:{59:{c:[353]}}}}}}}}},99:{l:{117:{l:{101:{l:{59:{c:[8829]}}}}}}},101:{l:{59:{c:[10928]},100:{l:{105:{l:{108:{l:{59:{c:[351]}}}}}}}}},105:{l:{114:{l:{99:{l:{59:{c:[349]}}}}}}},110:{l:{69:{l:{59:{c:[10934]}}},97:{l:{112:{l:{59:{c:[10938]}}}}},115:{l:{105:{l:{109:{l:{59:{c:[8937]}}}}}}}}},112:{l:{111:{l:{108:{l:{105:{l:{110:{l:{116:{l:{59:{c:[10771]}}}}}}}}}}}}},115:{l:{105:{l:{109:{l:{59:{c:[8831]}}}}}}},121:{l:{59:{c:[1089]}}}}},100:{l:{111:{l:{116:{l:{59:{c:[8901]},98:{l:{59:{c:[8865]}}},101:{l:{59:{c:[10854]}}}}}}}}},101:{l:{65:{l:{114:{l:{114:{l:{59:{c:[8664]}}}}}}},97:{l:{114:{l:{104:{l:{107:{l:{59:{c:[10533]}}}}},114:{l:{59:{c:[8600]},111:{l:{119:{l:{59:{c:[8600]}}}}}}}}}}},99:{l:{116:{l:{59:{c:[167]}},c:[167]}}},109:{l:{105:{l:{59:{c:[59]}}}}},115:{l:{119:{l:{97:{l:{114:{l:{59:{c:[10537]}}}}}}}}},116:{l:{109:{l:{105:{l:{110:{l:{117:{l:{115:{l:{59:{c:[8726]}}}}}}}}},110:{l:{59:{c:[8726]}}}}}}},120:{l:{116:{l:{59:{c:[10038]}}}}}}},102:{l:{114:{l:{59:{c:[120112]},111:{l:{119:{l:{110:{l:{59:{c:[8994]}}}}}}}}}}},104:{l:{97:{l:{114:{l:{112:{l:{59:{c:[9839]}}}}}}},99:{l:{104:{l:{99:{l:{121:{l:{59:{c:[1097]}}}}}}},121:{l:{59:{c:[1096]}}}}},111:{l:{114:{l:{116:{l:{109:{l:{105:{l:{100:{l:{59:{c:[8739]}}}}}}},112:{l:{97:{l:{114:{l:{97:{l:{108:{l:{108:{l:{101:{l:{108:{l:{59:{c:[8741]}}}}}}}}}}}}}}}}}}}}}}},121:{l:{59:{c:[173]}},c:[173]}}},105:{l:{103:{l:{109:{l:{97:{l:{59:{c:[963]},102:{l:{59:{c:[962]}}},118:{l:{59:{c:[962]}}}}}}}}},109:{l:{59:{c:[8764]},100:{l:{111:{l:{116:{l:{59:{c:[10858]}}}}}}},101:{l:{59:{c:[8771]},113:{l:{59:{c:[8771]}}}}},103:{l:{59:{c:[10910]},69:{l:{59:{c:[10912]}}}}},108:{l:{59:{c:[10909]},69:{l:{59:{c:[10911]}}}}},110:{l:{101:{l:{59:{c:[8774]}}}}},112:{l:{108:{l:{117:{l:{115:{l:{59:{c:[10788]}}}}}}}}},114:{l:{97:{l:{114:{l:{114:{l:{59:{c:[10610]}}}}}}}}}}}}},108:{l:{97:{l:{114:{l:{114:{l:{59:{c:[8592]}}}}}}}}},109:{l:{97:{l:{108:{l:{108:{l:{115:{l:{101:{l:{116:{l:{109:{l:{105:{l:{110:{l:{117:{l:{115:{l:{59:{c:[8726]}}}}}}}}}}}}}}}}}}}}},115:{l:{104:{l:{112:{l:{59:{c:[10803]}}}}}}}}},101:{l:{112:{l:{97:{l:{114:{l:{115:{l:{108:{l:{59:{c:[10724]}}}}}}}}}}}}},105:{l:{100:{l:{59:{c:[8739]}}},108:{l:{101:{l:{59:{c:[8995]}}}}}}},116:{l:{59:{c:[10922]},101:{l:{59:{c:[10924]},115:{l:{59:{c:[10924,65024]}}}}}}}}},111:{l:{102:{l:{116:{l:{99:{l:{121:{l:{59:{c:[1100]}}}}}}}}},108:{l:{59:{c:[47]},98:{l:{59:{c:[10692]},97:{l:{114:{l:{59:{c:[9023]}}}}}}}}},112:{l:{102:{l:{59:{c:[120164]}}}}}}},112:{l:{97:{l:{100:{l:{101:{l:{115:{l:{59:{c:[9824]},117:{l:{105:{l:{116:{l:{59:{c:[9824]}}}}}}}}}}}}},114:{l:{59:{c:[8741]}}}}}}},113:{l:{99:{l:{97:{l:{112:{l:{59:{c:[8851]},115:{l:{59:{c:[8851,65024]}}}}}}},117:{l:{112:{l:{59:{c:[8852]},115:{l:{59:{c:[8852,65024]}}}}}}}}},115:{l:{117:{l:{98:{l:{59:{c:[8847]},101:{l:{59:{c:[8849]}}},115:{l:{101:{l:{116:{l:{59:{c:[8847]},101:{l:{113:{l:{59:{c:[8849]}}}}}}}}}}}}},112:{l:{59:{c:[8848]},101:{l:{59:{c:[8850]}}},115:{l:{101:{l:{116:{l:{59:{c:[8848]},101:{l:{113:{l:{59:{c:[8850]}}}}}}}}}}}}}}}}},117:{l:{59:{c:[9633]},97:{l:{114:{l:{101:{l:{59:{c:[9633]}}},102:{l:{59:{c:[9642]}}}}}}},102:{l:{59:{c:[9642]}}}}}}},114:{l:{97:{l:{114:{l:{114:{l:{59:{c:[8594]}}}}}}}}},115:{l:{99:{l:{114:{l:{59:{c:[120008]}}}}},101:{l:{116:{l:{109:{l:{110:{l:{59:{c:[8726]}}}}}}}}},109:{l:{105:{l:{108:{l:{101:{l:{59:{c:[8995]}}}}}}}}},116:{l:{97:{l:{114:{l:{102:{l:{59:{c:[8902]}}}}}}}}}}},116:{l:{97:{l:{114:{l:{59:{c:[9734]},102:{l:{59:{c:[9733]}}}}}}},114:{l:{97:{l:{105:{l:{103:{l:{104:{l:{116:{l:{101:{l:{112:{l:{115:{l:{105:{l:{108:{l:{111:{l:{110:{l:{59:{c:[1013]}}}}}}}}}}}}}}},112:{l:{104:{l:{105:{l:{59:{c:[981]}}}}}}}}}}}}}}}}},110:{l:{115:{l:{59:{c:[175]}}}}}}}}},117:{l:{98:{l:{59:{c:[8834]},69:{l:{59:{c:[10949]}}},100:{l:{111:{l:{116:{l:{59:{c:[10941]}}}}}}},101:{l:{59:{c:[8838]},100:{l:{111:{l:{116:{l:{59:{c:[10947]}}}}}}}}},109:{l:{117:{l:{108:{l:{116:{l:{59:{c:[10945]}}}}}}}}},110:{l:{69:{l:{59:{c:[10955]}}},101:{l:{59:{c:[8842]}}}}},112:{l:{108:{l:{117:{l:{115:{l:{59:{c:[10943]}}}}}}}}},114:{l:{97:{l:{114:{l:{114:{l:{59:{c:[10617]}}}}}}}}},115:{l:{101:{l:{116:{l:{59:{c:[8834]},101:{l:{113:{l:{59:{c:[8838]},113:{l:{59:{c:[10949]}}}}}}},110:{l:{101:{l:{113:{l:{59:{c:[8842]},113:{l:{59:{c:[10955]}}}}}}}}}}}}},105:{l:{109:{l:{59:{c:[10951]}}}}},117:{l:{98:{l:{59:{c:[10965]}}},112:{l:{59:{c:[10963]}}}}}}}}},99:{l:{99:{l:{59:{c:[8827]},97:{l:{112:{l:{112:{l:{114:{l:{111:{l:{120:{l:{59:{c:[10936]}}}}}}}}}}}}},99:{l:{117:{l:{114:{l:{108:{l:{121:{l:{101:{l:{113:{l:{59:{c:[8829]}}}}}}}}}}}}}}},101:{l:{113:{l:{59:{c:[10928]}}}}},110:{l:{97:{l:{112:{l:{112:{l:{114:{l:{111:{l:{120:{l:{59:{c:[10938]}}}}}}}}}}}}},101:{l:{113:{l:{113:{l:{59:{c:[10934]}}}}}}},115:{l:{105:{l:{109:{l:{59:{c:[8937]}}}}}}}}},115:{l:{105:{l:{109:{l:{59:{c:[8831]}}}}}}}}}}},109:{l:{59:{c:[8721]}}},110:{l:{103:{l:{59:{c:[9834]}}}}},112:{l:{49:{l:{59:{c:[185]}},c:[185]},50:{l:{59:{c:[178]}},c:[178]},51:{l:{59:{c:[179]}},c:[179]},59:{c:[8835]},69:{l:{59:{c:[10950]}}},100:{l:{111:{l:{116:{l:{59:{c:[10942]}}}}},115:{l:{117:{l:{98:{l:{59:{c:[10968]}}}}}}}}},101:{l:{59:{c:[8839]},100:{l:{111:{l:{116:{l:{59:{c:[10948]}}}}}}}}},104:{l:{115:{l:{111:{l:{108:{l:{59:{c:[10185]}}}}},117:{l:{98:{l:{59:{c:[10967]}}}}}}}}},108:{l:{97:{l:{114:{l:{114:{l:{59:{c:[10619]}}}}}}}}},109:{l:{117:{l:{108:{l:{116:{l:{59:{c:[10946]}}}}}}}}},110:{l:{69:{l:{59:{c:[10956]}}},101:{l:{59:{c:[8843]}}}}},112:{l:{108:{l:{117:{l:{115:{l:{59:{c:[10944]}}}}}}}}},115:{l:{101:{l:{116:{l:{59:{c:[8835]},101:{l:{113:{l:{59:{c:[8839]},113:{l:{59:{c:[10950]}}}}}}},110:{l:{101:{l:{113:{l:{59:{c:[8843]},113:{l:{59:{c:[10956]}}}}}}}}}}}}},105:{l:{109:{l:{59:{c:[10952]}}}}},117:{l:{98:{l:{59:{c:[10964]}}},112:{l:{59:{c:[10966]}}}}}}}}}}},119:{l:{65:{l:{114:{l:{114:{l:{59:{c:[8665]}}}}}}},97:{l:{114:{l:{104:{l:{107:{l:{59:{c:[10534]}}}}},114:{l:{59:{c:[8601]},111:{l:{119:{l:{59:{c:[8601]}}}}}}}}}}},110:{l:{119:{l:{97:{l:{114:{l:{59:{c:[10538]}}}}}}}}}}},122:{l:{108:{l:{105:{l:{103:{l:{59:{c:[223]}},c:[223]}}}}}}}}},116:{l:{97:{l:{114:{l:{103:{l:{101:{l:{116:{l:{59:{c:[8982]}}}}}}}}},117:{l:{59:{c:[964]}}}}},98:{l:{114:{l:{107:{l:{59:{c:[9140]}}}}}}},99:{l:{97:{l:{114:{l:{111:{l:{110:{l:{59:{c:[357]}}}}}}}}},101:{l:{100:{l:{105:{l:{108:{l:{59:{c:[355]}}}}}}}}},121:{l:{59:{c:[1090]}}}}},100:{l:{111:{l:{116:{l:{59:{c:[8411]}}}}}}},101:{l:{108:{l:{114:{l:{101:{l:{99:{l:{59:{c:[8981]}}}}}}}}}}},102:{l:{114:{l:{59:{c:[120113]}}}}},104:{l:{101:{l:{114:{l:{101:{l:{52:{l:{59:{c:[8756]}}},102:{l:{111:{l:{114:{l:{101:{l:{59:{c:[8756]}}}}}}}}}}}}},116:{l:{97:{l:{59:{c:[952]},115:{l:{121:{l:{109:{l:{59:{c:[977]}}}}}}},118:{l:{59:{c:[977]}}}}}}}}},105:{l:{99:{l:{107:{l:{97:{l:{112:{l:{112:{l:{114:{l:{111:{l:{120:{l:{59:{c:[8776]}}}}}}}}}}}}},115:{l:{105:{l:{109:{l:{59:{c:[8764]}}}}}}}}}}},110:{l:{115:{l:{112:{l:{59:{c:[8201]}}}}}}}}},107:{l:{97:{l:{112:{l:{59:{c:[8776]}}}}},115:{l:{105:{l:{109:{l:{59:{c:[8764]}}}}}}}}},111:{l:{114:{l:{110:{l:{59:{c:[254]}},c:[254]}}}}}}},105:{l:{108:{l:{100:{l:{101:{l:{59:{c:[732]}}}}}}},109:{l:{101:{l:{115:{l:{59:{c:[215]},98:{l:{59:{c:[8864]},97:{l:{114:{l:{59:{c:[10801]}}}}}}},100:{l:{59:{c:[10800]}}}},c:[215]}}}}},110:{l:{116:{l:{59:{c:[8749]}}}}}}},111:{l:{101:{l:{97:{l:{59:{c:[10536]}}}}},112:{l:{59:{c:[8868]},98:{l:{111:{l:{116:{l:{59:{c:[9014]}}}}}}},99:{l:{105:{l:{114:{l:{59:{c:[10993]}}}}}}},102:{l:{59:{c:[120165]},111:{l:{114:{l:{107:{l:{59:{c:[10970]}}}}}}}}}}},115:{l:{97:{l:{59:{c:[10537]}}}}}}},112:{l:{114:{l:{105:{l:{109:{l:{101:{l:{59:{c:[8244]}}}}}}}}}}},114:{l:{97:{l:{100:{l:{101:{l:{59:{c:[8482]}}}}}}},105:{l:{97:{l:{110:{l:{103:{l:{108:{l:{101:{l:{59:{c:[9653]},100:{l:{111:{l:{119:{l:{110:{l:{59:{c:[9663]}}}}}}}}},108:{l:{101:{l:{102:{l:{116:{l:{59:{c:[9667]},101:{l:{113:{l:{59:{c:[8884]}}}}}}}}}}}}},113:{l:{59:{c:[8796]}}},114:{l:{105:{l:{103:{l:{104:{l:{116:{l:{59:{c:[9657]},101:{l:{113:{l:{59:{c:[8885]}}}}}}}}}}}}}}}}}}}}}}}}},100:{l:{111:{l:{116:{l:{59:{c:[9708]}}}}}}},101:{l:{59:{c:[8796]}}},109:{l:{105:{l:{110:{l:{117:{l:{115:{l:{59:{c:[10810]}}}}}}}}}}},112:{l:{108:{l:{117:{l:{115:{l:{59:{c:[10809]}}}}}}}}},115:{l:{98:{l:{59:{c:[10701]}}}}},116:{l:{105:{l:{109:{l:{101:{l:{59:{c:[10811]}}}}}}}}}}},112:{l:{101:{l:{122:{l:{105:{l:{117:{l:{109:{l:{59:{c:[9186]}}}}}}}}}}}}}}},115:{l:{99:{l:{114:{l:{59:{c:[120009]}}},121:{l:{59:{c:[1094]}}}}},104:{l:{99:{l:{121:{l:{59:{c:[1115]}}}}}}},116:{l:{114:{l:{111:{l:{107:{l:{59:{c:[359]}}}}}}}}}}},119:{l:{105:{l:{120:{l:{116:{l:{59:{c:[8812]}}}}}}},111:{l:{104:{l:{101:{l:{97:{l:{100:{l:{108:{l:{101:{l:{102:{l:{116:{l:{97:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[8606]}}}}}}}}}}}}}}}}}}},114:{l:{105:{l:{103:{l:{104:{l:{116:{l:{97:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[8608]}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},117:{l:{65:{l:{114:{l:{114:{l:{59:{c:[8657]}}}}}}},72:{l:{97:{l:{114:{l:{59:{c:[10595]}}}}}}},97:{l:{99:{l:{117:{l:{116:{l:{101:{l:{59:{c:[250]}},c:[250]}}}}}}},114:{l:{114:{l:{59:{c:[8593]}}}}}}},98:{l:{114:{l:{99:{l:{121:{l:{59:{c:[1118]}}}}},101:{l:{118:{l:{101:{l:{59:{c:[365]}}}}}}}}}}},99:{l:{105:{l:{114:{l:{99:{l:{59:{c:[251]}},c:[251]}}}}},121:{l:{59:{c:[1091]}}}}},100:{l:{97:{l:{114:{l:{114:{l:{59:{c:[8645]}}}}}}},98:{l:{108:{l:{97:{l:{99:{l:{59:{c:[369]}}}}}}}}},104:{l:{97:{l:{114:{l:{59:{c:[10606]}}}}}}}}},102:{l:{105:{l:{115:{l:{104:{l:{116:{l:{59:{c:[10622]}}}}}}}}},114:{l:{59:{c:[120114]}}}}},103:{l:{114:{l:{97:{l:{118:{l:{101:{l:{59:{c:[249]}},c:[249]}}}}}}}}},104:{l:{97:{l:{114:{l:{108:{l:{59:{c:[8639]}}},114:{l:{59:{c:[8638]}}}}}}},98:{l:{108:{l:{107:{l:{59:{c:[9600]}}}}}}}}},108:{l:{99:{l:{111:{l:{114:{l:{110:{l:{59:{c:[8988]},101:{l:{114:{l:{59:{c:[8988]}}}}}}}}}}},114:{l:{111:{l:{112:{l:{59:{c:[8975]}}}}}}}}},116:{l:{114:{l:{105:{l:{59:{c:[9720]}}}}}}}}},109:{l:{97:{l:{99:{l:{114:{l:{59:{c:[363]}}}}}}},108:{l:{59:{c:[168]}},c:[168]}}},111:{l:{103:{l:{111:{l:{110:{l:{59:{c:[371]}}}}}}},112:{l:{102:{l:{59:{c:[120166]}}}}}}},112:{l:{97:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[8593]}}}}}}}}}}},100:{l:{111:{l:{119:{l:{110:{l:{97:{l:{114:{l:{114:{l:{111:{l:{119:{l:{59:{c:[8597]}}}}}}}}}}}}}}}}}}},104:{l:{97:{l:{114:{l:{112:{l:{111:{l:{111:{l:{110:{l:{108:{l:{101:{l:{102:{l:{116:{l:{59:{c:[8639]}}}}}}}}},114:{l:{105:{l:{103:{l:{104:{l:{116:{l:{59:{c:[8638]}}}}}}}}}}}}}}}}}}}}}}}}},108:{l:{117:{l:{115:{l:{59:{c:[8846]}}}}}}},115:{l:{105:{l:{59:{c:[965]},104:{l:{59:{c:[978]}}},108:{l:{111:{l:{110:{l:{59:{c:[965]}}}}}}}}}}},117:{l:{112:{l:{97:{l:{114:{l:{114:{l:{111:{l:{119:{l:{115:{l:{59:{c:[8648]}}}}}}}}}}}}}}}}}}},114:{l:{99:{l:{111:{l:{114:{l:{110:{l:{59:{c:[8989]},101:{l:{114:{l:{59:{c:[8989]}}}}}}}}}}},114:{l:{111:{l:{112:{l:{59:{c:[8974]}}}}}}}}},105:{l:{110:{l:{103:{l:{59:{c:[367]}}}}}}},116:{l:{114:{l:{105:{l:{59:{c:[9721]}}}}}}}}},115:{l:{99:{l:{114:{l:{59:{c:[120010]}}}}}}},116:{l:{100:{l:{111:{l:{116:{l:{59:{c:[8944]}}}}}}},105:{l:{108:{l:{100:{l:{101:{l:{59:{c:[361]}}}}}}}}},114:{l:{105:{l:{59:{c:[9653]},102:{l:{59:{c:[9652]}}}}}}}}},117:{l:{97:{l:{114:{l:{114:{l:{59:{c:[8648]}}}}}}},109:{l:{108:{l:{59:{c:[252]}},c:[252]}}}}},119:{l:{97:{l:{110:{l:{103:{l:{108:{l:{101:{l:{59:{c:[10663]}}}}}}}}}}}}}}},118:{l:{65:{l:{114:{l:{114:{l:{59:{c:[8661]}}}}}}},66:{l:{97:{l:{114:{l:{59:{c:[10984]},118:{l:{59:{c:[10985]}}}}}}}}},68:{l:{97:{l:{115:{l:{104:{l:{59:{c:[8872]}}}}}}}}},97:{l:{110:{l:{103:{l:{114:{l:{116:{l:{59:{c:[10652]}}}}}}}}},114:{l:{101:{l:{112:{l:{115:{l:{105:{l:{108:{l:{111:{l:{110:{l:{59:{c:[1013]}}}}}}}}}}}}}}},107:{l:{97:{l:{112:{l:{112:{l:{97:{l:{59:{c:[1008]}}}}}}}}}}},110:{l:{111:{l:{116:{l:{104:{l:{105:{l:{110:{l:{103:{l:{59:{c:[8709]}}}}}}}}}}}}}}},112:{l:{104:{l:{105:{l:{59:{c:[981]}}}}},105:{l:{59:{c:[982]}}},114:{l:{111:{l:{112:{l:{116:{l:{111:{l:{59:{c:[8733]}}}}}}}}}}}}},114:{l:{59:{c:[8597]},104:{l:{111:{l:{59:{c:[1009]}}}}}}},115:{l:{105:{l:{103:{l:{109:{l:{97:{l:{59:{c:[962]}}}}}}}}},117:{l:{98:{l:{115:{l:{101:{l:{116:{l:{110:{l:{101:{l:{113:{l:{59:{c:[8842,65024]},113:{l:{59:{c:[10955,65024]}}}}}}}}}}}}}}}}},112:{l:{115:{l:{101:{l:{116:{l:{110:{l:{101:{l:{113:{l:{59:{c:[8843,65024]},113:{l:{59:{c:[10956,65024]}}}}}}}}}}}}}}}}}}}}},116:{l:{104:{l:{101:{l:{116:{l:{97:{l:{59:{c:[977]}}}}}}}}},114:{l:{105:{l:{97:{l:{110:{l:{103:{l:{108:{l:{101:{l:{108:{l:{101:{l:{102:{l:{116:{l:{59:{c:[8882]}}}}}}}}},114:{l:{105:{l:{103:{l:{104:{l:{116:{l:{59:{c:[8883]}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},99:{l:{121:{l:{59:{c:[1074]}}}}},100:{l:{97:{l:{115:{l:{104:{l:{59:{c:[8866]}}}}}}}}},101:{l:{101:{l:{59:{c:[8744]},98:{l:{97:{l:{114:{l:{59:{c:[8891]}}}}}}},101:{l:{113:{l:{59:{c:[8794]}}}}}}},108:{l:{108:{l:{105:{l:{112:{l:{59:{c:[8942]}}}}}}}}},114:{l:{98:{l:{97:{l:{114:{l:{59:{c:[124]}}}}}}},116:{l:{59:{c:[124]}}}}}}},102:{l:{114:{l:{59:{c:[120115]}}}}},108:{l:{116:{l:{114:{l:{105:{l:{59:{c:[8882]}}}}}}}}},110:{l:{115:{l:{117:{l:{98:{l:{59:{c:[8834,8402]}}},112:{l:{59:{c:[8835,8402]}}}}}}}}},111:{l:{112:{l:{102:{l:{59:{c:[120167]}}}}}}},112:{l:{114:{l:{111:{l:{112:{l:{59:{c:[8733]}}}}}}}}},114:{l:{116:{l:{114:{l:{105:{l:{59:{c:[8883]}}}}}}}}},115:{l:{99:{l:{114:{l:{59:{c:[120011]}}}}},117:{l:{98:{l:{110:{l:{69:{l:{59:{c:[10955,65024]}}},101:{l:{59:{c:[8842,65024]}}}}}}},112:{l:{110:{l:{69:{l:{59:{c:[10956,65024]}}},101:{l:{59:{c:[8843,65024]}}}}}}}}}}},122:{l:{105:{l:{103:{l:{122:{l:{97:{l:{103:{l:{59:{c:[10650]}}}}}}}}}}}}}}},119:{l:{99:{l:{105:{l:{114:{l:{99:{l:{59:{c:[373]}}}}}}}}},101:{l:{100:{l:{98:{l:{97:{l:{114:{l:{59:{c:[10847]}}}}}}},103:{l:{101:{l:{59:{c:[8743]},113:{l:{59:{c:[8793]}}}}}}}}},105:{l:{101:{l:{114:{l:{112:{l:{59:{c:[8472]}}}}}}}}}}},102:{l:{114:{l:{59:{c:[120116]}}}}},111:{l:{112:{l:{102:{l:{59:{c:[120168]}}}}}}},112:{l:{59:{c:[8472]}}},114:{l:{59:{c:[8768]},101:{l:{97:{l:{116:{l:{104:{l:{59:{c:[8768]}}}}}}}}}}},115:{l:{99:{l:{114:{l:{59:{c:[120012]}}}}}}}}},120:{l:{99:{l:{97:{l:{112:{l:{59:{c:[8898]}}}}},105:{l:{114:{l:{99:{l:{59:{c:[9711]}}}}}}},117:{l:{112:{l:{59:{c:[8899]}}}}}}},100:{l:{116:{l:{114:{l:{105:{l:{59:{c:[9661]}}}}}}}}},102:{l:{114:{l:{59:{c:[120117]}}}}},104:{l:{65:{l:{114:{l:{114:{l:{59:{c:[10234]}}}}}}},97:{l:{114:{l:{114:{l:{59:{c:[10231]}}}}}}}}},105:{l:{59:{c:[958]}}},108:{l:{65:{l:{114:{l:{114:{l:{59:{c:[10232]}}}}}}},97:{l:{114:{l:{114:{l:{59:{c:[10229]}}}}}}}}},109:{l:{97:{l:{112:{l:{59:{c:[10236]}}}}}}},110:{l:{105:{l:{115:{l:{59:{c:[8955]}}}}}}},111:{l:{100:{l:{111:{l:{116:{l:{59:{c:[10752]}}}}}}},112:{l:{102:{l:{59:{c:[120169]}}},108:{l:{117:{l:{115:{l:{59:{c:[10753]}}}}}}}}},116:{l:{105:{l:{109:{l:{101:{l:{59:{c:[10754]}}}}}}}}}}},114:{l:{65:{l:{114:{l:{114:{l:{59:{c:[10233]}}}}}}},97:{l:{114:{l:{114:{l:{59:{c:[10230]}}}}}}}}},115:{l:{99:{l:{114:{l:{59:{c:[120013]}}}}},113:{l:{99:{l:{117:{l:{112:{l:{59:{c:[10758]}}}}}}}}}}},117:{l:{112:{l:{108:{l:{117:{l:{115:{l:{59:{c:[10756]}}}}}}}}},116:{l:{114:{l:{105:{l:{59:{c:[9651]}}}}}}}}},118:{l:{101:{l:{101:{l:{59:{c:[8897]}}}}}}},119:{l:{101:{l:{100:{l:{103:{l:{101:{l:{59:{c:[8896]}}}}}}}}}}}}},121:{l:{97:{l:{99:{l:{117:{l:{116:{l:{101:{l:{59:{c:[253]}},c:[253]}}}}},121:{l:{59:{c:[1103]}}}}}}},99:{l:{105:{l:{114:{l:{99:{l:{59:{c:[375]}}}}}}},121:{l:{59:{c:[1099]}}}}},101:{l:{110:{l:{59:{c:[165]}},c:[165]}}},102:{l:{114:{l:{59:{c:[120118]}}}}},105:{l:{99:{l:{121:{l:{59:{c:[1111]}}}}}}},111:{l:{112:{l:{102:{l:{59:{c:[120170]}}}}}}},115:{l:{99:{l:{114:{l:{59:{c:[120014]}}}}}}},117:{l:{99:{l:{121:{l:{59:{c:[1102]}}}}},109:{l:{108:{l:{59:{c:[255]}},c:[255]}}}}}}},122:{l:{97:{l:{99:{l:{117:{l:{116:{l:{101:{l:{59:{c:[378]}}}}}}}}}}},99:{l:{97:{l:{114:{l:{111:{l:{110:{l:{59:{c:[382]}}}}}}}}},121:{l:{59:{c:[1079]}}}}},100:{l:{111:{l:{116:{l:{59:{c:[380]}}}}}}},101:{l:{101:{l:{116:{l:{114:{l:{102:{l:{59:{c:[8488]}}}}}}}}},116:{l:{97:{l:{59:{c:[950]}}}}}}},102:{l:{114:{l:{59:{c:[120119]}}}}},104:{l:{99:{l:{121:{l:{59:{c:[1078]}}}}}}},105:{l:{103:{l:{114:{l:{97:{l:{114:{l:{114:{l:{59:{c:[8669]}}}}}}}}}}}}},111:{l:{112:{l:{102:{l:{59:{c:[120171]}}}}}}},115:{l:{99:{l:{114:{l:{59:{c:[120015]}}}}}}},119:{l:{106:{l:{59:{c:[8205]}}},110:{l:{106:{l:{59:{c:[8204]}}}}}}}}}};
diff --git a/tools/eslint/node_modules/parse5/lib/tokenizer/preprocessor.js b/tools/eslint/node_modules/parse5/lib/tokenizer/preprocessor.js
deleted file mode 100644
index 8090653711..0000000000
--- a/tools/eslint/node_modules/parse5/lib/tokenizer/preprocessor.js
+++ /dev/null
@@ -1,155 +0,0 @@
-'use strict';
-
-var UNICODE = require('../common/unicode');
-
-//Aliases
-var $ = UNICODE.CODE_POINTS;
-
-//Utils
-
-//OPTIMIZATION: these utility functions should not be moved out of this module. V8 Crankshaft will not inline
-//this functions if they will be situated in another module due to context switch.
-//Always perform inlining check before modifying this functions ('node --trace-inlining').
-function isSurrogatePair(cp1, cp2) {
- return cp1 >= 0xD800 && cp1 <= 0xDBFF && cp2 >= 0xDC00 && cp2 <= 0xDFFF;
-}
-
-function getSurrogatePairCodePoint(cp1, cp2) {
- return (cp1 - 0xD800) * 0x400 + 0x2400 + cp2;
-}
-
-
-//Const
-var DEFAULT_BUFFER_WATERLINE = 1 << 16;
-
-
-//Preprocessor
-//NOTE: HTML input preprocessing
-//(see: http://www.whatwg.org/specs/web-apps/current-work/multipage/parsing.html#preprocessing-the-input-stream)
-var Preprocessor = module.exports = function () {
- this.html = null;
-
- this.pos = -1;
- this.lastGapPos = -1;
- this.lastCharPos = -1;
- this.droppedBufferSize = 0;
-
- this.gapStack = [];
-
- this.skipNextNewLine = false;
-
- this.lastChunkWritten = false;
- this.endOfChunkHit = false;
- this.bufferWaterline = DEFAULT_BUFFER_WATERLINE;
-};
-
-Object.defineProperty(Preprocessor.prototype, 'sourcePos', {
- get: function () {
- return this.droppedBufferSize + this.pos;
- }
-});
-
-Preprocessor.prototype.dropParsedChunk = function () {
- if (this.pos > this.bufferWaterline) {
- this.lastCharPos -= this.pos;
- this.droppedBufferSize += this.pos;
- this.html = this.html.substring(this.pos);
- this.pos = 0;
- this.lastGapPos = -1;
- this.gapStack = [];
- }
-};
-
-Preprocessor.prototype._addGap = function () {
- this.gapStack.push(this.lastGapPos);
- this.lastGapPos = this.pos;
-};
-
-Preprocessor.prototype._processHighRangeCodePoint = function (cp) {
- //NOTE: try to peek a surrogate pair
- if (this.pos !== this.lastCharPos) {
- var nextCp = this.html.charCodeAt(this.pos + 1);
-
- if (isSurrogatePair(cp, nextCp)) {
- //NOTE: we have a surrogate pair. Peek pair character and recalculate code point.
- this.pos++;
- cp = getSurrogatePairCodePoint(cp, nextCp);
-
- //NOTE: add gap that should be avoided during retreat
- this._addGap();
- }
- }
-
- // NOTE: we've hit the end of chunk, stop processing at this point
- else if (!this.lastChunkWritten) {
- this.endOfChunkHit = true;
- return $.EOF;
- }
-
- return cp;
-};
-
-Preprocessor.prototype.write = function (chunk, isLastChunk) {
- if (this.html)
- this.html += chunk;
-
- else
- this.html = chunk;
-
- this.lastCharPos = this.html.length - 1;
- this.endOfChunkHit = false;
- this.lastChunkWritten = isLastChunk;
-};
-
-Preprocessor.prototype.insertHtmlAtCurrentPos = function (chunk) {
- this.html = this.html.substring(0, this.pos + 1) +
- chunk +
- this.html.substring(this.pos + 1, this.html.length);
-
- this.lastCharPos = this.html.length - 1;
- this.endOfChunkHit = false;
-};
-
-
-Preprocessor.prototype.advance = function () {
- this.pos++;
-
- if (this.pos > this.lastCharPos) {
- if (!this.lastChunkWritten)
- this.endOfChunkHit = true;
-
- return $.EOF;
- }
-
- var cp = this.html.charCodeAt(this.pos);
-
- //NOTE: any U+000A LINE FEED (LF) characters that immediately follow a U+000D CARRIAGE RETURN (CR) character
- //must be ignored.
- if (this.skipNextNewLine && cp === $.LINE_FEED) {
- this.skipNextNewLine = false;
- this._addGap();
- return this.advance();
- }
-
- //NOTE: all U+000D CARRIAGE RETURN (CR) characters must be converted to U+000A LINE FEED (LF) characters
- if (cp === $.CARRIAGE_RETURN) {
- this.skipNextNewLine = true;
- return $.LINE_FEED;
- }
-
- this.skipNextNewLine = false;
-
- //OPTIMIZATION: first perform check if the code point in the allowed range that covers most common
- //HTML input (e.g. ASCII codes) to avoid performance-cost operations for high-range code points.
- return cp >= 0xD800 ? this._processHighRangeCodePoint(cp) : cp;
-};
-
-Preprocessor.prototype.retreat = function () {
- if (this.pos === this.lastGapPos) {
- this.lastGapPos = this.gapStack.pop();
- this.pos--;
- }
-
- this.pos--;
-};
-
diff --git a/tools/eslint/node_modules/parse5/lib/tree_adapters/default.js b/tools/eslint/node_modules/parse5/lib/tree_adapters/default.js
deleted file mode 100644
index d366b8c46d..0000000000
--- a/tools/eslint/node_modules/parse5/lib/tree_adapters/default.js
+++ /dev/null
@@ -1,578 +0,0 @@
-'use strict';
-
-/**
- * @typedef {Object} TreeAdapter
- */
-
-//Node construction
-
-/**
- * Creates a document node.
- *
- * @function createDocument
- * @memberof TreeAdapter
- *
- * @returns {ASTNode<Document>} document
- *
- * @see {@link https://github.com/inikulin/parse5/blob/tree-adapter-docs-rev/lib/tree_adapters/default.js#L19|default implementation.}
- */
-exports.createDocument = function () {
- return {
- nodeName: '#document',
- quirksMode: false,
- childNodes: []
- };
-};
-
-/**
- * Creates a document fragment node.
- *
- * @function createDocumentFragment
- * @memberof TreeAdapter
- *
- * @returns {ASTNode<DocumentFragment>} fragment
- *
- * @see {@link https://github.com/inikulin/parse5/blob/tree-adapter-docs-rev/lib/tree_adapters/default.js#L37|default implementation.}
- */
-exports.createDocumentFragment = function () {
- return {
- nodeName: '#document-fragment',
- quirksMode: false,
- childNodes: []
- };
-};
-
-
-/**
- * Creates an element node.
- *
- * @function createElement
- * @memberof TreeAdapter
- *
- * @param {String} tagName - Tag name of the element.
- * @param {String} namespaceURI - Namespace of the element.
- * @param {Array} attrs - Attribute name-value pair array.
- * Foreign attributes may contain `namespace` and `prefix` fields as well.
- *
- * @returns {ASTNode<Element>} element
- *
- * @see {@link https://github.com/inikulin/parse5/blob/tree-adapter-docs-rev/lib/tree_adapters/default.js#L61|default implementation.}
- */
-exports.createElement = function (tagName, namespaceURI, attrs) {
- return {
- nodeName: tagName,
- tagName: tagName,
- attrs: attrs,
- namespaceURI: namespaceURI,
- childNodes: [],
- parentNode: null
- };
-};
-
-
-/**
- * Creates a comment node.
- *
- * @function createCommentNode
- * @memberof TreeAdapter
- *
- * @param {String} data - Comment text.
- *
- * @returns {ASTNode<CommentNode>} comment
- *
- * @see {@link https://github.com/inikulin/parse5/blob/tree-adapter-docs-rev/lib/tree_adapters/default.js#L85|default implementation.}
- */
-exports.createCommentNode = function (data) {
- return {
- nodeName: '#comment',
- data: data,
- parentNode: null
- };
-};
-
-var createTextNode = function (value) {
- return {
- nodeName: '#text',
- value: value,
- parentNode: null
- };
-};
-
-
-//Tree mutation
-/**
- * Appends a child node to the given parent node.
- *
- * @function appendChild
- * @memberof TreeAdapter
- *
- * @param {ASTNode} parentNode - Parent node.
- * @param {ASTNode} newNode - Child node.
- *
- * @see {@link https://github.com/inikulin/parse5/blob/tree-adapter-docs-rev/lib/tree_adapters/default.js#L114|default implementation.}
- */
-var appendChild = exports.appendChild = function (parentNode, newNode) {
- parentNode.childNodes.push(newNode);
- newNode.parentNode = parentNode;
-};
-
-/**
- * Inserts a child node to the given parent node before the given reference node.
- *
- * @function insertBefore
- * @memberof TreeAdapter
- *
- * @param {ASTNode} parentNode - Parent node.
- * @param {ASTNode} newNode - Child node.
- * @param {ASTNode} referenceNode - Reference node.
- *
- * @see {@link https://github.com/inikulin/parse5/blob/tree-adapter-docs-rev/lib/tree_adapters/default.js#L131|default implementation.}
- */
-var insertBefore = exports.insertBefore = function (parentNode, newNode, referenceNode) {
- var insertionIdx = parentNode.childNodes.indexOf(referenceNode);
-
- parentNode.childNodes.splice(insertionIdx, 0, newNode);
- newNode.parentNode = parentNode;
-};
-
-/**
- * Sets the `<template>` element content element.
- *
- * @function setTemplateContent
- * @memberof TreeAdapter
- *
- * @param {ASTNode<TemplateElement>} templateElement - `<template>` element.
- * @param {ASTNode<DocumentFragment>} contentTemplate - Content element.
- *
- * @see {@link https://github.com/inikulin/parse5/blob/tree-adapter-docs-rev/lib/tree_adapters/default.js#L149|default implementation.}
- */
-exports.setTemplateContent = function (templateElement, contentElement) {
- templateElement.content = contentElement;
-};
-
-
-/**
- * Returns the `<template>` element content element.
- *
- * @function getTemplateContent
- * @memberof TreeAdapter
- *
- * @param {ASTNode<TemplateElement>} templateElement - `<template>` element.
-
- * @returns {ASTNode<DocumentFragment>}
- *
- * @see {@link https://github.com/inikulin/parse5/blob/tree-adapter-docs-rev/lib/tree_adapters/default.js#L166|default implementation.}
- */
-exports.getTemplateContent = function (templateElement) {
- return templateElement.content;
-};
-
-/**
- * Sets the document type. If the `document` already contains a document type node, the `name`, `publicId` and `systemId`
- * properties of this node will be updated with the provided values. Otherwise, creates a new document type node
- * with the given properties and inserts it into the `document`.
- *
- * @function setDocumentType
- * @memberof TreeAdapter
- *
- * @param {ASTNode<Document>} document - Document node.
- * @param {String} name - Document type name.
- * @param {String} publicId - Document type public identifier.
- * @param {String} systemId - Document type system identifier.
- *
- * @see {@link https://github.com/inikulin/parse5/blob/tree-adapter-docs-rev/lib/tree_adapters/default.js#L185|default implementation.}
- */
-exports.setDocumentType = function (document, name, publicId, systemId) {
- var doctypeNode = null;
-
- for (var i = 0; i < document.childNodes.length; i++) {
- if (document.childNodes[i].nodeName === '#documentType') {
- doctypeNode = document.childNodes[i];
- break;
- }
- }
-
- if (doctypeNode) {
- doctypeNode.name = name;
- doctypeNode.publicId = publicId;
- doctypeNode.systemId = systemId;
- }
-
- else {
- appendChild(document, {
- nodeName: '#documentType',
- name: name,
- publicId: publicId,
- systemId: systemId
- });
- }
-};
-
-/**
- * Sets the document's quirks mode flag.
- *
- * @function setQuirksMode
- * @memberof TreeAdapter
- *
- * @param {ASTNode<Document>} document - Document node.
- *
- * @see {@link https://github.com/inikulin/parse5/blob/tree-adapter-docs-rev/lib/tree_adapters/default.js#L221|default implementation.}
- */
-exports.setQuirksMode = function (document) {
- document.quirksMode = true;
-};
-
-/**
- * Determines if the document's quirks mode flag is set.
- *
- * @function isQuirksMode
- * @memberof TreeAdapter
- *
- * @param {ASTNode<Document>} document - Document node.
-
- * @returns {Boolean}
- *
- * @see {@link https://github.com/inikulin/parse5/blob/tree-adapter-docs-rev/lib/tree_adapters/default.js#L237|default implementation.}
- */
-exports.isQuirksMode = function (document) {
- return document.quirksMode;
-};
-
-/**
- * Removes a node from its parent.
- *
- * @function detachNode
- * @memberof TreeAdapter
- *
- * @param {ASTNode} node - Node.
-
- * @see {@link https://github.com/inikulin/parse5/blob/tree-adapter-docs-rev/lib/tree_adapters/default.js#L251|default implementation.}
- */
-exports.detachNode = function (node) {
- if (node.parentNode) {
- var idx = node.parentNode.childNodes.indexOf(node);
-
- node.parentNode.childNodes.splice(idx, 1);
- node.parentNode = null;
- }
-};
-
-/**
- * Inserts text into a node. If the last child of the node is a text node, the provided text will be appended to the
- * text node content. Otherwise, inserts a new text node with the given text.
- *
- *
- * @function insertText
- * @memberof TreeAdapter
- *
- * @param {ASTNode} parentNode - Node to insert text into.
- * @param {String} text - Text to insert.
-
- * @see {@link https://github.com/inikulin/parse5/blob/tree-adapter-docs-rev/lib/tree_adapters/default.js#L273|default implementation.}
- */
-exports.insertText = function (parentNode, text) {
- if (parentNode.childNodes.length) {
- var prevNode = parentNode.childNodes[parentNode.childNodes.length - 1];
-
- if (prevNode.nodeName === '#text') {
- prevNode.value += text;
- return;
- }
- }
-
- appendChild(parentNode, createTextNode(text));
-};
-
-/**
- * Inserts text into a sibling node that goes before the reference node. If this sibling node is the text node,
- * the provided text will be appended to the text node content. Otherwise, inserts a new sibling text node with
- * the given text before the reference node.
- *
- *
- * @function insertTextBefore
- * @memberof TreeAdapter
- *
- * @param {ASTNode} parentNode - Node to insert text into.
- * @param {String} text - Text to insert.
- * @param {ASTNode} referenceNode - Node to insert text before.
- *
- * @see {@link https://github.com/inikulin/parse5/blob/tree-adapter-docs-rev/lib/tree_adapters/default.js#L301|default implementation.}
- */
-exports.insertTextBefore = function (parentNode, text, referenceNode) {
- var prevNode = parentNode.childNodes[parentNode.childNodes.indexOf(referenceNode) - 1];
-
- if (prevNode && prevNode.nodeName === '#text')
- prevNode.value += text;
- else
- insertBefore(parentNode, createTextNode(text), referenceNode);
-};
-
-/**
- * Copies attributes to the given node. Only attributes that are not yet present in the node are copied.
- *
- * @function adoptAttributes
- * @memberof TreeAdapter
- *
- * @param {ASTNode} recipientNode - Node to copy attributes into.
- * @param {Array} attrs - Attributes to copy.
-
- * @see {@link https://github.com/inikulin/parse5/blob/tree-adapter-docs-rev/lib/tree_adapters/default.js#L321|default implementation.}
- */
-exports.adoptAttributes = function (recipientNode, attrs) {
- var recipientAttrsMap = [];
-
- for (var i = 0; i < recipientNode.attrs.length; i++)
- recipientAttrsMap.push(recipientNode.attrs[i].name);
-
- for (var j = 0; j < attrs.length; j++) {
- if (recipientAttrsMap.indexOf(attrs[j].name) === -1)
- recipientNode.attrs.push(attrs[j]);
- }
-};
-
-
-//Tree traversing
-
-/**
- * Returns the first child of the given node.
- *
- * @function getFirstChild
- * @memberof TreeAdapter
- *
- * @param {ASTNode} node - Node.
- *
- * @returns {ASTNode} firstChild
- *
- * @see {@link https://github.com/inikulin/parse5/blob/tree-adapter-docs-rev/lib/tree_adapters/default.js#L348|default implementation.}
- */
-exports.getFirstChild = function (node) {
- return node.childNodes[0];
-};
-
-/**
- * Returns the given node's children in an array.
- *
- * @function getChildNodes
- * @memberof TreeAdapter
- *
- * @param {ASTNode} node - Node.
- *
- * @returns {Array} children
- *
- * @see {@link https://github.com/inikulin/parse5/blob/tree-adapter-docs-rev/lib/tree_adapters/default.js#L364|default implementation.}
- */
-exports.getChildNodes = function (node) {
- return node.childNodes;
-};
-
-/**
- * Returns the given node's parent.
- *
- * @function getParentNode
- * @memberof TreeAdapter
- *
- * @param {ASTNode} node - Node.
- *
- * @returns {ASTNode} parent
- *
- * @see {@link https://github.com/inikulin/parse5/blob/tree-adapter-docs-rev/lib/tree_adapters/default.js#L380|default implementation.}
- */
-exports.getParentNode = function (node) {
- return node.parentNode;
-};
-
-/**
- * Returns the given node's attributes in an array, in the form of name-value pairs.
- * Foreign attributes may contain `namespace` and `prefix` fields as well.
- *
- * @function getAttrList
- * @memberof TreeAdapter
- *
- * @param {ASTNode} node - Node.
- *
- * @returns {Array} attributes
- *
- * @see {@link https://github.com/inikulin/parse5/blob/tree-adapter-docs-rev/lib/tree_adapters/default.js#L397|default implementation.}
- */
-exports.getAttrList = function (node) {
- return node.attrs;
-};
-
-//Node data
-
-/**
- * Returns the given element's tag name.
- *
- * @function getTagName
- * @memberof TreeAdapter
- *
- * @param {ASTNode<Element>} element - Element.
- *
- * @returns {String} tagName
- *
- * @see {@link https://github.com/inikulin/parse5/blob/tree-adapter-docs-rev/lib/tree_adapters/default.js#L415|default implementation.}
- */
-exports.getTagName = function (element) {
- return element.tagName;
-};
-
-/**
- * Returns the given element's namespace.
- *
- * @function getNamespaceURI
- * @memberof TreeAdapter
- *
- * @param {ASTNode<Element>} element - Element.
- *
- * @returns {String} namespaceURI
- *
- * @see {@link https://github.com/inikulin/parse5/blob/tree-adapter-docs-rev/lib/tree_adapters/default.js#L431|default implementation.}
- */
-exports.getNamespaceURI = function (element) {
- return element.namespaceURI;
-};
-
-/**
- * Returns the given text node's content.
- *
- * @function getTextNodeContent
- * @memberof TreeAdapter
- *
- * @param {ASTNode<Text>} textNode - Text node.
- *
- * @returns {String} text
- *
- * @see {@link https://github.com/inikulin/parse5/blob/tree-adapter-docs-rev/lib/tree_adapters/default.js#L447|default implementation.}
- */
-exports.getTextNodeContent = function (textNode) {
- return textNode.value;
-};
-
-/**
- * Returns the given comment node's content.
- *
- * @function getCommentNodeContent
- * @memberof TreeAdapter
- *
- * @param {ASTNode<Comment>} commentNode - Comment node.
- *
- * @returns {String} commentText
- *
- * @see {@link https://github.com/inikulin/parse5/blob/tree-adapter-docs-rev/lib/tree_adapters/default.js#L463|default implementation.}
- */
-exports.getCommentNodeContent = function (commentNode) {
- return commentNode.data;
-};
-
-/**
- * Returns the given document type node's name.
- *
- * @function getDocumentTypeNodeName
- * @memberof TreeAdapter
- *
- * @param {ASTNode<DocumentType>} doctypeNode - Document type node.
- *
- * @returns {String} name
- *
- * @see {@link https://github.com/inikulin/parse5/blob/tree-adapter-docs-rev/lib/tree_adapters/default.js#L479|default implementation.}
- */
-exports.getDocumentTypeNodeName = function (doctypeNode) {
- return doctypeNode.name;
-};
-
-/**
- * Returns the given document type node's public identifier.
- *
- * @function getDocumentTypeNodePublicId
- * @memberof TreeAdapter
- *
- * @param {ASTNode<DocumentType>} doctypeNode - Document type node.
- *
- * @returns {String} publicId
- *
- * @see {@link https://github.com/inikulin/parse5/blob/tree-adapter-docs-rev/lib/tree_adapters/default.js#L495|default implementation.}
- */
-exports.getDocumentTypeNodePublicId = function (doctypeNode) {
- return doctypeNode.publicId;
-};
-
-/**
- * Returns the given document type node's system identifier.
- *
- * @function getDocumentTypeNodeSystemId
- * @memberof TreeAdapter
- *
- * @param {ASTNode<DocumentType>} doctypeNode - Document type node.
- *
- * @returns {String} systemId
- *
- * @see {@link https://github.com/inikulin/parse5/blob/tree-adapter-docs-rev/lib/tree_adapters/default.js#L511|default implementation.}
- */
-exports.getDocumentTypeNodeSystemId = function (doctypeNode) {
- return doctypeNode.systemId;
-};
-
-//Node types
-/**
- * Determines if the given node is a text node.
- *
- * @function isTextNode
- * @memberof TreeAdapter
- *
- * @param {ASTNode} node - Node.
- *
- * @returns {Boolean}
- *
- * @see {@link https://github.com/inikulin/parse5/blob/tree-adapter-docs-rev/lib/tree_adapters/default.js#L526|default implementation.}
- */
-exports.isTextNode = function (node) {
- return node.nodeName === '#text';
-};
-
-/**
- * Determines if the given node is a comment node.
- *
- * @function isCommentNode
- * @memberof TreeAdapter
- *
- * @param {ASTNode} node - Node.
- *
- * @returns {Boolean}
- *
- * @see {@link https://github.com/inikulin/parse5/blob/tree-adapter-docs-rev/lib/tree_adapters/default.js#L544|default implementation.}
- */
-exports.isCommentNode = function (node) {
- return node.nodeName === '#comment';
-};
-
-/**
- * Determines if the given node is a document type node.
- *
- * @function isDocumentTypeNode
- * @memberof TreeAdapter
- *
- * @param {ASTNode} node - Node.
- *
- * @returns {Boolean}
- *
- * @see {@link https://github.com/inikulin/parse5/blob/tree-adapter-docs-rev/lib/tree_adapters/default.js#L560|default implementation.}
- */
-exports.isDocumentTypeNode = function (node) {
- return node.nodeName === '#documentType';
-};
-
-/**
- * Determines if the given node is an element.
- *
- * @function isElementNode
- * @memberof TreeAdapter
- *
- * @param {ASTNode} node - Node.
- *
- * @returns {Boolean}
- *
- * @see {@link https://github.com/inikulin/parse5/blob/tree-adapter-docs-rev/lib/tree_adapters/default.js#L576|default implementation.}
- */
-exports.isElementNode = function (node) {
- return !!node.tagName;
-};
diff --git a/tools/eslint/node_modules/parse5/lib/tree_adapters/htmlparser2.js b/tools/eslint/node_modules/parse5/lib/tree_adapters/htmlparser2.js
deleted file mode 100644
index 2241314419..0000000000
--- a/tools/eslint/node_modules/parse5/lib/tree_adapters/htmlparser2.js
+++ /dev/null
@@ -1,327 +0,0 @@
-'use strict';
-
-var doctype = require('../common/doctype');
-
-//Conversion tables for DOM Level1 structure emulation
-var nodeTypes = {
- element: 1,
- text: 3,
- cdata: 4,
- comment: 8
-};
-
-var nodePropertyShorthands = {
- tagName: 'name',
- childNodes: 'children',
- parentNode: 'parent',
- previousSibling: 'prev',
- nextSibling: 'next',
- nodeValue: 'data'
-};
-
-//Node
-var Node = function (props) {
- for (var key in props) {
- if (props.hasOwnProperty(key))
- this[key] = props[key];
- }
-};
-
-Node.prototype = {
- get firstChild() {
- var children = this.children;
-
- return children && children[0] || null;
- },
-
- get lastChild() {
- var children = this.children;
-
- return children && children[children.length - 1] || null;
- },
-
- get nodeType() {
- return nodeTypes[this.type] || nodeTypes.element;
- }
-};
-
-Object.keys(nodePropertyShorthands).forEach(function (key) {
- var shorthand = nodePropertyShorthands[key];
-
- Object.defineProperty(Node.prototype, key, {
- get: function () {
- return this[shorthand] || null;
- },
- set: function (val) {
- this[shorthand] = val;
- return val;
- }
- });
-});
-
-
-//Node construction
-exports.createDocument =
- exports.createDocumentFragment = function () {
- return new Node({
- type: 'root',
- name: 'root',
- parent: null,
- prev: null,
- next: null,
- children: []
- });
- };
-
-exports.createElement = function (tagName, namespaceURI, attrs) {
- var attribs = {},
- attribsNamespace = {},
- attribsPrefix = {};
-
- for (var i = 0; i < attrs.length; i++) {
- var attrName = attrs[i].name;
-
- attribs[attrName] = attrs[i].value;
- attribsNamespace[attrName] = attrs[i].namespace;
- attribsPrefix[attrName] = attrs[i].prefix;
- }
-
- return new Node({
- type: tagName === 'script' || tagName === 'style' ? tagName : 'tag',
- name: tagName,
- namespace: namespaceURI,
- attribs: attribs,
- 'x-attribsNamespace': attribsNamespace,
- 'x-attribsPrefix': attribsPrefix,
- children: [],
- parent: null,
- prev: null,
- next: null
- });
-};
-
-exports.createCommentNode = function (data) {
- return new Node({
- type: 'comment',
- data: data,
- parent: null,
- prev: null,
- next: null
- });
-};
-
-var createTextNode = function (value) {
- return new Node({
- type: 'text',
- data: value,
- parent: null,
- prev: null,
- next: null
- });
-};
-
-
-//Tree mutation
-var appendChild = exports.appendChild = function (parentNode, newNode) {
- var prev = parentNode.children[parentNode.children.length - 1];
-
- if (prev) {
- prev.next = newNode;
- newNode.prev = prev;
- }
-
- parentNode.children.push(newNode);
- newNode.parent = parentNode;
-};
-
-var insertBefore = exports.insertBefore = function (parentNode, newNode, referenceNode) {
- var insertionIdx = parentNode.children.indexOf(referenceNode),
- prev = referenceNode.prev;
-
- if (prev) {
- prev.next = newNode;
- newNode.prev = prev;
- }
-
- referenceNode.prev = newNode;
- newNode.next = referenceNode;
-
- parentNode.children.splice(insertionIdx, 0, newNode);
- newNode.parent = parentNode;
-};
-
-exports.setTemplateContent = function (templateElement, contentElement) {
- appendChild(templateElement, contentElement);
-};
-
-exports.getTemplateContent = function (templateElement) {
- return templateElement.children[0];
-};
-
-exports.setDocumentType = function (document, name, publicId, systemId) {
- var data = doctype.serializeContent(name, publicId, systemId),
- doctypeNode = null;
-
- for (var i = 0; i < document.children.length; i++) {
- if (document.children[i].type === 'directive' && document.children[i].name === '!doctype') {
- doctypeNode = document.children[i];
- break;
- }
- }
-
- if (doctypeNode) {
- doctypeNode.data = data;
- doctypeNode['x-name'] = name;
- doctypeNode['x-publicId'] = publicId;
- doctypeNode['x-systemId'] = systemId;
- }
-
- else {
- appendChild(document, new Node({
- type: 'directive',
- name: '!doctype',
- data: data,
- 'x-name': name,
- 'x-publicId': publicId,
- 'x-systemId': systemId
- }));
- }
-
-};
-
-exports.setQuirksMode = function (document) {
- document.quirksMode = true;
-};
-
-exports.isQuirksMode = function (document) {
- return document.quirksMode;
-};
-
-exports.detachNode = function (node) {
- if (node.parent) {
- var idx = node.parent.children.indexOf(node),
- prev = node.prev,
- next = node.next;
-
- node.prev = null;
- node.next = null;
-
- if (prev)
- prev.next = next;
-
- if (next)
- next.prev = prev;
-
- node.parent.children.splice(idx, 1);
- node.parent = null;
- }
-};
-
-exports.insertText = function (parentNode, text) {
- var lastChild = parentNode.children[parentNode.children.length - 1];
-
- if (lastChild && lastChild.type === 'text')
- lastChild.data += text;
- else
- appendChild(parentNode, createTextNode(text));
-};
-
-exports.insertTextBefore = function (parentNode, text, referenceNode) {
- var prevNode = parentNode.children[parentNode.children.indexOf(referenceNode) - 1];
-
- if (prevNode && prevNode.type === 'text')
- prevNode.data += text;
- else
- insertBefore(parentNode, createTextNode(text), referenceNode);
-};
-
-exports.adoptAttributes = function (recipientNode, attrs) {
- for (var i = 0; i < attrs.length; i++) {
- var attrName = attrs[i].name;
-
- if (typeof recipientNode.attribs[attrName] === 'undefined') {
- recipientNode.attribs[attrName] = attrs[i].value;
- recipientNode['x-attribsNamespace'][attrName] = attrs[i].namespace;
- recipientNode['x-attribsPrefix'][attrName] = attrs[i].prefix;
- }
- }
-};
-
-
-//Tree traversing
-exports.getFirstChild = function (node) {
- return node.children[0];
-};
-
-exports.getChildNodes = function (node) {
- return node.children;
-};
-
-exports.getParentNode = function (node) {
- return node.parent;
-};
-
-exports.getAttrList = function (node) {
- var attrList = [];
-
- for (var name in node.attribs) {
- if (node.attribs.hasOwnProperty(name)) {
- attrList.push({
- name: name,
- value: node.attribs[name],
- namespace: node['x-attribsNamespace'][name],
- prefix: node['x-attribsPrefix'][name]
- });
- }
- }
-
- return attrList;
-};
-
-
-//Node data
-exports.getTagName = function (element) {
- return element.name;
-};
-
-exports.getNamespaceURI = function (element) {
- return element.namespace;
-};
-
-exports.getTextNodeContent = function (textNode) {
- return textNode.data;
-};
-
-exports.getCommentNodeContent = function (commentNode) {
- return commentNode.data;
-};
-
-exports.getDocumentTypeNodeName = function (doctypeNode) {
- return doctypeNode['x-name'];
-};
-
-exports.getDocumentTypeNodePublicId = function (doctypeNode) {
- return doctypeNode['x-publicId'];
-};
-
-exports.getDocumentTypeNodeSystemId = function (doctypeNode) {
- return doctypeNode['x-systemId'];
-};
-
-
-//Node types
-exports.isTextNode = function (node) {
- return node.type === 'text';
-};
-
-exports.isCommentNode = function (node) {
- return node.type === 'comment';
-};
-
-exports.isDocumentTypeNode = function (node) {
- return node.type === 'directive' && node.name === '!doctype';
-};
-
-exports.isElementNode = function (node) {
- return !!node.attribs;
-};
diff --git a/tools/eslint/node_modules/parse5/package.json b/tools/eslint/node_modules/parse5/package.json
deleted file mode 100644
index b3929ca6d5..0000000000
--- a/tools/eslint/node_modules/parse5/package.json
+++ /dev/null
@@ -1,113 +0,0 @@
-{
- "_from": "parse5@^2.2.2",
- "_id": "parse5@2.2.3",
- "_inBundle": false,
- "_integrity": "sha1-DE/EHBAAxea5PUiwP4CDg3g06fY=",
- "_location": "/parse5",
- "_phantomChildren": {},
- "_requested": {
- "type": "range",
- "registry": true,
- "raw": "parse5@^2.2.2",
- "name": "parse5",
- "escapedName": "parse5",
- "rawSpec": "^2.2.2",
- "saveSpec": null,
- "fetchSpec": "^2.2.2"
- },
- "_requiredBy": [
- "/eslint-plugin-markdown"
- ],
- "_resolved": "https://registry.npmjs.org/parse5/-/parse5-2.2.3.tgz",
- "_shasum": "0c4fc41c1000c5e6b93d48b03f8083837834e9f6",
- "_spec": "parse5@^2.2.2",
- "_where": "/Users/trott/io.js/tools/eslint-tmp/node_modules/eslint/node_modules/eslint-plugin-markdown",
- "author": {
- "name": "Ivan Nikulin",
- "email": "ifaaan@gmail.com",
- "url": "https://github.com/inikulin"
- },
- "bugs": {
- "url": "https://github.com/inikulin/parse5/issues"
- },
- "bundleDependencies": false,
- "contributors": [
- {
- "name": "Alan Clarke",
- "url": "https://github.com/alanclarke"
- },
- {
- "name": "Evan You",
- "url": "http://evanyou.me"
- },
- {
- "name": "Saksham Aggarwal",
- "email": "s.agg2021@gmail.com"
- },
- {
- "name": "Sebastian Mayr",
- "email": "sebmaster16@gmail.com",
- "url": "http://blog.smayr.name"
- },
- {
- "name": "Sean Lang",
- "email": "slang800@gmail.com",
- "url": "http://slang.cx"
- }
- ],
- "deprecated": false,
- "description": "WHATWG HTML5 specification-compliant, fast and ready for production HTML parsing/serialization toolset for Node.js",
- "devDependencies": {
- "del": "^2.0.2",
- "gulp": "^3.9.0",
- "gulp-benchmark": "^1.1.1",
- "gulp-concat": "^2.6.0",
- "gulp-download": "0.0.1",
- "gulp-eslint": "^3.0.1",
- "gulp-insert": "^0.5.0",
- "gulp-install": "^0.6.0",
- "gulp-jsdoc-to-markdown": "^1.1.1",
- "gulp-mocha": "^2.1.3",
- "gulp-rename": "^1.2.2",
- "publish-please": "^2.2.0",
- "through2": "^2.0.0"
- },
- "files": [
- "lib"
- ],
- "homepage": "https://github.com/inikulin/parse5",
- "keywords": [
- "html",
- "parser",
- "html5",
- "WHATWG",
- "specification",
- "fast",
- "html parser",
- "html5 parser",
- "htmlparser",
- "parse5",
- "serializer",
- "html serializer",
- "htmlserializer",
- "sax",
- "simple api",
- "parse",
- "tokenize",
- "serialize",
- "tokenizer"
- ],
- "license": "MIT",
- "main": "./lib/index.js",
- "name": "parse5",
- "repository": {
- "type": "git",
- "url": "git://github.com/inikulin/parse5.git"
- },
- "scripts": {
- "prepublish": "publish-please guard",
- "publish-please": "publish-please",
- "test": "gulp test"
- },
- "version": "2.2.3"
-}
diff --git a/tools/eslint/node_modules/remark-parse/index.js b/tools/eslint/node_modules/remark-parse/index.js
index a7590bad77..1579e35518 100644
--- a/tools/eslint/node_modules/remark-parse/index.js
+++ b/tools/eslint/node_modules/remark-parse/index.js
@@ -1,30 +1,14 @@
-/**
- * @author Titus Wormer
- * @copyright 2015-2016 Titus Wormer
- * @license MIT
- * @module remark:parse
- * @fileoverview Markdown parser.
- */
-
'use strict';
-/* eslint-env commonjs */
-
-/* Dependencies. */
var unherit = require('unherit');
+var xtend = require('xtend');
var Parser = require('./lib/parser.js');
-/**
- * Attacher.
- *
- * @param {unified} processor - Unified processor.
- */
-function parse(processor) {
- processor.Parser = unherit(Parser);
-}
-
-/* Patch `Parser`. */
+module.exports = parse;
parse.Parser = Parser;
-/* Expose */
-module.exports = parse;
+function parse(options) {
+ var Local = unherit(Parser);
+ Local.prototype.options = xtend(Local.prototype.options, this.data('settings'), options);
+ this.Parser = Local;
+}
diff --git a/tools/eslint/node_modules/remark-parse/lib/block-elements.json b/tools/eslint/node_modules/remark-parse/lib/block-elements.json
index af5e657cbe..2d13b56179 100644
--- a/tools/eslint/node_modules/remark-parse/lib/block-elements.json
+++ b/tools/eslint/node_modules/remark-parse/lib/block-elements.json
@@ -1,52 +1,68 @@
[
- "article",
- "header",
- "aside",
- "hgroup",
- "blockquote",
- "hr",
- "iframe",
- "body",
- "li",
- "map",
- "button",
- "object",
- "canvas",
- "ol",
- "caption",
- "output",
- "col",
- "p",
- "colgroup",
- "pre",
- "dd",
- "progress",
- "div",
- "section",
- "dl",
- "table",
- "td",
- "dt",
- "tbody",
- "embed",
- "textarea",
- "fieldset",
- "tfoot",
- "figcaption",
- "th",
- "figure",
- "thead",
- "footer",
- "tr",
- "form",
- "ul",
- "h1",
- "h2",
- "h3",
- "h4",
- "h5",
- "h6",
- "video",
- "script",
- "style"
+ "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",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "h6",
+ "head",
+ "header",
+ "hgroup",
+ "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"
]
diff --git a/tools/eslint/node_modules/remark-parse/lib/decode.js b/tools/eslint/node_modules/remark-parse/lib/decode.js
new file mode 100644
index 0000000000..75116385ee
--- /dev/null
+++ b/tools/eslint/node_modules/remark-parse/lib/decode.js
@@ -0,0 +1,71 @@
+/**
+ * @author Titus Wormer
+ * @copyright 2015 Titus Wormer
+ * @license MIT
+ * @module remark:parse:decode
+ * @fileoverview Decode entities.
+ */
+
+'use strict';
+
+var entities = require('parse-entities');
+
+module.exports = factory;
+
+/* Factory to create an entity decoder. */
+function factory(ctx) {
+ decoder.raw = decodeRaw;
+
+ return decoder;
+
+ /* Normalize `position` to add an `indent`. */
+ function normalize(position) {
+ var offsets = ctx.offset;
+ var line = position.line;
+ var result = [];
+
+ while (++line) {
+ if (!(line in offsets)) {
+ break;
+ }
+
+ result.push((offsets[line] || 0) + 1);
+ }
+
+ return {
+ start: position,
+ indent: result
+ };
+ }
+
+ /* Handle a warning.
+ * See https://github.com/wooorm/parse-entities
+ * for the warnings. */
+ function handleWarning(reason, position, code) {
+ if (code === 3) {
+ return;
+ }
+
+ ctx.file.message(reason, position);
+ }
+
+ /* Decode `value` (at `position`) into text-nodes. */
+ function decoder(value, position, handler) {
+ entities(value, {
+ position: normalize(position),
+ warning: handleWarning,
+ text: handler,
+ reference: handler,
+ textContext: ctx,
+ referenceContext: ctx
+ });
+ }
+
+ /* Decode `value` (at `position`) into a string. */
+ function decodeRaw(value, position) {
+ return entities(value, {
+ position: normalize(position),
+ warning: handleWarning
+ });
+ }
+}
diff --git a/tools/eslint/node_modules/remark-parse/lib/defaults.js b/tools/eslint/node_modules/remark-parse/lib/defaults.js
index 79f26f2a34..ccb3fabd48 100644
--- a/tools/eslint/node_modules/remark-parse/lib/defaults.js
+++ b/tools/eslint/node_modules/remark-parse/lib/defaults.js
@@ -1,6 +1,6 @@
/**
* @author Titus Wormer
- * @copyright 2015-2016 Titus Wormer
+ * @copyright 2015 Titus Wormer
* @license MIT
* @module remark:parse:defaults
* @fileoverview Default options for `parse`.
@@ -8,14 +8,14 @@
'use strict';
-/* eslint-env commonjs */
-
+/* Expose. */
module.exports = {
- 'position': true,
- 'gfm': true,
- 'yaml': true,
- 'commonmark': false,
- 'footnotes': false,
- 'pedantic': false,
- 'breaks': false
+ position: true,
+ gfm: true,
+ yaml: true,
+ commonmark: false,
+ footnotes: false,
+ pedantic: false,
+ blocks: require('./block-elements'),
+ breaks: false
};
diff --git a/tools/eslint/node_modules/remark-parse/lib/escapes.json b/tools/eslint/node_modules/remark-parse/lib/escapes.json
deleted file mode 100644
index f74e70cfda..0000000000
--- a/tools/eslint/node_modules/remark-parse/lib/escapes.json
+++ /dev/null
@@ -1,75 +0,0 @@
-{
- "default": [
- "\\",
- "`",
- "*",
- "{",
- "}",
- "[",
- "]",
- "(",
- ")",
- "#",
- "+",
- "-",
- ".",
- "!",
- "_",
- ">"
- ],
- "gfm": [
- "\\",
- "`",
- "*",
- "{",
- "}",
- "[",
- "]",
- "(",
- ")",
- "#",
- "+",
- "-",
- ".",
- "!",
- "_",
- ">",
- "~",
- "|"
- ],
- "commonmark": [
- "\\",
- "`",
- "*",
- "{",
- "}",
- "[",
- "]",
- "(",
- ")",
- "#",
- "+",
- "-",
- ".",
- "!",
- "_",
- ">",
- "~",
- "|",
- "\n",
- "\"",
- "$",
- "%",
- "&",
- "'",
- ",",
- "/",
- ":",
- ";",
- "<",
- "=",
- "?",
- "@",
- "^"
- ]
-}
diff --git a/tools/eslint/node_modules/remark-parse/lib/locate/break.js b/tools/eslint/node_modules/remark-parse/lib/locate/break.js
new file mode 100644
index 0000000000..b5550e1007
--- /dev/null
+++ b/tools/eslint/node_modules/remark-parse/lib/locate/break.js
@@ -0,0 +1,25 @@
+/**
+ * @author Titus Wormer
+ * @copyright 2015 Titus Wormer
+ * @license MIT
+ * @module remark:parse:locate:break
+ * @fileoverview Locate a break.
+ */
+
+'use strict';
+
+module.exports = locate;
+
+function locate(value, fromIndex) {
+ var index = value.indexOf('\n', fromIndex);
+
+ while (index > fromIndex) {
+ if (value.charAt(index - 1) !== ' ') {
+ break;
+ }
+
+ index--;
+ }
+
+ return index;
+}
diff --git a/tools/eslint/node_modules/remark-parse/lib/locate/code-inline.js b/tools/eslint/node_modules/remark-parse/lib/locate/code-inline.js
new file mode 100644
index 0000000000..010e74dcec
--- /dev/null
+++ b/tools/eslint/node_modules/remark-parse/lib/locate/code-inline.js
@@ -0,0 +1,15 @@
+/**
+ * @author Titus Wormer
+ * @copyright 2015 Titus Wormer
+ * @license MIT
+ * @module remark:parse:locate:code-inline
+ * @fileoverview Locate inline code.
+ */
+
+'use strict';
+
+module.exports = locate;
+
+function locate(value, fromIndex) {
+ return value.indexOf('`', fromIndex);
+}
diff --git a/tools/eslint/node_modules/remark-parse/lib/locate/delete.js b/tools/eslint/node_modules/remark-parse/lib/locate/delete.js
new file mode 100644
index 0000000000..1a892e1be7
--- /dev/null
+++ b/tools/eslint/node_modules/remark-parse/lib/locate/delete.js
@@ -0,0 +1,15 @@
+/**
+ * @author Titus Wormer
+ * @copyright 2015 Titus Wormer
+ * @license MIT
+ * @module remark:parse:locate:delete
+ * @fileoverview Locate strikethrough.
+ */
+
+'use strict';
+
+module.exports = locate;
+
+function locate(value, fromIndex) {
+ return value.indexOf('~~', fromIndex);
+}
diff --git a/tools/eslint/node_modules/remark-parse/lib/locate/emphasis.js b/tools/eslint/node_modules/remark-parse/lib/locate/emphasis.js
new file mode 100644
index 0000000000..270daad0f9
--- /dev/null
+++ b/tools/eslint/node_modules/remark-parse/lib/locate/emphasis.js
@@ -0,0 +1,26 @@
+/**
+ * @author Titus Wormer
+ * @copyright 2015 Titus Wormer
+ * @license MIT
+ * @module remark:parse:locate:emphasis
+ * @fileoverview Locate italics / emphasis.
+ */
+
+'use strict';
+
+module.exports = locate;
+
+function locate(value, fromIndex) {
+ var asterisk = value.indexOf('*', fromIndex);
+ var underscore = value.indexOf('_', fromIndex);
+
+ if (underscore === -1) {
+ return asterisk;
+ }
+
+ if (asterisk === -1) {
+ return underscore;
+ }
+
+ return underscore < asterisk ? underscore : asterisk;
+}
diff --git a/tools/eslint/node_modules/remark-parse/lib/locate/escape.js b/tools/eslint/node_modules/remark-parse/lib/locate/escape.js
new file mode 100644
index 0000000000..45f9b449a7
--- /dev/null
+++ b/tools/eslint/node_modules/remark-parse/lib/locate/escape.js
@@ -0,0 +1,15 @@
+/**
+ * @author Titus Wormer
+ * @copyright 2015 Titus Wormer
+ * @license MIT
+ * @module remark:parse:locate:escape
+ * @fileoverview Locate an escape.
+ */
+
+'use strict';
+
+module.exports = locate;
+
+function locate(value, fromIndex) {
+ return value.indexOf('\\', fromIndex);
+}
diff --git a/tools/eslint/node_modules/remark-parse/lib/locate/link.js b/tools/eslint/node_modules/remark-parse/lib/locate/link.js
new file mode 100644
index 0000000000..dab2a3c54f
--- /dev/null
+++ b/tools/eslint/node_modules/remark-parse/lib/locate/link.js
@@ -0,0 +1,24 @@
+/**
+ * @author Titus Wormer
+ * @copyright 2015 Titus Wormer
+ * @license MIT
+ * @module remark:parse:locate:link
+ * @fileoverview Locate a link.
+ */
+
+'use strict';
+
+module.exports = locate;
+
+function locate(value, fromIndex) {
+ var link = value.indexOf('[', fromIndex);
+ var image = value.indexOf('![', fromIndex);
+
+ if (image === -1) {
+ return link;
+ }
+
+ /* Link can never be `-1` if an image is found, so we don’t need
+ * to check for that :) */
+ return link < image ? link : image;
+}
diff --git a/tools/eslint/node_modules/remark-parse/lib/locate/strong.js b/tools/eslint/node_modules/remark-parse/lib/locate/strong.js
new file mode 100644
index 0000000000..717259f36e
--- /dev/null
+++ b/tools/eslint/node_modules/remark-parse/lib/locate/strong.js
@@ -0,0 +1,26 @@
+/**
+ * @author Titus Wormer
+ * @copyright 2015 Titus Wormer
+ * @license MIT
+ * @module remark:parse:locate:strong
+ * @fileoverview Locate bold / strong / importance.
+ */
+
+'use strict';
+
+module.exports = locate;
+
+function locate(value, fromIndex) {
+ var asterisk = value.indexOf('**', fromIndex);
+ var underscore = value.indexOf('__', fromIndex);
+
+ if (underscore === -1) {
+ return asterisk;
+ }
+
+ if (asterisk === -1) {
+ return underscore;
+ }
+
+ return underscore < asterisk ? underscore : asterisk;
+}
diff --git a/tools/eslint/node_modules/remark-parse/lib/locate/tag.js b/tools/eslint/node_modules/remark-parse/lib/locate/tag.js
new file mode 100644
index 0000000000..56e2d49e56
--- /dev/null
+++ b/tools/eslint/node_modules/remark-parse/lib/locate/tag.js
@@ -0,0 +1,15 @@
+/**
+ * @author Titus Wormer
+ * @copyright 2015 Titus Wormer
+ * @license MIT
+ * @module remark:parse:locate:tag
+ * @fileoverview Locate a tag.
+ */
+
+'use strict';
+
+module.exports = locate;
+
+function locate(value, fromIndex) {
+ return value.indexOf('<', fromIndex);
+}
diff --git a/tools/eslint/node_modules/remark-parse/lib/locate/url.js b/tools/eslint/node_modules/remark-parse/lib/locate/url.js
new file mode 100644
index 0000000000..53b239241c
--- /dev/null
+++ b/tools/eslint/node_modules/remark-parse/lib/locate/url.js
@@ -0,0 +1,34 @@
+/**
+ * @author Titus Wormer
+ * @copyright 2015 Titus Wormer
+ * @license MIT
+ * @module remark:parse:locate:url
+ * @fileoverview Locate a URL.
+ */
+
+'use strict';
+
+module.exports = locate;
+
+var PROTOCOLS = ['https://', 'http://', 'mailto:'];
+
+function locate(value, fromIndex) {
+ var length = PROTOCOLS.length;
+ var index = -1;
+ var min = -1;
+ var position;
+
+ if (!this.options.gfm) {
+ return -1;
+ }
+
+ while (++index < length) {
+ position = value.indexOf(PROTOCOLS[index], fromIndex);
+
+ if (position !== -1 && (position < min || min === -1)) {
+ min = position;
+ }
+ }
+
+ return min;
+}
diff --git a/tools/eslint/node_modules/remark-parse/lib/parse.js b/tools/eslint/node_modules/remark-parse/lib/parse.js
new file mode 100644
index 0000000000..53a50b181e
--- /dev/null
+++ b/tools/eslint/node_modules/remark-parse/lib/parse.js
@@ -0,0 +1,53 @@
+/**
+ * @author Titus Wormer
+ * @copyright 2015 Titus Wormer
+ * @license MIT
+ * @module remark:parse:parse
+ * @fileoverview Parse the document
+ */
+
+'use strict';
+
+var xtend = require('xtend');
+var removePosition = require('unist-util-remove-position');
+
+module.exports = parse;
+
+var C_NEWLINE = '\n';
+var EXPRESSION_LINE_BREAKS = /\r\n|\r/g;
+
+/* Parse the bound file. */
+function parse() {
+ var self = this;
+ var value = String(self.file);
+ var start = {line: 1, column: 1, offset: 0};
+ var content = xtend(start);
+ var node;
+
+ /* Clean non-unix newlines: `\r\n` and `\r` are all
+ * changed to `\n`. This should not affect positional
+ * information. */
+ value = value.replace(EXPRESSION_LINE_BREAKS, C_NEWLINE);
+
+ if (value.charCodeAt(0) === 0xFEFF) {
+ value = value.slice(1);
+
+ content.column++;
+ content.offset++;
+ }
+
+ node = {
+ type: 'root',
+ children: self.tokenizeBlock(value, content),
+ position: {
+ start: start,
+ end: self.eof || xtend(start)
+ }
+ };
+
+ if (!self.options.position) {
+ removePosition(node, true);
+ }
+
+ return node;
+}
diff --git a/tools/eslint/node_modules/remark-parse/lib/parser.js b/tools/eslint/node_modules/remark-parse/lib/parser.js
index f55f41c95e..8fe982b661 100644
--- a/tools/eslint/node_modules/remark-parse/lib/parser.js
+++ b/tools/eslint/node_modules/remark-parse/lib/parser.js
@@ -1,6318 +1,162 @@
/**
* @author Titus Wormer
- * @copyright 2015-2016 Titus Wormer
+ * @copyright 2015 Titus Wormer
* @license MIT
- * @module remark:parser
+ * @module remark:parse
* @fileoverview Markdown parser.
*/
'use strict';
-/* eslint-env commonjs */
-
-/*
- * Dependencies.
- */
-
-var decode = require('parse-entities');
-var repeat = require('repeat-string');
-var trim = require('trim');
-var trimTrailingLines = require('trim-trailing-lines');
-var extend = require('extend');
+var xtend = require('xtend');
+var toggle = require('state-toggle');
var vfileLocation = require('vfile-location');
-var removePosition = require('unist-util-remove-position');
-var collapseWhiteSpace = require('collapse-white-space');
-var defaultOptions = require('./defaults.js');
-var escapes = require('./escapes.json');
-var blockElements = require('./block-elements.json');
-
-/*
- * Methods.
- */
-
-var has = {}.hasOwnProperty;
-
-/*
- * Numeric constants.
- */
-
-var SPACE_SIZE = 1;
-var TAB_SIZE = 4;
-var CODE_INDENT_LENGTH = 4;
-var MIN_FENCE_COUNT = 3;
-var MAX_ATX_COUNT = 6;
-var MAX_LINE_HEADING_INDENT = 3;
-var THEMATIC_BREAK_MARKER_COUNT = 3;
-var MIN_CLOSING_HTML_NEWLINE_COUNT = 2;
-var MIN_BREAK_LENGTH = 2;
-var MIN_TABLE_COLUMNS = 2;
-var MIN_TABLE_ROWS = 2;
-
-/*
- * Error messages.
- */
-
-var ERR_INFINITE_LOOP = 'Infinite loop';
-var ERR_MISSING_LOCATOR = 'Missing locator: ';
-var ERR_INCORRECTLY_EATEN = 'Incorrectly eaten value: please report this ' +
- 'warning on http://git.io/vg5Ft';
+var unescape = require('./unescape');
+var decode = require('./decode');
+var tokenizer = require('./tokenizer');
-/*
- * Expressions.
- */
-
-var EXPRESSION_BULLET = /^([ \t]*)([*+-]|\d+[.)])( {1,4}(?! )| |\t|$|(?=\n))([^\n]*)/;
-var EXPRESSION_PEDANTIC_BULLET = /^([ \t]*)([*+-]|\d+[.)])([ \t]+)/;
-var EXPRESSION_INITIAL_INDENT = /^( {1,4}|\t)?/gm;
-var EXPRESSION_INITIAL_TAB = /^( {4}|\t)?/gm;
-var EXPRESSION_HTML_LINK_OPEN = /^<a /i;
-var EXPRESSION_HTML_LINK_CLOSE = /^<\/a>/i;
-var EXPRESSION_LOOSE_LIST_ITEM = /\n\n(?!\s*$)/;
-var EXPRESSION_TASK_ITEM = /^\[([\ \t]|x|X)\][\ \t]/;
-var EXPRESSION_LINE_BREAKS = /\r\n|\r/g;
-
-/*
- * Characters.
- */
-
-var C_BACKSLASH = '\\';
-var C_UNDERSCORE = '_';
-var C_ASTERISK = '*';
-var C_TICK = '`';
-var C_AT_SIGN = '@';
-var C_HASH = '#';
-var C_PLUS = '+';
-var C_DASH = '-';
-var C_DOT = '.';
-var C_PIPE = '|';
-var C_DOUBLE_QUOTE = '"';
-var C_SINGLE_QUOTE = '\'';
-var C_COMMA = ',';
-var C_SLASH = '/';
-var C_COLON = ':';
-var C_SEMI_COLON = ';';
-var C_QUESTION_MARK = '?';
-var C_CARET = '^';
-var C_EQUALS = '=';
-var C_EXCLAMATION_MARK = '!';
-var C_TILDE = '~';
-var C_LT = '<';
-var C_GT = '>';
-var C_BRACKET_OPEN = '[';
-var C_BRACKET_CLOSE = ']';
-var C_PAREN_OPEN = '(';
-var C_PAREN_CLOSE = ')';
-var C_SPACE = ' ';
-var C_FORM_FEED = '\f';
-var C_NEWLINE = '\n';
-var C_CARRIAGE_RETURN = '\r';
-var C_TAB = '\t';
-var C_VERTICAL_TAB = '\v';
-var C_NO_BREAK_SPACE = '\u00a0';
-var C_OGHAM_SPACE = '\u1680';
-var C_MONGOLIAN_VOWEL_SEPARATOR = '\u180e';
-var C_EN_QUAD = '\u2000';
-var C_EM_QUAD = '\u2001';
-var C_EN_SPACE = '\u2002';
-var C_EM_SPACE = '\u2003';
-var C_THREE_PER_EM_SPACE = '\u2004';
-var C_FOUR_PER_EM_SPACE = '\u2005';
-var C_SIX_PER_EM_SPACE = '\u2006';
-var C_FIGURE_SPACE = '\u2007';
-var C_PUNCTUATION_SPACE = '\u2008';
-var C_THIN_SPACE = '\u2009';
-var C_HAIR_SPACE = '\u200a';
-var C_LINE_SEPARATOR = '​\u2028';
-var C_PARAGRAPH_SEPARATOR = '​\u2029';
-var C_NARROW_NO_BREAK_SPACE = '\u202f';
-var C_IDEOGRAPHIC_SPACE = '\u3000';
-var C_ZERO_WIDTH_NO_BREAK_SPACE = '\ufeff';
-var C_X_LOWER = 'x';
-
-/*
- * Character codes.
- */
-
-var CC_A_LOWER = 'a'.charCodeAt(0);
-var CC_A_UPPER = 'A'.charCodeAt(0);
-var CC_Z_LOWER = 'z'.charCodeAt(0);
-var CC_Z_UPPER = 'Z'.charCodeAt(0);
-var CC_0 = '0'.charCodeAt(0);
-var CC_9 = '9'.charCodeAt(0);
-
-/*
- * Protocols.
- */
-
-var HTTP_PROTOCOL = 'http://';
-var HTTPS_PROTOCOL = 'https://';
-var MAILTO_PROTOCOL = 'mailto:';
+module.exports = Parser;
-var PROTOCOLS = [
- HTTP_PROTOCOL,
- HTTPS_PROTOCOL,
- MAILTO_PROTOCOL
+/* Construct a new parser. */
+function Parser(doc, file) {
+ this.file = file;
+ this.offset = {};
+ this.options = xtend(this.options);
+ this.setOptions({});
+
+ this.inList = false;
+ this.inBlock = false;
+ this.inLink = false;
+ this.atStart = true;
+
+ this.toOffset = vfileLocation(file).toOffset;
+ this.unescape = unescape(this, 'escape');
+ this.decode = decode(this);
+}
+
+/* Prototype. */
+var proto = Parser.prototype;
+
+/* Expose core. */
+proto.setOptions = require('./set-options');
+proto.parse = require('./parse');
+
+/* Expose `defaults`. */
+proto.options = require('./defaults');
+
+/* Enter and exit helpers. */
+proto.exitStart = toggle('atStart', true);
+proto.enterList = toggle('inList', false);
+proto.enterLink = toggle('inLink', false);
+proto.enterBlock = toggle('inBlock', false);
+
+/* Nodes that can interupt a paragraph:
+ *
+ * ```markdown
+ * A paragraph, followed by a thematic break.
+ * ___
+ * ```
+ *
+ * In the above example, the thematic break “interupts”
+ * the paragraph. */
+proto.interruptParagraph = [
+ ['thematicBreak'],
+ ['atxHeading'],
+ ['fencedCode'],
+ ['blockquote'],
+ ['html'],
+ ['setextHeading', {commonmark: false}],
+ ['definition', {commonmark: false}],
+ ['footnote', {commonmark: false}]
];
-var PROTOCOLS_LENGTH = PROTOCOLS.length;
-
-/*
- * Textual constants.
- */
-
-var YAML_FENCE = repeat(C_DASH, 3);
-var CODE_INDENT = repeat(C_SPACE, CODE_INDENT_LENGTH);
-var EMPTY = '';
-var BLOCK = 'block';
-var INLINE = 'inline';
-var COMMENT_START = '<!--';
-var COMMENT_END = '-->';
-var CDATA_START = '<![CDATA[';
-var CDATA_END = ']]>';
-var COMMENT_END_CHAR = COMMENT_END.charAt(0);
-var CDATA_END_CHAR = CDATA_END.charAt(0);
-var COMMENT_START_LENGTH = COMMENT_START.length;
-var COMMENT_END_LENGTH = COMMENT_END.length;
-var CDATA_START_LENGTH = CDATA_START.length;
-var CDATA_END_LENGTH = CDATA_END.length;
-
-/*
- * Node types.
- */
-
-var T_THEMATIC_BREAK = 'thematicBreak';
-var T_HTML = 'html';
-var T_YAML = 'yaml';
-var T_TABLE = 'table';
-var T_TABLE_CELL = 'tableCell';
-var T_TABLE_HEADER = 'tableRow';
-var T_TABLE_ROW = 'tableRow';
-var T_PARAGRAPH = 'paragraph';
-var T_TEXT = 'text';
-var T_CODE = 'code';
-var T_LIST = 'list';
-var T_LIST_ITEM = 'listItem';
-var T_DEFINITION = 'definition';
-var T_FOOTNOTE_DEFINITION = 'footnoteDefinition';
-var T_HEADING = 'heading';
-var T_BLOCKQUOTE = 'blockquote';
-var T_LINK = 'link';
-var T_IMAGE = 'image';
-var T_FOOTNOTE = 'footnote';
-var T_STRONG = 'strong';
-var T_EMPHASIS = 'emphasis';
-var T_DELETE = 'delete';
-var T_INLINE_CODE = 'inlineCode';
-var T_BREAK = 'break';
-var T_ROOT = 'root';
-
-/*
- * Available table alignments.
- */
-
-var TABLE_ALIGN_LEFT = 'left';
-var TABLE_ALIGN_CENTER = 'center';
-var TABLE_ALIGN_RIGHT = 'right';
-var TABLE_ALIGN_NONE = null;
-
-/*
- * Available reference types.
- */
-
-var REFERENCE_TYPE_SHORTCUT = 'shortcut';
-var REFERENCE_TYPE_COLLAPSED = 'collapsed';
-var REFERENCE_TYPE_FULL = 'full';
-
-/*
- * A map of characters, and their column length,
- * which can be used as indentation.
- */
-
-var INDENTATION_CHARACTERS = {};
-
-INDENTATION_CHARACTERS[C_SPACE] = SPACE_SIZE;
-INDENTATION_CHARACTERS[C_TAB] = TAB_SIZE;
-
-/*
- * A map of characters, which can be used to mark emphasis.
- */
-
-var EMPHASIS_MARKERS = {};
-
-EMPHASIS_MARKERS[C_ASTERISK] = true;
-EMPHASIS_MARKERS[C_UNDERSCORE] = true;
-
-/*
- * A map of characters, which can be used to mark rules.
- */
-
-var RULE_MARKERS = {};
-
-RULE_MARKERS[C_ASTERISK] = true;
-RULE_MARKERS[C_UNDERSCORE] = true;
-RULE_MARKERS[C_DASH] = true;
-
-/*
- * A map of characters which can be used to mark
- * list-items.
- */
-
-var LIST_UNORDERED_MARKERS = {};
-
-LIST_UNORDERED_MARKERS[C_ASTERISK] = true;
-LIST_UNORDERED_MARKERS[C_PLUS] = true;
-LIST_UNORDERED_MARKERS[C_DASH] = true;
-
-/*
- * A map of characters which can be used to mark
- * list-items after a digit.
- */
-
-var LIST_ORDERED_MARKERS = {};
-
-LIST_ORDERED_MARKERS[C_DOT] = true;
-
-/*
- * A map of characters which can be used to mark
- * list-items after a digit.
- */
-
-var LIST_ORDERED_COMMONMARK_MARKERS = {};
-
-LIST_ORDERED_COMMONMARK_MARKERS[C_DOT] = true;
-LIST_ORDERED_COMMONMARK_MARKERS[C_PAREN_CLOSE] = true;
-
-/*
- * A map of characters, which can be used to mark link
- * and image titles.
- */
-
-var LINK_MARKERS = {};
-
-LINK_MARKERS[C_DOUBLE_QUOTE] = C_DOUBLE_QUOTE;
-LINK_MARKERS[C_SINGLE_QUOTE] = C_SINGLE_QUOTE;
-
-/*
- * A map of characters, which can be used to mark link
- * and image titles in commonmark-mode.
- */
-
-var COMMONMARK_LINK_MARKERS = {};
-
-COMMONMARK_LINK_MARKERS[C_DOUBLE_QUOTE] = C_DOUBLE_QUOTE;
-COMMONMARK_LINK_MARKERS[C_SINGLE_QUOTE] = C_SINGLE_QUOTE;
-COMMONMARK_LINK_MARKERS[C_PAREN_OPEN] = C_PAREN_CLOSE;
-
-/*
- * A map of characters which can be used to mark setext
- * headers, mapping to their corresponding depth.
- */
-
-var SETEXT_MARKERS = {};
-
-SETEXT_MARKERS[C_EQUALS] = 1;
-SETEXT_MARKERS[C_DASH] = 2;
-
-/*
- * A map of two functions which can create list items.
- */
-
-var LIST_ITEM_MAP = {};
-
-LIST_ITEM_MAP.true = renderPedanticListItem;
-LIST_ITEM_MAP.false = renderNormalListItem;
-
-/**
- * Check whether `character` is alphabetic.
- *
- * @param {string} character - Single character to check.
- * @return {boolean} - Whether `character` is alphabetic.
- */
-function isAlphabetic(character) {
- var code = character.charCodeAt(0);
-
- return (code >= CC_A_LOWER && code <= CC_Z_LOWER) ||
- (code >= CC_A_UPPER && code <= CC_Z_UPPER);
-}
-
-/**
- * Check whether `character` is numeric.
- *
- * @param {string} character - Single character to check.
- * @return {boolean} - Whether `character` is numeric.
- */
-function isNumeric(character) {
- var code = character.charCodeAt(0);
-
- return code >= CC_0 && code <= CC_9;
-}
-
-/**
- * Check whether `character` is a word character.
- *
- * @param {string} character - Single character to check.
- * @return {boolean} - Whether `character` is a word
- * character.
- */
-function isWordCharacter(character) {
- return character === C_UNDERSCORE ||
- isAlphabetic(character) ||
- isNumeric(character);
-}
-
-/**
- * Check whether `character` is white-space.
- *
- * @param {string} character - Single character to check.
- * @return {boolean} - Whether `character` is white-space.
- */
-function isWhiteSpace(character) {
- return character === C_SPACE ||
- character === C_FORM_FEED ||
- character === C_NEWLINE ||
- character === C_CARRIAGE_RETURN ||
- character === C_TAB ||
- character === C_VERTICAL_TAB ||
- character === C_NO_BREAK_SPACE ||
- character === C_OGHAM_SPACE ||
- character === C_MONGOLIAN_VOWEL_SEPARATOR ||
- character === C_EN_QUAD ||
- character === C_EM_QUAD ||
- character === C_EN_SPACE ||
- character === C_EM_SPACE ||
- character === C_THREE_PER_EM_SPACE ||
- character === C_FOUR_PER_EM_SPACE ||
- character === C_SIX_PER_EM_SPACE ||
- character === C_FIGURE_SPACE ||
- character === C_PUNCTUATION_SPACE ||
- character === C_THIN_SPACE ||
- character === C_HAIR_SPACE ||
- character === C_LINE_SEPARATOR ||
- character === C_PARAGRAPH_SEPARATOR ||
- character === C_NARROW_NO_BREAK_SPACE ||
- character === C_IDEOGRAPHIC_SPACE ||
- character === C_ZERO_WIDTH_NO_BREAK_SPACE;
-}
-
-/**
- * Check whether `character` can be inside an unquoted
- * attribute value.
- *
- * @param {string} character - Single character to check.
- * @return {boolean} - Whether `character` can be inside
- * an unquoted attribute value.
- */
-function isUnquotedAttributeCharacter(character) {
- return character !== C_DOUBLE_QUOTE &&
- character !== C_SINGLE_QUOTE &&
- character !== C_EQUALS &&
- character !== C_LT &&
- character !== C_GT &&
- character !== C_TICK;
-}
-
-/**
- * Check whether `character` can be inside a double-quoted
- * attribute value.
- *
- * @property {string} delimiter - Closing delimiter.
- * @param {string} character - Single character to check.
- * @return {boolean} - Whether `character` can be inside
- * a double-quoted attribute value.
- */
-function isDoubleQuotedAttributeCharacter(character) {
- return character !== C_DOUBLE_QUOTE;
-}
-
-isDoubleQuotedAttributeCharacter.delimiter = C_DOUBLE_QUOTE;
-
-/**
- * Check whether `character` can be inside a single-quoted
- * attribute value.
- *
- * @property {string} delimiter - Closing delimiter.
- * @param {string} character - Single character to check.
- * @return {boolean} - Whether `character` can be inside
- * a single-quoted attribute value.
- */
-function isSingleQuotedAttributeCharacter(character) {
- return character !== C_SINGLE_QUOTE;
-}
-
-isSingleQuotedAttributeCharacter.delimiter = C_SINGLE_QUOTE;
-
-/**
- * Check whether `character` can be inside an enclosed
- * URI.
- *
- * @property {string} delimiter - Closing delimiter.
- * @param {string} character - Character to test.
- * @return {boolean} - Whether `character` can be inside
- * an enclosed URI.
- */
-function isEnclosedURLCharacter(character) {
- return character !== C_GT &&
- character !== C_BRACKET_OPEN &&
- character !== C_BRACKET_CLOSE;
-}
-
-isEnclosedURLCharacter.delimiter = C_GT;
-
-/**
- * Check whether `character` can be inside an unclosed
- * URI.
- *
- * @param {string} character - Character to test.
- * @return {boolean} - Whether `character` can be inside
- * an unclosed URI.
- */
-function isUnclosedURLCharacter(character) {
- return character !== C_BRACKET_OPEN &&
- character !== C_BRACKET_CLOSE &&
- !isWhiteSpace(character);
-}
-
-/**
- * Normalize an identifier. Collapses multiple white space
- * characters into a single space, and removes casing.
- *
- * @example
- * normalizeIdentifier('FOO\t bar'); // 'foo bar'
- *
- * @param {string} value - Content to normalize.
- * @return {string} - Normalized content.
- */
-function normalize(value) {
- return collapseWhiteSpace(value).toLowerCase();
-}
-
-/**
- * Construct a state `toggler`: a function which inverses
- * `property` in context based on its current value.
- * The by `toggler` returned function restores that value.
- *
- * @example
- * var context = {};
- * var key = 'foo';
- * var val = true;
- * context[key] = val;
- * context.enter = toggle(key, val);
- * context[key]; // true
- * var exit = context.enter();
- * context[key]; // false
- * var nested = context.enter();
- * context[key]; // false
- * nested();
- * context[key]; // false
- * exit();
- * context[key]; // true
- *
- * @param {string} key - Property to toggle.
- * @param {boolean} state - It's default state.
- * @return {function(): function()} - Enter.
- */
-function toggle(key, state) {
- /**
- * Construct a toggler for the bound `key`.
- *
- * @return {Function} - Exit state.
- */
- function enter() {
- var self = this;
- var current = self[key];
-
- self[key] = !state;
-
- /**
- * State canceler, cancels the state, if allowed.
- */
- function exit() {
- self[key] = current;
- }
-
- return exit;
- }
-
- return enter;
-}
-
-/*
- * Define nodes of a type which can be merged.
- */
-
-var MERGEABLE_NODES = {};
-
-/**
- * Check whether a node is mergeable with adjacent nodes.
- *
- * @param {Object} node - Node to check.
- * @return {boolean} - Whether `node` is mergable.
- */
-function mergeable(node) {
- var start;
- var end;
-
- if (node.type !== 'text' || !node.position) {
- return true;
- }
-
- start = node.position.start;
- end = node.position.end;
-
- /*
- * Only merge nodes which occupy the same size as their
- * `value`.
- */
-
- return start.line !== end.line ||
- end.column - start.column === node.value.length;
-}
-
-/**
- * Merge two text nodes: `node` into `prev`.
- *
- * @param {Object} prev - Preceding sibling.
- * @param {Object} node - Following sibling.
- * @return {Object} - `prev`.
- */
-MERGEABLE_NODES.text = function (prev, node) {
- prev.value += node.value;
-
- return prev;
-};
-
-/**
- * Merge two blockquotes: `node` into `prev`, unless in
- * CommonMark mode.
- *
- * @param {Object} prev - Preceding sibling.
- * @param {Object} node - Following sibling.
- * @return {Object} - `prev`, or `node` in CommonMark mode.
- */
-MERGEABLE_NODES.blockquote = function (prev, node) {
- if (this.options.commonmark) {
- return node;
- }
-
- prev.children = prev.children.concat(node.children);
-
- return prev;
-};
-
-/**
- * Factory to create an entity decoder.
- *
- * @param {Object} context - Context to attach to, e.g.,
- * a parser.
- * @return {Function} - See `decode`.
- */
-function decodeFactory(context) {
- /**
- * Normalize `position` to add an `indent`.
- *
- * @param {Position} position - Reference
- * @return {Position} - Augmented with `indent`.
- */
- function normalize(position) {
- return {
- 'start': position,
- 'indent': context.getIndent(position.line)
- };
- }
-
- /**
- * Handle a warning.
- *
- * @this {VFile} - Virtual file.
- * @param {string} reason - Reason for warning.
- * @param {Position} position - Place of warning.
- * @param {number} code - Code for warning.
- */
- function handleWarning(reason, position, code) {
- if (code === 3) {
- return;
- }
-
- context.file.warn(reason, position);
- }
-
- /**
- * Decode `value` (at `position`) into text-nodes.
- *
- * @param {string} value - Value to parse.
- * @param {Position} position - Position to start parsing at.
- * @param {Function} handler - Node handler.
- */
- function decoder(value, position, handler) {
- decode(value, {
- 'position': normalize(position),
- 'warning': handleWarning,
- 'text': handler,
- 'reference': handler,
- 'textContext': context,
- 'referenceContext': context
- });
- }
-
- /**
- * Decode `value` (at `position`) into a string.
- *
- * @param {string} value - Value to parse.
- * @param {Position} position - Position to start
- * parsing at.
- * @return {string} - Plain-text.
- */
- function decodeRaw(value, position) {
- return decode(value, {
- 'position': normalize(position),
- 'warning': handleWarning
- });
- }
-
- decoder.raw = decodeRaw;
-
- return decoder;
-}
-
-/**
- * Factory to de-escape a value, based on a list at `key`
- * in `scope`.
- *
- * @example
- * var scope = {escape: ['a']}
- * var descape = descapeFactory(scope, 'escape');
- *
- * @param {Object} scope - List of escapable characters.
- * @param {string} key - Key in `map` at which the list
- * exists.
- * @return {function(string): string} - Function which
- * takes a value and returns its unescaped version.
- */
-function descapeFactory(scope, key) {
- /**
- * De-escape a string using the expression at `key`
- * in `scope`.
- *
- * @example
- * var scope = {escape: ['a']}
- * var descape = descapeFactory(scope, 'escape');
- * descape('\a \b'); // 'a \b'
- *
- * @param {string} value - Escaped string.
- * @return {string} - Unescaped string.
- */
- function descape(value) {
- var prev = 0;
- var index = value.indexOf(C_BACKSLASH);
- var escape = scope[key];
- var queue = [];
- var character;
-
- while (index !== -1) {
- queue.push(value.slice(prev, index));
- prev = index + 1;
- character = value.charAt(prev);
-
- /*
- * If the following character is not a valid escape,
- * add the slash.
- */
-
- if (!character || escape.indexOf(character) === -1) {
- queue.push(C_BACKSLASH);
- }
-
- index = value.indexOf(C_BACKSLASH, prev);
- }
-
- queue.push(value.slice(prev));
-
- return queue.join(EMPTY);
- }
-
- return descape;
-}
-
-/**
- * Gets indentation information for a line.
- *
- * @example
- * getIndent(' foo');
- * // {indent: 2, stops: {1: 0, 2: 1}}
- *
- * getIndent('\tfoo');
- * // {indent: 4, stops: {4: 0}}
- *
- * getIndent(' \tfoo');
- * // {indent: 4, stops: {1: 0, 2: 1, 4: 2}}
- *
- * getIndent('\t foo')
- * // {indent: 6, stops: {4: 0, 5: 1, 6: 2}}
- *
- * @param {string} value - Indented line.
- * @return {Object} - Indetation information.
- */
-function getIndent(value) {
- var index = 0;
- var indent = 0;
- var character = value.charAt(index);
- var stops = {};
- var size;
-
- while (character in INDENTATION_CHARACTERS) {
- size = INDENTATION_CHARACTERS[character];
-
- indent += size;
-
- if (size > 1) {
- indent = Math.floor(indent / size) * size;
- }
-
- stops[indent] = index;
-
- character = value.charAt(++index);
- }
-
- return {
- 'indent': indent,
- 'stops': stops
- };
-}
-
-/**
- * Remove the minimum indent from every line in `value`.
- * Supports both tab, spaced, and mixed indentation (as
- * well as possible).
- *
- * @example
- * removeIndentation(' foo'); // 'foo'
- * removeIndentation(' foo', 2); // ' foo'
- * removeIndentation('\tfoo', 2); // ' foo'
- * removeIndentation(' foo\n bar'); // ' foo\n bar'
- *
- * @param {string} value - Value to trim.
- * @param {number?} [maximum] - Maximum indentation
- * to remove.
- * @return {string} - Unindented `value`.
- */
-function removeIndentation(value, maximum) {
- var values = value.split(C_NEWLINE);
- var position = values.length + 1;
- var minIndent = Infinity;
- var matrix = [];
- var index;
- var indentation;
- var stops;
- var padding;
-
- values.unshift(repeat(C_SPACE, maximum) + C_EXCLAMATION_MARK);
-
- while (position--) {
- indentation = getIndent(values[position]);
-
- matrix[position] = indentation.stops;
-
- if (trim(values[position]).length === 0) {
- continue;
- }
-
- if (indentation.indent) {
- if (indentation.indent > 0 && indentation.indent < minIndent) {
- minIndent = indentation.indent;
- }
- } else {
- minIndent = Infinity;
-
- break;
- }
- }
-
- if (minIndent !== Infinity) {
- position = values.length;
-
- while (position--) {
- stops = matrix[position];
- index = minIndent;
-
- while (index && !(index in stops)) {
- index--;
- }
-
- if (
- trim(values[position]).length !== 0 &&
- minIndent &&
- index !== minIndent
- ) {
- padding = C_TAB;
- } else {
- padding = EMPTY;
- }
-
- values[position] = padding + values[position].slice(
- index in stops ? stops[index] + 1 : 0
- );
- }
- }
-
- values.shift();
-
- return values.join(C_NEWLINE);
-}
-
-/**
- * Tokenise a line.
- *
- * @example
- * tokenizeNewline(eat, '\n\n');
- *
- * @param {function(string)} eat - Eater.
- * @param {string} value - Rest of content.
- * @param {boolean?} [silent] - Whether this is a dry run.
- * @return {boolean?} - `true` when matching.
- */
-function tokenizeNewline(eat, value, silent) {
- var character = value.charAt(0);
- var length;
- var subvalue;
- var queue;
- var index;
-
- if (character !== C_NEWLINE) {
- return;
- }
-
- /* istanbul ignore if - never used (yet) */
- if (silent) {
- return true;
- }
-
- index = 1;
- length = value.length;
- subvalue = C_NEWLINE;
- queue = EMPTY;
-
- while (index < length) {
- character = value.charAt(index);
-
- if (!isWhiteSpace(character)) {
- break;
- }
-
- queue += character;
-
- if (character === C_NEWLINE) {
- subvalue += queue;
- queue = EMPTY;
- }
-
- index++;
- }
-
- eat(subvalue);
-}
-
-/**
- * Tokenise an indented code block.
- *
- * @example
- * tokenizeIndentedCode(eat, '\tfoo');
- *
- * @param {function(string)} eat - Eater.
- * @param {string} value - Rest of content.
- * @param {boolean?} [silent] - Whether this is a dry run.
- * @return {Node?|boolean} - `code` node.
- */
-function tokenizeIndentedCode(eat, value, silent) {
- var self = this;
- var index = -1;
- var length = value.length;
- var character;
- var subvalue = EMPTY;
- var content = EMPTY;
- var subvalueQueue = EMPTY;
- var contentQueue = EMPTY;
- var blankQueue;
- var indent;
-
- while (++index < length) {
- character = value.charAt(index);
-
- if (indent) {
- indent = false;
-
- subvalue += subvalueQueue;
- content += contentQueue;
- subvalueQueue = contentQueue = EMPTY;
-
- if (character === C_NEWLINE) {
- subvalueQueue = contentQueue = character;
- } else {
- subvalue += character;
- content += character;
-
- while (++index < length) {
- character = value.charAt(index);
-
- if (!character || character === C_NEWLINE) {
- contentQueue = subvalueQueue = character;
- break;
- }
-
- subvalue += character;
- content += character;
- }
- }
- } else if (
- character === C_SPACE &&
- value.charAt(index + 1) === C_SPACE &&
- value.charAt(index + 2) === C_SPACE &&
- value.charAt(index + 3) === C_SPACE
- ) {
- subvalueQueue += CODE_INDENT;
- index += 3;
- indent = true;
- } else if (character === C_TAB) {
- subvalueQueue += character;
- indent = true;
- } else {
- blankQueue = EMPTY;
-
- while (character === C_TAB || character === C_SPACE) {
- blankQueue += character;
- character = value.charAt(++index);
- }
-
- if (character !== C_NEWLINE) {
- break;
- }
-
- subvalueQueue += blankQueue + character;
- contentQueue += character;
- }
- }
-
- if (content) {
- if (silent) {
- return true;
- }
-
- return eat(subvalue)(self.renderCodeBlock(content));
- }
-}
-
-/**
- * Tokenise a fenced code block.
- *
- * @example
- * tokenizeFencedCode(eat, '```js\nfoo()\n```');
- *
- * @param {function(string)} eat - Eater.
- * @param {string} value - Rest of content.
- * @param {boolean?} [silent] - Whether this is a dry run.
- * @return {Node?|boolean} - `code` node.
- */
-function tokenizeFencedCode(eat, value, silent) {
- var self = this;
- var settings = self.options;
- var length = value.length + 1;
- var index = 0;
- var subvalue = EMPTY;
- var fenceCount;
- var marker;
- var character;
- var flag;
- var queue;
- var content;
- var exdentedContent;
- var closing;
- var exdentedClosing;
- var indent;
- var now;
-
- if (!settings.gfm) {
- return;
- }
-
- /*
- * Eat initial spacing.
- */
-
- while (index < length) {
- character = value.charAt(index);
-
- if (character !== C_SPACE && character !== C_TAB) {
- break;
- }
-
- subvalue += character;
- index++;
- }
-
- indent = index; // TODO: CHECK.
-
- /*
- * Eat the fence.
- */
-
- character = value.charAt(index);
-
- if (character !== C_TILDE && character !== C_TICK) {
- return;
- }
-
- index++;
- marker = character;
- fenceCount = 1;
- subvalue += character;
-
- while (index < length) {
- character = value.charAt(index);
-
- if (character !== marker) {
- break;
- }
-
- subvalue += character;
- fenceCount++;
- index++;
- }
-
- if (fenceCount < MIN_FENCE_COUNT) {
- return;
- }
-
- /*
- * Eat spacing before flag.
- */
-
- while (index < length) {
- character = value.charAt(index);
-
- if (character !== C_SPACE && character !== C_TAB) {
- break;
- }
-
- subvalue += character;
- index++;
- }
-
- /*
- * Eat flag.
- */
-
- flag = queue = EMPTY;
-
- while (index < length) {
- character = value.charAt(index);
-
- if (
- character === C_NEWLINE ||
- character === C_TILDE ||
- character === C_TICK
- ) {
- break;
- }
-
- if (character === C_SPACE || character === C_TAB) {
- queue += character;
- } else {
- flag += queue + character;
- queue = EMPTY;
- }
-
- index++;
- }
-
- character = value.charAt(index);
-
- if (character && character !== C_NEWLINE) {
- return;
- }
-
- if (silent) {
- return true;
- }
-
- now = eat.now();
- now.column += subvalue.length;
- now.offset += subvalue.length;
-
- subvalue += flag;
- flag = self.decode.raw(self.descape(flag), now);
-
- if (queue) {
- subvalue += queue;
- }
-
- queue = closing = exdentedClosing = content = exdentedContent = EMPTY;
-
- /*
- * Eat content.
- */
-
- while (index < length) {
- character = value.charAt(index);
- content += closing;
- exdentedContent += exdentedClosing;
- closing = exdentedClosing = EMPTY;
-
- if (character !== C_NEWLINE) {
- content += character;
- exdentedClosing += character;
- index++;
- continue;
- }
-
- /*
- * Add the newline to `subvalue` if its the first
- * character. Otherwise, add it to the `closing`
- * queue.
- */
-
- if (!content) {
- subvalue += character;
- } else {
- closing += character;
- exdentedClosing += character;
- }
-
- queue = EMPTY;
- index++;
-
- while (index < length) {
- character = value.charAt(index);
-
- if (character !== C_SPACE) {
- break;
- }
-
- queue += character;
- index++;
- }
-
- closing += queue;
- exdentedClosing += queue.slice(indent);
-
- if (queue.length >= CODE_INDENT_LENGTH) {
- continue;
- }
-
- queue = EMPTY;
-
- while (index < length) {
- character = value.charAt(index);
-
- if (character !== marker) {
- break;
- }
-
- queue += character;
- index++;
- }
-
- closing += queue;
- exdentedClosing += queue;
-
- if (queue.length < fenceCount) {
- continue;
- }
-
- queue = EMPTY;
-
- while (index < length) {
- character = value.charAt(index);
-
- if (character !== C_SPACE && character !== C_TAB) {
- break;
- }
-
- closing += character;
- exdentedClosing += character;
- index++;
- }
-
- if (!character || character === C_NEWLINE) {
- break;
- }
- }
-
- subvalue += content + closing;
-
- return eat(subvalue)(self.renderCodeBlock(exdentedContent, flag));
-}
-
-/**
- * Tokenise an ATX-style heading.
- *
- * @example
- * tokenizeATXHeading(eat, ' # foo');
- *
- * @param {function(string)} eat - Eater.
- * @param {string} value - Rest of content.
- * @param {boolean?} [silent] - Whether this is a dry run.
- * @return {Node?|boolean} - `heading` node.
- */
-function tokenizeATXHeading(eat, value, silent) {
- var self = this;
- var settings = self.options;
- var length = value.length + 1;
- var index = -1;
- var now = eat.now();
- var subvalue = EMPTY;
- var content = EMPTY;
- var character;
- var queue;
- var depth;
-
- /*
- * Eat initial spacing.
- */
-
- while (++index < length) {
- character = value.charAt(index);
-
- if (character !== C_SPACE && character !== C_TAB) {
- index--;
- break;
- }
-
- subvalue += character;
- }
-
- /*
- * Eat hashes.
- */
-
- depth = 0;
- length = index + MAX_ATX_COUNT + 1;
-
- while (++index <= length) {
- character = value.charAt(index);
-
- if (character !== C_HASH) {
- index--;
- break;
- }
-
- subvalue += character;
- depth++;
- }
-
- if (
- !depth ||
- (!settings.pedantic && value.charAt(index + 1) === C_HASH)
- ) {
- return;
- }
-
- length = value.length + 1;
-
- /*
- * Eat intermediate white-space.
- */
-
- queue = EMPTY;
-
- while (++index < length) {
- character = value.charAt(index);
-
- if (character !== C_SPACE && character !== C_TAB) {
- index--;
- break;
- }
-
- queue += character;
- }
-
- /*
- * Exit when not in pedantic mode without spacing.
- */
-
- if (
- !settings.pedantic &&
- !queue.length &&
- character &&
- character !== C_NEWLINE
- ) {
- return;
- }
-
- if (silent) {
- return true;
- }
-
- /*
- * Eat content.
- */
-
- subvalue += queue;
- queue = content = EMPTY;
-
- while (++index < length) {
- character = value.charAt(index);
-
- if (!character || character === C_NEWLINE) {
- break;
- }
-
- if (
- character !== C_SPACE &&
- character !== C_TAB &&
- character !== C_HASH
- ) {
- content += queue + character;
- queue = EMPTY;
- continue;
- }
-
- while (character === C_SPACE || character === C_TAB) {
- queue += character;
- character = value.charAt(++index);
- }
-
- while (character === C_HASH) {
- queue += character;
- character = value.charAt(++index);
- }
-
- while (character === C_SPACE || character === C_TAB) {
- queue += character;
- character = value.charAt(++index);
- }
-
- index--;
- }
-
- now.column += subvalue.length;
- now.offset += subvalue.length;
- subvalue += content + queue;
-
- return eat(subvalue)(self.renderHeading(content, depth, now));
-}
-
-/**
- * Tokenise a Setext-style heading.
- *
- * @example
- * tokenizeSetextHeading(eat, 'foo\n===');
- *
- * @param {function(string)} eat - Eater.
- * @param {string} value - Rest of content.
- * @param {boolean?} [silent] - Whether this is a dry run.
- * @return {Node?|boolean} - `heading` node.
- */
-function tokenizeSetextHeading(eat, value, silent) {
- var self = this;
- var now = eat.now();
- var length = value.length;
- var index = -1;
- var subvalue = EMPTY;
- var content;
- var queue;
- var character;
- var marker;
- var depth;
-
- /*
- * Eat initial indentation.
- */
-
- while (++index < length) {
- character = value.charAt(index);
-
- if (character !== C_SPACE || index >= MAX_LINE_HEADING_INDENT) {
- index--;
- break;
- }
-
- subvalue += character;
- }
-
- /*
- * Eat content.
- */
-
- content = queue = EMPTY;
-
- while (++index < length) {
- character = value.charAt(index);
-
- if (character === C_NEWLINE) {
- index--;
- break;
- }
-
- if (character === C_SPACE || character === C_TAB) {
- queue += character;
- } else {
- content += queue + character;
- queue = EMPTY;
- }
- }
-
- now.column += subvalue.length;
- now.offset += subvalue.length;
- subvalue += content + queue;
-
- /*
- * Ensure the content is followed by a newline and a
- * valid marker.
- */
-
- character = value.charAt(++index);
- marker = value.charAt(++index);
-
- if (character !== C_NEWLINE || !SETEXT_MARKERS[marker]) {
- return;
- }
-
- subvalue += character;
-
- /*
- * Eat Setext-line.
- */
-
- queue = marker;
- depth = SETEXT_MARKERS[marker];
-
- while (++index < length) {
- character = value.charAt(index);
-
- if (character !== marker) {
- if (character !== C_NEWLINE) {
- return;
- }
-
- index--;
- break;
- }
-
- queue += character;
- }
-
- if (silent) {
- return true;
- }
-
- return eat(subvalue + queue)(self.renderHeading(content, depth, now));
-}
-
-/**
- * Tokenise a horizontal rule.
- *
- * @example
- * tokenizeThematicBreak(eat, '***');
- *
- * @param {function(string)} eat - Eater.
- * @param {string} value - Rest of content.
- * @param {boolean?} [silent] - Whether this is a dry run.
- * @return {Node?|boolean} - `thematicBreak` node.
- */
-function tokenizeThematicBreak(eat, value, silent) {
- var self = this;
- var index = -1;
- var length = value.length + 1;
- var subvalue = EMPTY;
- var character;
- var marker;
- var markerCount;
- var queue;
-
- while (++index < length) {
- character = value.charAt(index);
-
- if (character !== C_TAB && character !== C_SPACE) {
- break;
- }
-
- subvalue += character;
- }
-
- if (RULE_MARKERS[character] !== true) {
- return;
- }
-
- marker = character;
- subvalue += character;
- markerCount = 1;
- queue = EMPTY;
-
- while (++index < length) {
- character = value.charAt(index);
-
- if (character === marker) {
- markerCount++;
- subvalue += queue + marker;
- queue = EMPTY;
- } else if (character === C_SPACE) {
- queue += character;
- } else if (
- markerCount >= THEMATIC_BREAK_MARKER_COUNT &&
- (!character || character === C_NEWLINE)
- ) {
- subvalue += queue;
-
- if (silent) {
- return true;
- }
-
- return eat(subvalue)(self.renderVoid(T_THEMATIC_BREAK));
- } else {
- return;
- }
- }
-}
-
-/**
- * Tokenise a blockquote.
- *
- * @example
- * tokenizeBlockquote(eat, '> Foo');
- *
- * @param {function(string)} eat - Eater.
- * @param {string} value - Rest of content.
- * @param {boolean?} [silent] - Whether this is a dry run.
- * @return {Node?|boolean} - `blockquote` node.
- */
-function tokenizeBlockquote(eat, value, silent) {
- var self = this;
- var commonmark = self.options.commonmark;
- var now = eat.now();
- var indent = self.indent(now.line);
- var length = value.length;
- var values = [];
- var contents = [];
- var indents = [];
- var add;
- var tokenizers;
- var index = 0;
- var character;
- var rest;
- var nextIndex;
- var content;
- var line;
- var startIndex;
- var prefixed;
-
- while (index < length) {
- character = value.charAt(index);
-
- if (character !== C_SPACE && character !== C_TAB) {
- break;
- }
-
- index++;
- }
-
- if (value.charAt(index) !== C_GT) {
- return;
- }
-
- if (silent) {
- return true;
- }
-
- tokenizers = self.blockTokenizers;
- index = 0;
-
- while (index < length) {
- nextIndex = value.indexOf(C_NEWLINE, index);
- startIndex = index;
- prefixed = false;
-
- if (nextIndex === -1) {
- nextIndex = length;
- }
-
- while (index < length) {
- character = value.charAt(index);
-
- if (character !== C_SPACE && character !== C_TAB) {
- break;
- }
-
- index++;
- }
-
- if (value.charAt(index) === C_GT) {
- index++;
- prefixed = true;
-
- if (value.charAt(index) === C_SPACE) {
- index++;
- }
- } else {
- index = startIndex;
- }
-
- content = value.slice(index, nextIndex);
-
- if (!prefixed && !trim(content)) {
- index = startIndex;
- break;
- }
-
- if (!prefixed) {
- rest = value.slice(index);
-
- if (
- commonmark &&
- (
- tokenizers.indentedCode.call(self, eat, rest, true) ||
- tokenizers.fencedCode.call(self, eat, rest, true) ||
- tokenizers.atxHeading.call(self, eat, rest, true) ||
- tokenizers.setextHeading.call(self, eat, rest, true) ||
- tokenizers.thematicBreak.call(self, eat, rest, true) ||
- tokenizers.html.call(self, eat, rest, true) ||
- tokenizers.list.call(self, eat, rest, true)
- )
- ) {
- break;
- }
-
- if (
- !commonmark &&
- (
- tokenizers.definition.call(self, eat, rest, true) ||
- tokenizers.footnote.call(self, eat, rest, true)
- )
- ) {
- break;
- }
- }
-
- line = startIndex === index ?
- content :
- value.slice(startIndex, nextIndex);
-
- indents.push(index - startIndex);
- values.push(line);
- contents.push(content);
-
- index = nextIndex + 1;
- }
-
- index = -1;
- length = indents.length;
- add = eat(values.join(C_NEWLINE));
-
- while (++index < length) {
- indent(indents[index]);
- }
-
- return add(self.renderBlockquote(contents.join(C_NEWLINE), now));
-}
-
-/**
- * Tokenise a list.
- *
- * @example
- * tokenizeList(eat, '- Foo');
- *
- * @param {function(string)} eat - Eater.
- * @param {string} value - Rest of content.
- * @param {boolean?} [silent] - Whether this is a dry run.
- * @return {Node?|boolean} - `list` node.
- */
-function tokenizeList(eat, value, silent) {
- var self = this;
- var commonmark = self.options.commonmark;
- var pedantic = self.options.pedantic;
- var tokenizers = self.blockTokenizers;
- var markers;
- var index = 0;
- var length = value.length;
- var start = null;
- var queue;
- var ordered;
- var character;
- var marker;
- var nextIndex;
- var startIndex;
- var prefixed;
- var currentMarker;
- var content;
- var line;
- var prevEmpty;
- var empty;
- var items;
- var allLines;
- var emptyLines;
- var item;
- var enterTop;
- var exitBlockquote;
- var isLoose;
- var node;
- var now;
- var end;
- var indented;
- var size;
-
- while (index < length) {
- character = value.charAt(index);
-
- if (character !== C_SPACE && character !== C_TAB) {
- break;
- }
-
- index++;
- }
-
- character = value.charAt(index);
-
- markers = commonmark ?
- LIST_ORDERED_COMMONMARK_MARKERS :
- LIST_ORDERED_MARKERS;
-
- if (LIST_UNORDERED_MARKERS[character] === true) {
- marker = character;
- ordered = false;
- } else {
- ordered = true;
- queue = EMPTY;
-
- while (index < length) {
- character = value.charAt(index);
-
- if (!isNumeric(character)) {
- break;
- }
-
- queue += character;
- index++;
- }
-
- character = value.charAt(index);
-
- if (!queue || markers[character] !== true) {
- return;
- }
-
- start = parseInt(queue, 10);
- marker = character;
- }
-
- character = value.charAt(++index);
-
- if (character !== C_SPACE && character !== C_TAB) {
- return;
- }
-
- if (silent) {
- return true;
- }
-
- index = 0;
- items = [];
- allLines = [];
- emptyLines = [];
-
- while (index < length) {
- nextIndex = value.indexOf(C_NEWLINE, index);
- startIndex = index;
- prefixed = false;
- indented = false;
-
- if (nextIndex === -1) {
- nextIndex = length;
- }
-
- end = index + TAB_SIZE;
- size = 0;
-
- while (index < length) {
- character = value.charAt(index);
-
- if (character === C_TAB) {
- size += TAB_SIZE - size % TAB_SIZE;
- } else if (character === C_SPACE) {
- size++;
- } else {
- break;
- }
-
- index++;
- }
-
- if (size >= TAB_SIZE) {
- indented = true;
- }
-
- if (item && size >= item.indent) {
- indented = true;
- }
-
- character = value.charAt(index);
- currentMarker = null;
-
- if (!indented) {
- if (LIST_UNORDERED_MARKERS[character] === true) {
- currentMarker = character;
- index++;
- size++;
- } else {
- queue = EMPTY;
-
- while (index < length) {
- character = value.charAt(index);
-
- if (!isNumeric(character)) {
- break;
- }
-
- queue += character;
- index++;
- }
-
- character = value.charAt(index);
- index++;
-
- if (queue && markers[character] === true) {
- currentMarker = character;
- size += queue.length + 1;
- }
- }
-
- if (currentMarker) {
- character = value.charAt(index);
-
- if (character === C_TAB) {
- size += TAB_SIZE - size % TAB_SIZE;
- index++;
- } else if (character === C_SPACE) {
- end = index + TAB_SIZE;
-
- while (index < end) {
- if (value.charAt(index) !== C_SPACE) {
- break;
- }
-
- index++;
- size++;
- }
-
- if (index === end && value.charAt(index) === C_SPACE) {
- index -= TAB_SIZE - 1;
- size -= TAB_SIZE - 1;
- }
- } else if (
- character !== C_NEWLINE &&
- character !== EMPTY
- ) {
- currentMarker = null;
- }
- }
- }
-
- if (currentMarker) {
- if (commonmark && marker !== currentMarker) {
- break;
- }
-
- prefixed = true;
- } else {
- if (
- !commonmark &&
- !indented &&
- value.charAt(startIndex) === C_SPACE
- ) {
- indented = true;
- } else if (
- commonmark &&
- item
- ) {
- indented = size >= item.indent || size > TAB_SIZE;
- }
-
- prefixed = false;
- index = startIndex;
- }
-
- line = value.slice(startIndex, nextIndex);
- content = startIndex === index ? line : value.slice(index, nextIndex);
-
- if (currentMarker && RULE_MARKERS[currentMarker] === true) {
- if (
- tokenizers.thematicBreak.call(self, eat, line, true)
- ) {
- break;
- }
- }
-
- prevEmpty = empty;
- empty = !trim(content).length;
-
- if (indented && item) {
- item.value = item.value.concat(emptyLines, line);
- allLines = allLines.concat(emptyLines, line);
- emptyLines = [];
- } else if (prefixed) {
- if (emptyLines.length) {
- item.value.push(EMPTY);
- item.trail = emptyLines.concat();
- }
-
- item = {
- // 'bullet': value.slice(startIndex, index),
- 'value': [line],
- 'indent': size,
- 'trail': []
- };
-
- items.push(item);
- allLines = allLines.concat(emptyLines, line);
- emptyLines = [];
- } else if (empty) {
- // TODO: disable when in pedantic-mode.
- if (prevEmpty) {
- break;
- }
-
- emptyLines.push(line);
- } else {
- if (prevEmpty) {
- break;
- }
-
- if (
- !pedantic &&
- (
- tokenizers.fencedCode.call(self, eat, line, true) ||
- tokenizers.thematicBreak.call(self, eat, line, true)
- )
- ) {
- break;
- }
-
- if (!commonmark) {
- if (
- tokenizers.definition.call(self, eat, line, true) ||
- tokenizers.footnote.call(self, eat, line, true)
- ) {
- break;
- }
- }
-
- item.value = item.value.concat(emptyLines, line);
- allLines = allLines.concat(emptyLines, line);
- emptyLines = [];
- }
-
- index = nextIndex + 1;
- }
-
- node = eat(allLines.join(C_NEWLINE)).reset({
- 'type': T_LIST,
- 'ordered': ordered,
- 'start': start,
- 'loose': null,
- 'children': []
- });
-
- enterTop = self.enterList();
- exitBlockquote = self.enterBlock();
- isLoose = false;
- index = -1;
- length = items.length;
-
- while (++index < length) {
- item = items[index].value.join(C_NEWLINE);
- now = eat.now();
-
- item = eat(item)(self.renderListItem(item, now), node);
-
- if (item.loose) {
- isLoose = true;
- }
-
- item = items[index].trail.join(C_NEWLINE);
-
- if (index !== length - 1) {
- item += C_NEWLINE;
- }
-
- eat(item);
- }
-
- enterTop();
- exitBlockquote();
-
- node.loose = isLoose;
-
- return node;
-}
-
-/**
- * Try to match comment.
- *
- * @param {string} value - Value to parse.
- * @param {Object} settings - Configuration as available on
- * a parser.
- * @return {string?} - When applicable, the comment at the
- * start of `value`.
- */
-function eatHTMLComment(value, settings) {
- var index = COMMENT_START_LENGTH;
- var queue = COMMENT_START;
- var length = value.length;
- var commonmark = settings.commonmark;
- var character;
- var hasNonDash;
-
- if (value.slice(0, index) === queue) {
- while (index < length) {
- character = value.charAt(index);
-
- if (
- character === COMMENT_END_CHAR &&
- value.slice(index, index + COMMENT_END_LENGTH) === COMMENT_END
- ) {
- return queue + COMMENT_END;
- }
-
- if (commonmark) {
- if (character === C_GT && !hasNonDash) {
- return;
- }
-
- if (character === C_DASH) {
- if (value.charAt(index + 1) === C_DASH) {
- return;
- }
- } else {
- hasNonDash = true;
- }
- }
-
- queue += character;
- index++;
- }
- }
-}
-
-/**
- * Try to match CDATA.
- *
- * @param {string} value - Value to parse.
- * @return {string?} - When applicable, the CDATA at the
- * start of `value`.
- */
-function eatHTMLCDATA(value) {
- var index = CDATA_START_LENGTH;
- var queue = value.slice(0, index);
- var length = value.length;
- var character;
-
- if (queue.toUpperCase() === CDATA_START) {
- while (index < length) {
- character = value.charAt(index);
-
- if (
- character === CDATA_END_CHAR &&
- value.slice(index, index + CDATA_END_LENGTH) === CDATA_END
- ) {
- return queue + CDATA_END;
- }
-
- queue += character;
- index++;
- }
- }
-}
-
-/**
- * Try to match a processing instruction.
- *
- * @param {string} value - Value to parse.
- * @return {string?} - When applicable, the processing
- * instruction at the start of `value`.
- */
-function eatHTMLProcessingInstruction(value) {
- var index = 0;
- var queue = EMPTY;
- var length = value.length;
- var character;
-
- if (
- value.charAt(index) === C_LT &&
- value.charAt(++index) === C_QUESTION_MARK
- ) {
- queue = C_LT + C_QUESTION_MARK;
- index++;
-
- while (index < length) {
- character = value.charAt(index);
-
- if (
- character === C_QUESTION_MARK &&
- value.charAt(index + 1) === C_GT
- ) {
- return queue + character + C_GT;
- }
-
- queue += character;
- index++;
- }
- }
-}
-
-/**
- * Try to match a declaration.
- *
- * @param {string} value - Value to parse.
- * @return {string?} - When applicable, the declaration at
- * the start of `value`.
- */
-function eatHTMLDeclaration(value) {
- var index = 0;
- var length = value.length;
- var queue = EMPTY;
- var subqueue = EMPTY;
- var character;
-
- if (
- value.charAt(index) === C_LT &&
- value.charAt(++index) === C_EXCLAMATION_MARK
- ) {
- queue = C_LT + C_EXCLAMATION_MARK;
- index++;
-
- /*
- * Eat as many alphabetic characters as
- * possible.
- */
-
- while (index < length) {
- character = value.charAt(index);
-
- if (!isAlphabetic(character)) {
- break;
- }
-
- subqueue += character;
- index++;
- }
-
- character = value.charAt(index);
-
- if (!subqueue || !isWhiteSpace(character)) {
- return;
- }
-
- queue += subqueue + character;
- index++;
-
- while (index < length) {
- character = value.charAt(index);
-
- if (character === C_GT) {
- return queue;
- }
-
- queue += character;
- index++;
- }
- }
-}
-
-/**
- * Try to match a closing tag.
- *
- * @param {string} value - Value to parse.
- * @param {boolean?} [isBlock] - Whether the tag-name
- * must be a known block-level node to match.
- * @return {string?} - When applicable, the closing tag at
- * the start of `value`.
- */
-function eatHTMLClosingTag(value, isBlock) {
- var index = 0;
- var length = value.length;
- var queue = EMPTY;
- var subqueue = EMPTY;
- var character;
-
- if (
- value.charAt(index) === C_LT &&
- value.charAt(++index) === C_SLASH
- ) {
- queue = C_LT + C_SLASH;
- subqueue = character = value.charAt(++index);
-
- if (!isAlphabetic(character)) {
- return;
- }
-
- index++;
-
- /*
- * Eat as many alphabetic characters as
- * possible.
- */
-
- while (index < length) {
- character = value.charAt(index);
-
- if (!isAlphabetic(character) && !isNumeric(character)) {
- break;
- }
-
- subqueue += character;
- index++;
- }
-
- if (isBlock && blockElements.indexOf(subqueue.toLowerCase()) === -1) {
- return;
- }
-
- queue += subqueue;
-
- /*
- * Eat white-space.
- */
-
- while (index < length) {
- character = value.charAt(index);
-
- if (!isWhiteSpace(character)) {
- break;
- }
-
- queue += character;
- index++;
- }
-
- if (value.charAt(index) === C_GT) {
- return queue + C_GT;
- }
- }
-}
-
-/**
- * Try to match an opening tag.
- *
- * @param {string} value - Value to parse.
- * @param {boolean?} [isBlock] - Whether the tag-name
- * must be a known block-level node to match.
- * @return {string?} - When applicable, the opening tag at
- * the start of `value`.
- */
-function eatHTMLOpeningTag(value, isBlock) {
- var index = 0;
- var length = value.length;
- var queue = EMPTY;
- var subqueue = EMPTY;
- var character = value.charAt(index);
- var hasEquals;
- var test;
-
- if (character === C_LT) {
- queue = character;
- subqueue = character = value.charAt(++index);
-
- if (!isAlphabetic(character)) {
- return;
- }
-
- index++;
-
- /*
- * Eat as many alphabetic characters as
- * possible.
- */
-
- while (index < length) {
- character = value.charAt(index);
-
- if (!isAlphabetic(character) && !isNumeric(character)) {
- break;
- }
-
- subqueue += character;
- index++;
- }
-
- if (isBlock && blockElements.indexOf(subqueue.toLowerCase()) === -1) {
- return;
- }
-
- queue += subqueue;
- subqueue = EMPTY;
-
- /*
- * Find attributes.
- */
-
- while (index < length) {
- /*
- * Eat white-space.
- */
-
- while (index < length) {
- character = value.charAt(index);
-
- if (!isWhiteSpace(character)) {
- break;
- }
-
- subqueue += character;
- index++;
- }
-
- if (!subqueue) {
- break;
- }
-
- /*
- * Eat an attribute name.
- */
-
- queue += subqueue;
- subqueue = EMPTY;
- character = value.charAt(index);
-
- if (
- isAlphabetic(character) ||
- character === C_UNDERSCORE ||
- character === C_COLON
- ) {
- subqueue = character;
- index++;
-
- while (index < length) {
- character = value.charAt(index);
-
- if (
- !isAlphabetic(character) &&
- !isNumeric(character) &&
- character !== C_UNDERSCORE &&
- character !== C_COLON &&
- character !== C_DOT &&
- character !== C_DASH
- ) {
- break;
- }
-
- subqueue += character;
- index++;
- }
- }
-
- if (!subqueue) {
- break;
- }
-
- queue += subqueue;
- subqueue = EMPTY;
- hasEquals = false;
-
- /*
- * Eat zero or more white-space and one
- * equals sign.
- */
-
- while (index < length) {
- character = value.charAt(index);
-
- if (!isWhiteSpace(character)) {
- if (!hasEquals && character === C_EQUALS) {
- hasEquals = true;
- } else {
- break;
- }
- }
-
- subqueue += character;
- index++;
- }
-
- queue += subqueue;
- subqueue = EMPTY;
-
- if (!hasEquals) {
- queue += subqueue;
- } else {
- character = value.charAt(index);
- queue += subqueue;
-
- if (character === C_DOUBLE_QUOTE) {
- test = isDoubleQuotedAttributeCharacter;
- subqueue = character;
- index++;
- } else if (character === C_SINGLE_QUOTE) {
- test = isSingleQuotedAttributeCharacter;
- subqueue = character;
- index++;
- } else {
- test = isUnquotedAttributeCharacter;
- subqueue = EMPTY;
- }
-
- while (index < length) {
- character = value.charAt(index);
-
- if (!test(character)) {
- break;
- }
-
- subqueue += character;
- index++;
- }
-
- character = value.charAt(index);
- index++;
-
- if (!test.delimiter) {
- if (!subqueue.length) {
- return;
- }
-
- index--;
- } else if (character === test.delimiter) {
- subqueue += character;
- } else {
- return;
- }
-
- queue += subqueue;
- subqueue = EMPTY;
- }
- }
-
- /*
- * More white-space is already eaten by the
- * attributes subroutine.
- */
-
- character = value.charAt(index);
-
- /*
- * Eat an optional backslash (for self-closing
- * tags).
- */
-
- if (character === C_SLASH) {
- queue += character;
- character = value.charAt(++index);
- }
-
- return character === C_GT ? queue + character : null;
- }
-}
-
-/**
- * Tokenise HTML.
- *
- * @example
- * tokenizeBlockHTML(eat, '<span>foo</span>');
- *
- * @param {function(string)} eat - Eater.
- * @param {string} value - Rest of content.
- * @param {boolean?} [silent] - Whether this is a dry run.
- * @return {Node?|boolean} - `html` node.
- */
-function tokenizeBlockHTML(eat, value, silent) {
- var self = this;
- var index = 0;
- var length = value.length;
- var subvalue = EMPTY;
- var offset;
- var lineCount;
- var character;
- var queue;
-
- /*
- * Eat initial spacing.
- */
-
- while (index < length) {
- character = value.charAt(index);
-
- if (character !== C_TAB && character !== C_SPACE) {
- break;
- }
-
- subvalue += character;
- index++;
- }
-
- offset = index;
- value = value.slice(offset);
-
- /*
- * Try to eat an HTML thing.
- */
-
- queue = eatHTMLComment(value, self.options) ||
- eatHTMLCDATA(value) ||
- eatHTMLProcessingInstruction(value) ||
- eatHTMLDeclaration(value) ||
- eatHTMLClosingTag(value, true) ||
- eatHTMLOpeningTag(value, true);
-
- if (!queue) {
- return;
- }
-
- if (silent) {
- return true;
- }
-
- subvalue += queue;
- index = subvalue.length - offset;
- queue = EMPTY;
-
- while (index < length) {
- character = value.charAt(index);
-
- if (character === C_NEWLINE) {
- queue += character;
- lineCount++;
- } else if (queue.length < MIN_CLOSING_HTML_NEWLINE_COUNT) {
- subvalue += queue + character;
- queue = EMPTY;
- } else {
- break;
- }
-
- index++;
- }
-
- return eat(subvalue)(self.renderRaw(T_HTML, subvalue));
-}
-
-/**
- * Tokenise a definition.
- *
- * @example
- * var value = '[foo]: http://example.com "Example Domain"';
- * tokenizeDefinition(eat, value);
- *
- * @property {boolean} notInList
- * @property {boolean} notInBlock
- * @param {function(string)} eat - Eater.
- * @param {string} value - Rest of content.
- * @param {boolean?} [silent] - Whether this is a dry run.
- * @return {Node?|boolean} - `definition` node.
- */
-function tokenizeDefinition(eat, value, silent) {
- var self = this;
- var commonmark = self.options.commonmark;
- var index = 0;
- var length = value.length;
- var subvalue = EMPTY;
- var beforeURL;
- var beforeTitle;
- var queue;
- var character;
- var test;
- var identifier;
- var url;
- var title;
-
- while (index < length) {
- character = value.charAt(index);
-
- if (character !== C_SPACE && character !== C_TAB) {
- break;
- }
-
- subvalue += character;
- index++;
- }
-
- character = value.charAt(index);
-
- if (character !== C_BRACKET_OPEN) {
- return;
- }
-
- index++;
- subvalue += character;
- queue = EMPTY;
-
- while (index < length) {
- character = value.charAt(index);
-
- if (character === C_BRACKET_CLOSE) {
- break;
- } else if (character === C_BACKSLASH) {
- queue += character;
- index++;
- character = value.charAt(index);
- }
-
- queue += character;
- index++;
- }
-
- if (
- !queue ||
- value.charAt(index) !== C_BRACKET_CLOSE ||
- value.charAt(index + 1) !== C_COLON
- ) {
- return;
- }
-
- identifier = queue;
- subvalue += queue + C_BRACKET_CLOSE + C_COLON;
- index = subvalue.length;
- queue = EMPTY;
-
- while (index < length) {
- character = value.charAt(index);
-
- if (
- character !== C_TAB &&
- character !== C_SPACE &&
- character !== C_NEWLINE
- ) {
- break;
- }
-
- subvalue += character;
- index++;
- }
-
- character = value.charAt(index);
- queue = EMPTY;
- beforeURL = subvalue;
-
- if (character === C_LT) {
- index++;
-
- while (index < length) {
- character = value.charAt(index);
-
- if (!isEnclosedURLCharacter(character)) {
- break;
- }
-
- queue += character;
- index++;
- }
-
- character = value.charAt(index);
-
- if (character !== isEnclosedURLCharacter.delimiter) {
- if (commonmark) {
- return;
- }
-
- index -= queue.length + 1;
- queue = EMPTY;
- } else {
- subvalue += C_LT + queue + character;
- index++;
- }
- }
-
- if (!queue) {
- while (index < length) {
- character = value.charAt(index);
-
- if (!isUnclosedURLCharacter(character)) {
- break;
- }
-
- queue += character;
- index++;
- }
-
- subvalue += queue;
- }
-
- if (!queue) {
- return;
- }
-
- url = queue;
- queue = EMPTY;
-
- while (index < length) {
- character = value.charAt(index);
-
- if (
- character !== C_TAB &&
- character !== C_SPACE &&
- character !== C_NEWLINE
- ) {
- break;
- }
-
- queue += character;
- index++;
- }
-
- character = value.charAt(index);
- test = null;
-
- if (character === C_DOUBLE_QUOTE) {
- test = C_DOUBLE_QUOTE;
- } else if (character === C_SINGLE_QUOTE) {
- test = C_SINGLE_QUOTE;
- } else if (character === C_PAREN_OPEN) {
- test = C_PAREN_CLOSE;
- }
-
- if (!test) {
- queue = EMPTY;
- index = subvalue.length;
- } else if (!queue) {
- return;
- } else {
- subvalue += queue + character;
- index = subvalue.length;
- queue = EMPTY;
-
- while (index < length) {
- character = value.charAt(index);
-
- if (character === test) {
- break;
- }
-
- if (character === C_NEWLINE) {
- index++;
- character = value.charAt(index);
-
- if (character === C_NEWLINE || character === test) {
- return;
- }
-
- queue += C_NEWLINE;
- }
-
- queue += character;
- index++;
- }
-
- character = value.charAt(index);
-
- if (character !== test) {
- return;
- }
-
- beforeTitle = subvalue;
- subvalue += queue + character;
- index++;
- title = queue;
- queue = EMPTY;
- }
-
- while (index < length) {
- character = value.charAt(index);
-
- if (character !== C_TAB && character !== C_SPACE) {
- break;
- }
-
- subvalue += character;
- index++;
- }
-
- character = value.charAt(index);
-
- if (!character || character === C_NEWLINE) {
- if (silent) {
- return true;
- }
-
- beforeURL = eat(beforeURL).test().end;
- url = self.decode.raw(self.descape(url), beforeURL);
-
- if (title) {
- beforeTitle = eat(beforeTitle).test().end;
- title = self.decode.raw(self.descape(title), beforeTitle);
- }
-
- return eat(subvalue)({
- 'type': T_DEFINITION,
- 'identifier': normalize(identifier),
- 'title': title || null,
- 'url': url
- });
- }
-}
-
-tokenizeDefinition.notInList = true;
-tokenizeDefinition.notInBlock = true;
-
-/**
- * Tokenise YAML front matter.
- *
- * @example
- * tokenizeYAMLFrontMatter(eat, '---\nfoo: bar\n---');
- *
- * @property {boolean} onlyAtStart
- * @param {function(string)} eat - Eater.
- * @param {string} value - Rest of content.
- * @param {boolean?} [silent] - Whether this is a dry run.
- * @return {Node?|boolean} - `yaml` node.
- */
-function tokenizeYAMLFrontMatter(eat, value, silent) {
- var self = this;
- var subvalue;
- var content;
- var index;
- var length;
- var character;
- var queue;
-
- if (
- !self.options.yaml ||
- value.charAt(0) !== C_DASH ||
- value.charAt(1) !== C_DASH ||
- value.charAt(2) !== C_DASH ||
- value.charAt(3) !== C_NEWLINE
- ) {
- return;
- }
-
- subvalue = YAML_FENCE + C_NEWLINE;
- content = queue = EMPTY;
- index = 3;
- length = value.length;
-
- while (++index < length) {
- character = value.charAt(index);
-
- if (
- character === C_DASH &&
- (queue || !content) &&
- value.charAt(index + 1) === C_DASH &&
- value.charAt(index + 2) === C_DASH
- ) {
- /* istanbul ignore if - never used (yet) */
- if (silent) {
- return true;
- }
-
- subvalue += queue + YAML_FENCE;
-
- return eat(subvalue)(self.renderRaw(T_YAML, content));
- }
-
- if (character === C_NEWLINE) {
- queue += character;
- } else {
- subvalue += queue + character;
- content += queue + character;
- queue = EMPTY;
- }
- }
-}
-
-tokenizeYAMLFrontMatter.onlyAtStart = true;
-
-/**
- * Tokenise a footnote definition.
- *
- * @example
- * tokenizeFootnoteDefinition(eat, '[^foo]: Bar.');
- *
- * @property {boolean} notInList
- * @property {boolean} notInBlock
- * @param {function(string)} eat - Eater.
- * @param {string} value - Rest of content.
- * @param {boolean?} [silent] - Whether this is a dry run.
- * @return {Node?|boolean} - `footnoteDefinition` node.
- */
-function tokenizeFootnoteDefinition(eat, value, silent) {
- var self = this;
- var index;
- var length;
- var subvalue;
- var now;
- var indent;
- var content;
- var queue;
- var subqueue;
- var character;
- var identifier;
-
- if (!self.options.footnotes) {
- return;
- }
-
- index = 0;
- length = value.length;
- subvalue = EMPTY;
- now = eat.now();
- indent = self.indent(now.line);
-
- while (index < length) {
- character = value.charAt(index);
-
- if (!isWhiteSpace(character)) {
- break;
- }
-
- subvalue += character;
- index++;
- }
-
- if (
- value.charAt(index) !== C_BRACKET_OPEN ||
- value.charAt(index + 1) !== C_CARET
- ) {
- return;
- }
-
- subvalue += C_BRACKET_OPEN + C_CARET;
- index = subvalue.length;
- queue = EMPTY;
-
- while (index < length) {
- character = value.charAt(index);
-
- if (character === C_BRACKET_CLOSE) {
- break;
- } else if (character === C_BACKSLASH) {
- queue += character;
- index++;
- character = value.charAt(index);
- }
-
- queue += character;
- index++;
- }
-
- if (
- !queue ||
- value.charAt(index) !== C_BRACKET_CLOSE ||
- value.charAt(index + 1) !== C_COLON
- ) {
- return;
- }
-
- if (silent) {
- return true;
- }
-
- identifier = normalize(queue);
- subvalue += queue + C_BRACKET_CLOSE + C_COLON;
- index = subvalue.length;
-
- while (index < length) {
- character = value.charAt(index);
-
- if (
- character !== C_TAB &&
- character !== C_SPACE
- ) {
- break;
- }
-
- subvalue += character;
- index++;
- }
-
- now.column += subvalue.length;
- now.offset += subvalue.length;
- queue = content = subqueue = EMPTY;
-
- while (index < length) {
- character = value.charAt(index);
-
- if (character === C_NEWLINE) {
- subqueue = character;
- index++;
-
- while (index < length) {
- character = value.charAt(index);
-
- if (character !== C_NEWLINE) {
- break;
- }
-
- subqueue += character;
- index++;
- }
-
- queue += subqueue;
- subqueue = EMPTY;
-
- while (index < length) {
- character = value.charAt(index);
-
- if (character !== C_SPACE) {
- break;
- }
-
- subqueue += character;
- index++;
- }
-
- if (!subqueue.length) {
- break;
- }
-
- queue += subqueue;
- }
-
- if (queue) {
- content += queue;
- queue = EMPTY;
- }
-
- content += character;
- index++;
- }
-
- subvalue += content;
-
- content = content.replace(EXPRESSION_INITIAL_TAB, function (line) {
- indent(line.length);
-
- return EMPTY;
- });
-
- return eat(subvalue)(
- self.renderFootnoteDefinition(identifier, content, now)
- );
-}
-
-tokenizeFootnoteDefinition.notInList = true;
-tokenizeFootnoteDefinition.notInBlock = true;
-
-/**
- * Tokenise a table.
- *
- * @example
- * tokenizeTable(eat, ' | foo |\n | --- |\n | bar |');
- *
- * @property {boolean} notInList
- * @param {function(string)} eat - Eater.
- * @param {string} value - Rest of content.
- * @param {boolean?} [silent] - Whether this is a dry run.
- * @return {Node?|boolean} - `table` node.
- */
-function tokenizeTable(eat, value, silent) {
- var self = this;
- var index;
- var alignments;
- var alignment;
- var subvalue;
- var row;
- var length;
- var lines;
- var queue;
- var character;
- var hasDash;
- var align;
- var cell;
- var preamble;
- var count;
- var opening;
- var now;
- var position;
- var lineCount;
- var line;
- var rows;
- var table;
- var lineIndex;
- var pipeIndex;
- var first;
-
- /*
- * Exit when not in gfm-mode.
- */
-
- if (!self.options.gfm) {
- return;
- }
-
- /*
- * Get the rows.
- * Detecting tables soon is hard, so there are some
- * checks for performance here, such as the minimum
- * number of rows, and allowed characters in the
- * alignment row.
- */
-
- index = lineCount = 0;
- length = value.length + 1;
- lines = [];
-
- while (index < length) {
- lineIndex = value.indexOf(C_NEWLINE, index);
- pipeIndex = value.indexOf(C_PIPE, index + 1);
-
- if (lineIndex === -1) {
- lineIndex = value.length;
- }
-
- if (
- pipeIndex === -1 ||
- pipeIndex > lineIndex
- ) {
- if (lineCount < MIN_TABLE_ROWS) {
- return;
- }
-
- break;
- }
-
- lines.push(value.slice(index, lineIndex));
- lineCount++;
- index = lineIndex + 1;
- }
-
- /*
- * Parse the alignment row.
- */
-
- subvalue = lines.join(C_NEWLINE);
- alignments = lines.splice(1, 1)[0] || [];
- index = 0;
- length = alignments.length;
- lineCount--;
- alignment = false;
- align = [];
-
- while (index < length) {
- character = alignments.charAt(index);
-
- if (character === C_PIPE) {
- hasDash = null;
-
- if (alignment === false) {
- if (first === false) {
- return;
- }
- } else {
- align.push(alignment);
- alignment = false;
- }
-
- first = false;
- } else if (character === C_DASH) {
- hasDash = true;
- alignment = alignment || TABLE_ALIGN_NONE;
- } else if (character === C_COLON) {
- if (alignment === TABLE_ALIGN_LEFT) {
- alignment = TABLE_ALIGN_CENTER;
- } else if (hasDash && alignment === TABLE_ALIGN_NONE) {
- alignment = TABLE_ALIGN_RIGHT;
- } else {
- alignment = TABLE_ALIGN_LEFT;
- }
- } else if (!isWhiteSpace(character)) {
- return;
- }
-
- index++;
- }
-
- if (alignment !== false) {
- align.push(alignment);
- }
-
- /*
- * Exit when without enough columns.
- */
-
- if (align.length < MIN_TABLE_COLUMNS) {
- return;
- }
-
- /* istanbul ignore if - never used (yet) */
- if (silent) {
- return true;
- }
-
- /*
- * Parse the rows.
- */
-
- position = -1;
- rows = [];
-
- table = eat(subvalue).reset({
- 'type': T_TABLE,
- 'align': align,
- 'children': rows
- });
-
- while (++position < lineCount) {
- line = lines[position];
- row = self.renderParent(position ? T_TABLE_ROW : T_TABLE_HEADER, []);
-
- /*
- * Eat a newline character when this is not the
- * first row.
- */
-
- if (position) {
- eat(C_NEWLINE);
- }
-
- /*
- * Eat the row.
- */
-
- eat(line).reset(row, table);
-
- length = line.length + 1;
- index = 0;
- queue = EMPTY;
- cell = EMPTY;
- preamble = true;
- count = opening = null;
-
- while (index < length) {
- character = line.charAt(index);
-
- if (character === C_TAB || character === C_SPACE) {
- if (cell) {
- queue += character;
- } else {
- eat(character);
- }
-
- index++;
- continue;
- }
-
- if (character === EMPTY || character === C_PIPE) {
- if (preamble) {
- eat(character);
- } else {
- if (character && opening) {
- queue += character;
- index++;
- continue;
- }
-
- if ((cell || character) && !preamble) {
- subvalue = cell;
-
- if (queue.length > 1) {
- if (character) {
- subvalue += queue.slice(0, queue.length - 1);
- queue = queue.charAt(queue.length - 1);
- } else {
- subvalue += queue;
- queue = EMPTY;
- }
- }
-
- now = eat.now();
-
- eat(subvalue)(
- self.renderInline(T_TABLE_CELL, cell, now), row
- );
- }
-
- eat(queue + character);
-
- queue = EMPTY;
- cell = EMPTY;
- }
- } else {
- if (queue) {
- cell += queue;
- queue = EMPTY;
- }
-
- cell += character;
-
- if (character === C_BACKSLASH && index !== length - 2) {
- cell += line.charAt(index + 1);
- index++;
- }
-
- if (character === C_TICK) {
- count = 1;
-
- while (line.charAt(index + 1) === character) {
- cell += character;
- index++;
- count++;
- }
-
- if (!opening) {
- opening = count;
- } else if (count >= opening) {
- opening = 0;
- }
- }
- }
-
- preamble = false;
- index++;
- }
-
- /*
- * Eat the alignment row.
- */
-
- if (!position) {
- eat(C_NEWLINE + alignments);
- }
- }
-
- return table;
-}
-
-tokenizeTable.notInList = true;
-
-/**
- * Tokenise a paragraph node.
- *
- * @example
- * tokenizeParagraph(eat, 'Foo.');
- *
- * @param {function(string)} eat - Eater.
- * @param {string} value - Rest of content.
- * @param {boolean?} [silent] - Whether this is a dry run.
- * @return {Node?|boolean} - `paragraph` node.
- */
-function tokenizeParagraph(eat, value, silent) {
- var self = this;
- var settings = self.options;
- var commonmark = settings.commonmark;
- var gfm = settings.gfm;
- var tokenizers = self.blockTokenizers;
- var index = value.indexOf(C_NEWLINE);
- var length = value.length;
- var position;
- var subvalue;
- var character;
- var size;
- var now;
-
- while (index < length) {
- /*
- * Eat everything if there’s no following newline.
- */
-
- if (index === -1) {
- index = length;
- break;
- }
-
- /*
- * Stop if the next character is NEWLINE.
- */
-
- if (value.charAt(index + 1) === C_NEWLINE) {
- break;
- }
-
- /*
- * In commonmark-mode, following indented lines
- * are part of the paragraph.
- */
-
- if (commonmark) {
- size = 0;
- position = index + 1;
-
- while (position < length) {
- character = value.charAt(position);
-
- if (character === C_TAB) {
- size = TAB_SIZE;
- break;
- } else if (character === C_SPACE) {
- size++;
- } else {
- break;
- }
-
- position++;
- }
-
- if (size >= TAB_SIZE) {
- index = value.indexOf(C_NEWLINE, index + 1);
- continue;
- }
- }
-
- /*
- * Check if the following code contains a possible
- * block.
- */
-
- subvalue = value.slice(index + 1);
-
- if (
- tokenizers.thematicBreak.call(self, eat, subvalue, true) ||
- tokenizers.atxHeading.call(self, eat, subvalue, true) ||
- tokenizers.fencedCode.call(self, eat, subvalue, true) ||
- tokenizers.blockquote.call(self, eat, subvalue, true) ||
- tokenizers.html.call(self, eat, subvalue, true)
- ) {
- break;
- }
-
- /*
- * Break if the following line starts a list, when
- * already in a list, or when in commonmark, or when
- * in gfm mode and the bullet is *not* numeric.
- */
-
- if (
- tokenizers.list.call(self, eat, subvalue, true) &&
- (
- self.inList ||
- commonmark ||
- (gfm && !isNumeric(trim.left(subvalue).charAt(0)))
- )
- ) {
- break;
- }
-
- if (
- !commonmark &&
- (
- tokenizers.setextHeading.call(self, eat, subvalue, true) ||
- tokenizers.definition.call(self, eat, subvalue, true) ||
- tokenizers.footnote.call(self, eat, subvalue, true)
- )
- ) {
- break;
- }
-
- position = index;
- index = value.indexOf(C_NEWLINE, index + 1);
-
- if (index !== -1 && trim(value.slice(position, index)) === EMPTY) {
- index = position;
- break;
- }
- }
-
- subvalue = value.slice(0, index);
-
- if (trim(subvalue) === EMPTY) {
- eat(subvalue);
-
- return null;
- }
-
- /* istanbul ignore if - never used (yet) */
- if (silent) {
- return true;
- }
-
- now = eat.now();
- subvalue = trimTrailingLines(subvalue);
-
- return eat(subvalue)(self.renderInline(T_PARAGRAPH, subvalue, now));
-}
-
-/**
- * Tokenise a text node.
- *
- * @example
- * tokenizeText(eat, 'foo');
- *
- * @param {function(string)} eat - Eater.
- * @param {string} value - Rest of content.
- * @param {boolean?} [silent] - Whether this is a dry run.
- * @return {Node?|boolean} - `text` node.
- */
-function tokenizeText(eat, value, silent) {
- var self = this;
- var methods;
- var tokenizers;
- var index;
- var length;
- var subvalue;
- var position;
- var tokenizer;
- var name;
- var min;
- var now;
-
- /* istanbul ignore if - never used (yet) */
- if (silent) {
- return true;
- }
-
- methods = self.inlineMethods;
- length = methods.length;
- tokenizers = self.inlineTokenizers;
- index = -1;
- min = value.length;
-
- while (++index < length) {
- name = methods[index];
-
- if (name === 'text' || !tokenizers[name]) {
- continue;
- }
-
- tokenizer = tokenizers[name].locator;
-
- if (!tokenizer) {
- eat.file.fail(ERR_MISSING_LOCATOR + C_TICK + name + C_TICK);
- continue;
- }
-
- position = tokenizer.call(self, value, 1);
-
- if (position !== -1 && position < min) {
- min = position;
- }
- }
-
- subvalue = value.slice(0, min);
- now = eat.now();
-
- self.decode(subvalue, now, function (content, position, source) {
- eat(source || content)(self.renderRaw(T_TEXT, content));
- });
-}
-
-/**
- * Create a code-block node.
- *
- * @example
- * renderCodeBlock('foo()', 'js', now());
- *
- * @param {string?} [value] - Code.
- * @param {string?} [language] - Optional language flag.
- * @param {Function} eat - Eater.
- * @return {Object} - `code` node.
- */
-function renderCodeBlock(value, language) {
- return {
- 'type': T_CODE,
- 'lang': language || null,
- 'value': trimTrailingLines(value || EMPTY)
- };
-}
-
-/**
- * Create a list-item using overly simple mechanics.
- *
- * @example
- * renderPedanticListItem('- _foo_', now());
- *
- * @param {string} value - List-item.
- * @param {Object} position - List-item location.
- * @return {string} - Cleaned `value`.
- */
-function renderPedanticListItem(value, position) {
- var self = this;
- var indent = self.indent(position.line);
-
- /**
- * A simple replacer which removed all matches,
- * and adds their length to `offset`.
- *
- * @param {string} $0 - Indentation to subtract.
- * @return {string} - An empty string.
- */
- function replacer($0) {
- indent($0.length);
-
- return EMPTY;
- }
-
- /*
- * Remove the list-item’s bullet.
- */
-
- value = value.replace(EXPRESSION_PEDANTIC_BULLET, replacer);
-
- /*
- * The initial line was also matched by the below, so
- * we reset the `line`.
- */
-
- indent = self.indent(position.line);
-
- return value.replace(EXPRESSION_INITIAL_INDENT, replacer);
-}
-
-/**
- * Create a list-item using sane mechanics.
- *
- * @example
- * renderNormalListItem('- _foo_', now());
- *
- * @param {string} value - List-item.
- * @param {Object} position - List-item location.
- * @return {string} - Cleaned `value`.
- */
-function renderNormalListItem(value, position) {
- var self = this;
- var indent = self.indent(position.line);
- var max;
- var bullet;
- var rest;
- var lines;
- var trimmedLines;
- var index;
- var length;
-
- /*
- * Remove the list-item’s bullet.
- */
-
- value = value.replace(EXPRESSION_BULLET, function ($0, $1, $2, $3, $4) {
- bullet = $1 + $2 + $3;
- rest = $4;
-
- /*
- * Make sure that the first nine numbered list items
- * can indent with an extra space. That is, when
- * the bullet did not receive an extra final space.
- */
-
- if (Number($2) < 10 && bullet.length % 2 === 1) {
- $2 = C_SPACE + $2;
- }
-
- max = $1 + repeat(C_SPACE, $2.length) + $3;
-
- return max + rest;
- });
-
- lines = value.split(C_NEWLINE);
-
- trimmedLines = removeIndentation(
- value, getIndent(max).indent
- ).split(C_NEWLINE);
-
- /*
- * We replaced the initial bullet with something
- * else above, which was used to trick
- * `removeIndentation` into removing some more
- * characters when possible. However, that could
- * result in the initial line to be stripped more
- * than it should be.
- */
-
- trimmedLines[0] = rest;
-
- indent(bullet.length);
-
- index = 0;
- length = lines.length;
-
- while (++index < length) {
- indent(lines[index].length - trimmedLines[index].length);
- }
-
- return trimmedLines.join(C_NEWLINE);
-}
-
-/**
- * Create a list-item node.
- *
- * @example
- * renderListItem('- _foo_', now());
- *
- * @param {Object} value - List-item.
- * @param {Object} position - List-item location.
- * @return {Object} - `listItem` node.
- */
-function renderListItem(value, position) {
- var self = this;
- var checked = null;
- var node;
- var task;
- var indent;
-
- value = LIST_ITEM_MAP[self.options.pedantic].apply(self, arguments);
-
- if (self.options.gfm) {
- task = value.match(EXPRESSION_TASK_ITEM);
-
- if (task) {
- indent = task[0].length;
- checked = task[1].toLowerCase() === C_X_LOWER;
-
- self.indent(position.line)(indent);
- value = value.slice(indent);
- }
- }
-
- node = {
- 'type': T_LIST_ITEM,
- 'loose': EXPRESSION_LOOSE_LIST_ITEM.test(value) ||
- value.charAt(value.length - 1) === C_NEWLINE,
- 'checked': checked
- };
-
- node.children = self.tokenizeBlock(value, position);
-
- return node;
-}
-
-/**
- * Create a footnote-definition node.
- *
- * @example
- * renderFootnoteDefinition('1', '_foo_', now());
- *
- * @param {string} identifier - Unique reference.
- * @param {string} value - Contents
- * @param {Object} position - Definition location.
- * @return {Object} - `footnoteDefinition` node.
- */
-function renderFootnoteDefinition(identifier, value, position) {
- var self = this;
- var exitBlockquote = self.enterBlock();
- var node;
-
- node = {
- 'type': T_FOOTNOTE_DEFINITION,
- 'identifier': identifier,
- 'children': self.tokenizeBlock(value, position)
- };
-
- exitBlockquote();
-
- return node;
-}
-
-/**
- * Create a heading node.
- *
- * @example
- * renderHeading('_foo_', 1, now());
- *
- * @param {string} value - Content.
- * @param {number} depth - Heading depth.
- * @param {Object} position - Heading content location.
- * @return {Object} - `heading` node
- */
-function renderHeading(value, depth, position) {
- return {
- 'type': T_HEADING,
- 'depth': depth,
- 'children': this.tokenizeInline(value, position)
- };
-}
-
-/**
- * Create a blockquote node.
- *
- * @example
- * renderBlockquote('_foo_', eat);
- *
- * @param {string} value - Content.
- * @param {Object} now - Position.
- * @return {Object} - `blockquote` node.
- */
-function renderBlockquote(value, now) {
- var self = this;
- var exitBlockquote = self.enterBlock();
- var node = {
- 'type': T_BLOCKQUOTE,
- 'children': self.tokenizeBlock(value, now)
- };
-
- exitBlockquote();
-
- return node;
-}
-
-/**
- * Create a void node.
- *
- * @example
- * renderVoid('thematicBreak');
- *
- * @param {string} type - Node type.
- * @return {Object} - Node of type `type`.
- */
-function renderVoid(type) {
- return {
- 'type': type
- };
-}
-
-/**
- * Create a parent.
- *
- * @example
- * renderParent('paragraph', '_foo_');
- *
- * @param {string} type - Node type.
- * @param {Array.<Object>} children - Child nodes.
- * @return {Object} - Node of type `type`.
- */
-function renderParent(type, children) {
- return {
- 'type': type,
- 'children': children
- };
-}
-
-/**
- * Create a raw node.
- *
- * @example
- * renderRaw('inlineCode', 'foo()');
- *
- * @param {string} type - Node type.
- * @param {string} value - Contents.
- * @return {Object} - Node of type `type`.
- */
-function renderRaw(type, value) {
- return {
- 'type': type,
- 'value': value
- };
-}
-
-/**
- * Create a link node.
- *
- * @example
- * renderLink(true, 'example.com', 'example', 'Example Domain', now(), eat);
- * renderLink(false, 'fav.ico', 'example', 'Example Domain', now(), eat);
- *
- * @param {boolean} isLink - Whether linking to a document
- * or an image.
- * @param {string} url - URI reference.
- * @param {string} content - Content.
- * @param {string?} title - Title.
- * @param {Object} position - Location of link.
- * @return {Object} - `link` or `image` node.
- */
-function renderLink(isLink, url, content, title, position) {
- var self = this;
- var exitLink = self.enterLink();
- var node;
-
- node = {
- 'type': isLink ? T_LINK : T_IMAGE,
- 'title': title || null
- };
-
- if (isLink) {
- node.url = url;
- node.children = self.tokenizeInline(content, position);
- } else {
- node.url = url;
- node.alt = content ?
- self.decode.raw(self.descape(content), position) :
- null;
- }
-
- exitLink();
-
- return node;
-}
-
-/**
- * Create a footnote node.
- *
- * @example
- * renderFootnote('_foo_', now());
- *
- * @param {string} value - Contents.
- * @param {Object} position - Location of footnote.
- * @return {Object} - `footnote` node.
- */
-function renderFootnote(value, position) {
- return this.renderInline(T_FOOTNOTE, value, position);
-}
-
-/**
- * Add a node with inline content.
- *
- * @example
- * renderInline('strong', '_foo_', now());
- *
- * @param {string} type - Node type.
- * @param {string} value - Contents.
- * @param {Object} position - Location of node.
- * @return {Object} - Node of type `type`.
- */
-function renderInline(type, value, position) {
- return this.renderParent(type, this.tokenizeInline(value, position));
-}
-
-/**
- * Add a node with block content.
- *
- * @example
- * renderBlock('blockquote', 'Foo.', now());
- *
- * @param {string} type - Node type.
- * @param {string} value - Contents.
- * @param {Object} position - Location of node.
- * @return {Object} - Node of type `type`.
- */
-function renderBlock(type, value, position) {
- return this.renderParent(type, this.tokenizeBlock(value, position));
-}
-
-/**
- * Find a possible escape sequence.
- *
- * @example
- * locateEscape('foo \- bar'); // 4
- *
- * @param {string} value - Value to search.
- * @param {number} fromIndex - Index to start searching at.
- * @return {number} - Location of possible escape sequence.
- */
-function locateEscape(value, fromIndex) {
- return value.indexOf(C_BACKSLASH, fromIndex);
-}
-
-/**
- * Tokenise an escape sequence.
- *
- * @example
- * tokenizeEscape(eat, '\\a');
- *
- * @property {Function} locator - Escape locator.
- * @param {function(string)} eat - Eater.
- * @param {string} value - Rest of content.
- * @param {boolean?} [silent] - Whether this is a dry run.
- * @return {Node?|boolean} - `text` or `break` node.
- */
-function tokenizeEscape(eat, value, silent) {
- var self = this;
- var character;
-
- if (value.charAt(0) === C_BACKSLASH) {
- character = value.charAt(1);
-
- if (self.escape.indexOf(character) !== -1) {
- /* istanbul ignore if - never used (yet) */
- if (silent) {
- return true;
- }
-
- return eat(C_BACKSLASH + character)(
- character === C_NEWLINE ?
- self.renderVoid(T_BREAK) :
- self.renderRaw(T_TEXT, character)
- );
- }
- }
-}
-
-tokenizeEscape.locator = locateEscape;
-
-/**
- * Find a possible auto-link.
- *
- * @example
- * locateAutoLink('foo <bar'); // 4
- *
- * @param {string} value - Value to search.
- * @param {number} fromIndex - Index to start searching at.
- * @return {number} - Location of possible auto-link.
- */
-function locateAutoLink(value, fromIndex) {
- return value.indexOf(C_LT, fromIndex);
-}
-
-/**
- * Tokenise a URL in carets.
- *
- * @example
- * tokenizeAutoLink(eat, '<http://foo.bar>');
- *
- * @property {boolean} notInLink
- * @property {Function} locator - Auto-link locator.
- * @param {function(string)} eat - Eater.
- * @param {string} value - Rest of content.
- * @param {boolean?} [silent] - Whether this is a dry run.
- * @return {Node?|boolean} - `link` node.
- */
-function tokenizeAutoLink(eat, value, silent) {
- var self;
- var subvalue;
- var length;
- var index;
- var queue;
- var character;
- var hasAtCharacter;
- var link;
- var now;
- var content;
- var tokenize;
- var node;
-
- if (value.charAt(0) !== C_LT) {
- return;
- }
-
- self = this;
- subvalue = EMPTY;
- length = value.length;
- index = 0;
- queue = EMPTY;
- hasAtCharacter = false;
- link = EMPTY;
-
- index++;
- subvalue = C_LT;
-
- while (index < length) {
- character = value.charAt(index);
-
- if (
- character === C_SPACE ||
- character === C_GT ||
- character === C_AT_SIGN ||
- (character === C_COLON && value.charAt(index + 1) === C_SLASH)
- ) {
- break;
- }
-
- queue += character;
- index++;
- }
-
- if (!queue) {
- return;
- }
-
- link += queue;
- queue = EMPTY;
-
- character = value.charAt(index);
- link += character;
- index++;
-
- if (character === C_AT_SIGN) {
- hasAtCharacter = true;
- } else {
- if (
- character !== C_COLON ||
- value.charAt(index + 1) !== C_SLASH
- ) {
- return;
- }
-
- link += C_SLASH;
- index++;
- }
-
- while (index < length) {
- character = value.charAt(index);
-
- if (character === C_SPACE || character === C_GT) {
- break;
- }
-
- queue += character;
- index++;
- }
-
- character = value.charAt(index);
-
- if (!queue || character !== C_GT) {
- return;
- }
-
- /* istanbul ignore if - never used (yet) */
- if (silent) {
- return true;
- }
-
- link += queue;
- content = link;
- subvalue += link + character;
- now = eat.now();
- now.column++;
- now.offset++;
-
- if (hasAtCharacter) {
- if (
- link.substr(0, MAILTO_PROTOCOL.length).toLowerCase() !==
- MAILTO_PROTOCOL
- ) {
- link = MAILTO_PROTOCOL + link;
- } else {
- content = content.substr(MAILTO_PROTOCOL.length);
- now.column += MAILTO_PROTOCOL.length;
- now.offset += MAILTO_PROTOCOL.length;
- }
- }
-
- /*
- * Temporarily remove support for escapes in autolinks.
- */
-
- tokenize = self.inlineTokenizers.escape;
- self.inlineTokenizers.escape = null;
-
- node = eat(subvalue)(
- self.renderLink(true, decode(link), content, null, now, eat)
- );
-
- self.inlineTokenizers.escape = tokenize;
-
- return node;
-}
-
-tokenizeAutoLink.notInLink = true;
-tokenizeAutoLink.locator = locateAutoLink;
-
-/**
- * Find a possible URL.
- *
- * @example
- * locateURL('foo http://bar'); // 4
- *
- * @param {string} value - Value to search.
- * @param {number} fromIndex - Index to start searching at.
- * @return {number} - Location of possible URL.
- */
-function locateURL(value, fromIndex) {
- var index = -1;
- var min = -1;
- var position;
-
- if (!this.options.gfm) {
- return -1;
- }
-
- while (++index < PROTOCOLS_LENGTH) {
- position = value.indexOf(PROTOCOLS[index], fromIndex);
-
- if (position !== -1 && (position < min || min === -1)) {
- min = position;
- }
- }
-
- return min;
-}
-
-/**
- * Tokenise a URL in text.
- *
- * @example
- * tokenizeURL(eat, 'http://foo.bar');
- *
- * @property {boolean} notInLink
- * @property {Function} locator - URL locator.
- * @param {function(string)} eat - Eater.
- * @param {string} value - Rest of content.
- * @param {boolean?} [silent] - Whether this is a dry run.
- * @return {Node?|boolean} - `link` node.
- */
-function tokenizeURL(eat, value, silent) {
- var self = this;
- var subvalue;
- var content;
- var character;
- var index;
- var position;
- var protocol;
- var match;
- var length;
- var queue;
- var parenCount;
- var nextCharacter;
- var now;
-
- if (!self.options.gfm) {
- return;
- }
-
- subvalue = EMPTY;
- index = -1;
- length = PROTOCOLS_LENGTH;
-
- while (++index < length) {
- protocol = PROTOCOLS[index];
- match = value.slice(0, protocol.length);
-
- if (match.toLowerCase() === protocol) {
- subvalue = match;
- break;
- }
- }
-
- if (!subvalue) {
- return;
- }
-
- index = subvalue.length;
- length = value.length;
- queue = EMPTY;
- parenCount = 0;
-
- while (index < length) {
- character = value.charAt(index);
-
- if (isWhiteSpace(character) || character === C_LT) {
- break;
- }
-
- if (
- character === C_DOT ||
- character === C_COMMA ||
- character === C_COLON ||
- character === C_SEMI_COLON ||
- character === C_DOUBLE_QUOTE ||
- character === C_SINGLE_QUOTE ||
- character === C_PAREN_CLOSE ||
- character === C_BRACKET_CLOSE
- ) {
- nextCharacter = value.charAt(index + 1);
-
- if (
- !nextCharacter ||
- isWhiteSpace(nextCharacter)
- ) {
- break;
- }
- }
-
- if (
- character === C_PAREN_OPEN ||
- character === C_BRACKET_OPEN
- ) {
- parenCount++;
- }
-
- if (
- character === C_PAREN_CLOSE ||
- character === C_BRACKET_CLOSE
- ) {
- parenCount--;
-
- if (parenCount < 0) {
- break;
- }
- }
-
- queue += character;
- index++;
- }
-
- if (!queue) {
- return;
- }
-
- subvalue += queue;
- content = subvalue;
-
- if (protocol === MAILTO_PROTOCOL) {
- position = queue.indexOf(C_AT_SIGN);
-
- if (position === -1 || position === length - 1) {
- return;
- }
-
- content = content.substr(MAILTO_PROTOCOL.length);
- }
-
- /* istanbul ignore if - never used (yet) */
- if (silent) {
- return true;
- }
-
- now = eat.now();
-
- return eat(subvalue)(
- self.renderLink(true, decode(subvalue), content, null, now, eat)
- );
-}
-
-tokenizeURL.notInLink = true;
-tokenizeURL.locator = locateURL;
-
-/**
- * Find a possible tag.
- *
- * @example
- * locateTag('foo <bar'); // 4
- *
- * @param {string} value - Value to search.
- * @param {number} fromIndex - Index to start searching at.
- * @return {number} - Location of possible tag.
- */
-function locateTag(value, fromIndex) {
- return value.indexOf(C_LT, fromIndex);
-}
-
-/**
- * Tokenise an HTML tag.
- *
- * @example
- * tokenizeInlineHTML(eat, '<span foo="bar">');
- *
- * @property {Function} locator - Tag locator.
- * @param {function(string)} eat - Eater.
- * @param {string} value - Rest of content.
- * @param {boolean?} [silent] - Whether this is a dry run.
- * @return {Node?|boolean} - `html` node.
- */
-function tokenizeInlineHTML(eat, value, silent) {
- var self = this;
- var subvalue = eatHTMLComment(value, self.options) ||
- eatHTMLCDATA(value) ||
- eatHTMLProcessingInstruction(value) ||
- eatHTMLDeclaration(value) ||
- eatHTMLClosingTag(value) ||
- eatHTMLOpeningTag(value);
-
- if (!subvalue) {
- return;
- }
-
- /* istanbul ignore if - never used (yet) */
- if (silent) {
- return true;
- }
-
- if (!self.inLink && EXPRESSION_HTML_LINK_OPEN.test(subvalue)) {
- self.inLink = true;
- } else if (self.inLink && EXPRESSION_HTML_LINK_CLOSE.test(subvalue)) {
- self.inLink = false;
- }
-
- return eat(subvalue)(self.renderRaw(T_HTML, subvalue));
-}
-
-tokenizeInlineHTML.locator = locateTag;
-
-/**
- * Find a possible link.
- *
- * @example
- * locateLink('foo ![bar'); // 4
- *
- * @param {string} value - Value to search.
- * @param {number} fromIndex - Index to start searching at.
- * @return {number} - Location of possible link.
- */
-function locateLink(value, fromIndex) {
- var link = value.indexOf(C_BRACKET_OPEN, fromIndex);
- var image = value.indexOf(C_EXCLAMATION_MARK + C_BRACKET_OPEN, fromIndex);
-
- if (image === -1) {
- return link;
- }
-
- /*
- * Link can never be `-1` if an image is found, so we don’t need to
- * check for that :)
- */
-
- return link < image ? link : image;
-}
-
-/**
- * Tokenise a link.
- *
- * @example
- * tokenizeLink(eat, '![foo](fav.ico "Favicon"));
- *
- * @property {Function} locator - Link locator.
- * @param {function(string)} eat - Eater.
- * @param {string} value - Rest of content.
- * @param {boolean?} [silent] - Whether this is a dry run.
- * @return {Node?|boolean} - `link` or `image` node.
- */
-function tokenizeLink(eat, value, silent) {
- var self = this;
- var subvalue = EMPTY;
- var index = 0;
- var character = value.charAt(0);
- var commonmark = self.options.commonmark;
- var gfm = self.options.gfm;
- var closed;
- var count;
- var opening;
- var beforeURL;
- var beforeTitle;
- var subqueue;
- var openCount;
- var hasMarker;
- var markers;
- var isImage;
- var content;
- var marker;
- var length;
- var title;
- var depth;
- var queue;
- var url;
- var now;
-
- /*
- * Detect whether this is an image.
- */
-
- if (character === C_EXCLAMATION_MARK) {
- isImage = true;
- subvalue = character;
- character = value.charAt(++index);
- }
-
- /*
- * Eat the opening.
- */
-
- if (character !== C_BRACKET_OPEN) {
- return;
- }
-
- /*
- * Exit when this is a link and we’re already inside
- * a link.
- */
-
- if (!isImage && self.inLink) {
- return;
- }
-
- subvalue += character;
- queue = EMPTY;
- index++;
-
- /*
- * Eat the content.
- */
-
- length = value.length;
- now = eat.now();
- depth = 0;
-
- now.column += index;
- now.offset += index;
-
- while (index < length) {
- subqueue = character = value.charAt(index);
-
- if (character === C_TICK) {
- /* Inline-code in link content. */
- count = 1;
-
- while (value.charAt(index + 1) === C_TICK) {
- subqueue += character;
- index++;
- count++;
- }
-
- if (!opening) {
- opening = count;
- } else if (count >= opening) {
- opening = 0;
- }
- } else if (character === C_BACKSLASH) {
- /* Allow brackets to be escaped. */
- index++;
- subqueue += value.charAt(index);
- /* In GFM mode, brackets in code still count.
- * In all other modes, they don’t. This empty
- * block prevents the next statements are
- * entered. */
- } else if ((!opening || gfm) && character === C_BRACKET_OPEN) {
- depth++;
- } else if ((!opening || gfm) && character === C_BRACKET_CLOSE) {
- if (depth) {
- depth--;
- } else {
- /* Allow white-space between content and
- * url in GFM mode. */
- if (gfm) {
- while (index < length) {
- character = value.charAt(index + 1);
-
- if (!isWhiteSpace(character)) {
- break;
- }
-
- subqueue += character;
- index++;
- }
- }
-
- if (value.charAt(index + 1) !== C_PAREN_OPEN) {
- return;
- }
-
- subqueue += C_PAREN_OPEN;
- closed = true;
- index++;
-
- break;
- }
- }
-
- queue += subqueue;
- subqueue = EMPTY;
- index++;
- }
-
- /* Eat the content closing. */
- if (!closed) {
- return;
- }
-
- content = queue;
- subvalue += queue + subqueue;
- index++;
-
- /*
- * Eat white-space.
- */
-
- while (index < length) {
- character = value.charAt(index);
-
- if (!isWhiteSpace(character)) {
- break;
- }
-
- subvalue += character;
- index++;
- }
-
- /*
- * Eat the URL.
- */
-
- character = value.charAt(index);
- markers = commonmark ? COMMONMARK_LINK_MARKERS : LINK_MARKERS;
- openCount = 0;
- queue = EMPTY;
- beforeURL = subvalue;
-
- if (character === C_LT) {
- index++;
- beforeURL += C_LT;
-
- while (index < length) {
- character = value.charAt(index);
-
- if (character === C_GT) {
- break;
- }
-
- if (commonmark && character === C_NEWLINE) {
- return;
- }
-
- queue += character;
- index++;
- }
-
- if (value.charAt(index) !== C_GT) {
- return;
- }
-
- subvalue += C_LT + queue + C_GT;
- url = queue;
- index++;
- } else {
- character = null;
- subqueue = EMPTY;
-
- while (index < length) {
- character = value.charAt(index);
-
- if (subqueue && has.call(markers, character)) {
- break;
- }
-
- if (isWhiteSpace(character)) {
- if (commonmark) {
- break;
- }
-
- subqueue += character;
- } else {
- if (character === C_PAREN_OPEN) {
- depth++;
- openCount++;
- } else if (character === C_PAREN_CLOSE) {
- if (depth === 0) {
- break;
- }
-
- depth--;
- }
-
- queue += subqueue;
- subqueue = EMPTY;
-
- if (character === C_BACKSLASH) {
- queue += C_BACKSLASH;
- character = value.charAt(++index);
- }
-
- queue += character;
- }
-
- index++;
- }
-
- subvalue += queue;
- url = queue;
- index = subvalue.length;
- }
-
- /*
- * Eat white-space.
- */
-
- queue = EMPTY;
-
- while (index < length) {
- character = value.charAt(index);
-
- if (!isWhiteSpace(character)) {
- break;
- }
-
- queue += character;
- index++;
- }
-
- character = value.charAt(index);
- subvalue += queue;
-
- /*
- * Eat the title.
- */
-
- if (queue && has.call(markers, character)) {
- index++;
- subvalue += character;
- queue = EMPTY;
- marker = markers[character];
- beforeTitle = subvalue;
-
- /*
- * In commonmark-mode, things are pretty easy: the
- * marker cannot occur inside the title.
- *
- * Non-commonmark does, however, support nested
- * delimiters.
- */
-
- if (commonmark) {
- while (index < length) {
- character = value.charAt(index);
-
- if (character === marker) {
- break;
- }
-
- if (character === C_BACKSLASH) {
- queue += C_BACKSLASH;
- character = value.charAt(++index);
- }
-
- index++;
- queue += character;
- }
-
- character = value.charAt(index);
-
- if (character !== marker) {
- return;
- }
-
- title = queue;
- subvalue += queue + character;
- index++;
-
- while (index < length) {
- character = value.charAt(index);
-
- if (!isWhiteSpace(character)) {
- break;
- }
-
- subvalue += character;
- index++;
- }
- } else {
- subqueue = EMPTY;
-
- while (index < length) {
- character = value.charAt(index);
-
- if (character === marker) {
- if (hasMarker) {
- queue += marker + subqueue;
- subqueue = EMPTY;
- }
-
- hasMarker = true;
- } else if (!hasMarker) {
- queue += character;
- } else if (character === C_PAREN_CLOSE) {
- subvalue += queue + marker + subqueue;
- title = queue;
- break;
- } else if (isWhiteSpace(character)) {
- subqueue += character;
- } else {
- queue += marker + subqueue + character;
- subqueue = EMPTY;
- hasMarker = false;
- }
-
- index++;
- }
- }
- }
-
- if (value.charAt(index) !== C_PAREN_CLOSE) {
- return;
- }
-
- /* istanbul ignore if - never used (yet) */
- if (silent) {
- return true;
- }
-
- subvalue += C_PAREN_CLOSE;
-
- url = self.decode.raw(self.descape(url), eat(beforeURL).test().end);
-
- if (title) {
- beforeTitle = eat(beforeTitle).test().end;
- title = self.decode.raw(self.descape(title), beforeTitle);
- }
-
- return eat(subvalue)(
- self.renderLink(!isImage, url, content, title, now, eat)
- );
-}
-
-tokenizeLink.locator = locateLink;
-
-/**
- * Tokenise a reference link, image, or footnote;
- * shortcut reference link, or footnote.
- *
- * @example
- * tokenizeReference(eat, '[foo]');
- * tokenizeReference(eat, '[foo][]');
- * tokenizeReference(eat, '[foo][bar]');
- *
- * @property {Function} locator - Reference locator.
- * @param {function(string)} eat - Eater.
- * @param {string} value - Rest of content.
- * @param {boolean?} [silent] - Whether this is a dry run.
- * @return {Node?|boolean} - Reference node.
- */
-function tokenizeReference(eat, value, silent) {
- var self = this;
- var character = value.charAt(0);
- var index = 0;
- var length = value.length;
- var subvalue = EMPTY;
- var intro = EMPTY;
- var type = T_LINK;
- var referenceType = REFERENCE_TYPE_SHORTCUT;
- var content;
- var identifier;
- var now;
- var node;
- var exitLink;
- var queue;
- var bracketed;
- var depth;
-
- /*
- * Check whether we’re eating an image.
- */
-
- if (character === C_EXCLAMATION_MARK) {
- type = T_IMAGE;
- intro = character;
- character = value.charAt(++index);
- }
-
- if (character !== C_BRACKET_OPEN) {
- return;
- }
-
- index++;
- intro += character;
- queue = EMPTY;
-
- /*
- * Check whether we’re eating a footnote.
- */
-
- if (
- self.options.footnotes &&
- type === T_LINK &&
- value.charAt(index) === C_CARET
- ) {
- intro += C_CARET;
- index++;
- type = T_FOOTNOTE;
- }
-
- /*
- * Eat the text.
- */
-
- depth = 0;
-
- while (index < length) {
- character = value.charAt(index);
-
- if (character === C_BRACKET_OPEN) {
- bracketed = true;
- depth++;
- } else if (character === C_BRACKET_CLOSE) {
- if (!depth) {
- break;
- }
-
- depth--;
- }
-
- if (character === C_BACKSLASH) {
- queue += C_BACKSLASH;
- character = value.charAt(++index);
- }
-
- queue += character;
- index++;
- }
-
- subvalue = content = queue;
- character = value.charAt(index);
-
- if (character !== C_BRACKET_CLOSE) {
- return;
- }
-
- index++;
- subvalue += character;
- queue = EMPTY;
-
- while (index < length) {
- character = value.charAt(index);
-
- if (!isWhiteSpace(character)) {
- break;
- }
-
- queue += character;
- index++;
- }
-
- character = value.charAt(index);
-
- if (character !== C_BRACKET_OPEN) {
- if (!content) {
- return;
- }
-
- identifier = content;
- } else {
- identifier = EMPTY;
- queue += character;
- index++;
-
- while (index < length) {
- character = value.charAt(index);
-
- if (
- character === C_BRACKET_OPEN ||
- character === C_BRACKET_CLOSE
- ) {
- break;
- }
-
- if (character === C_BACKSLASH) {
- identifier += C_BACKSLASH;
- character = value.charAt(++index);
- }
-
- identifier += character;
- index++;
- }
-
- character = value.charAt(index);
-
- if (character === C_BRACKET_CLOSE) {
- queue += identifier + character;
- index++;
-
- referenceType = identifier ?
- REFERENCE_TYPE_FULL :
- REFERENCE_TYPE_COLLAPSED;
- } else {
- identifier = EMPTY;
- }
-
- subvalue += queue;
- queue = EMPTY;
- }
-
- /*
- * Brackets cannot be inside the identifier.
- */
-
- if (referenceType !== REFERENCE_TYPE_FULL && bracketed) {
- return;
- }
-
- /*
- * Inline footnotes cannot have an identifier.
- */
-
- if (type === T_FOOTNOTE && referenceType !== REFERENCE_TYPE_SHORTCUT) {
- type = T_LINK;
- intro = C_BRACKET_OPEN + C_CARET;
- content = C_CARET + content;
- }
-
- subvalue = intro + subvalue;
-
- if (type === T_LINK && self.inLink) {
- return null;
- }
-
- /* istanbul ignore if - never used (yet) */
- if (silent) {
- return true;
- }
-
- if (type === T_FOOTNOTE && content.indexOf(C_SPACE) !== -1) {
- return eat(subvalue)(self.renderFootnote(content, eat.now()));
- }
-
- now = eat.now();
- now.column += intro.length;
- now.offset += intro.length;
- identifier = referenceType === REFERENCE_TYPE_FULL ? identifier : content;
-
- node = {
- 'type': type + 'Reference',
- 'identifier': normalize(identifier)
- };
-
- if (type === T_LINK || type === T_IMAGE) {
- node.referenceType = referenceType;
- }
-
- if (type === T_LINK) {
- exitLink = self.enterLink();
- node.children = self.tokenizeInline(content, now);
- exitLink();
- } else if (type === T_IMAGE) {
- node.alt = self.decode.raw(self.descape(content), now) || null;
- }
-
- return eat(subvalue)(node);
-}
-
-tokenizeReference.locator = locateLink;
-
-/**
- * Find a possible strong emphasis.
- *
- * @example
- * locateStrong('foo **bar'); // 4
- *
- * @param {string} value - Value to search.
- * @param {number} fromIndex - Index to start searching at.
- * @return {number} - Location of possible strong emphasis.
- */
-function locateStrong(value, fromIndex) {
- var asterisk = value.indexOf(C_ASTERISK + C_ASTERISK, fromIndex);
- var underscore = value.indexOf(C_UNDERSCORE + C_UNDERSCORE, fromIndex);
-
- if (underscore === -1) {
- return asterisk;
- }
-
- if (asterisk === -1) {
- return underscore;
- }
-
- return underscore < asterisk ? underscore : asterisk;
-}
-
-/**
- * Tokenise strong emphasis.
+/* Nodes that can interupt a list:
*
- * @example
- * tokenizeStrong(eat, '**foo**');
- * tokenizeStrong(eat, '__foo__');
+ * ```markdown
+ * - One
+ * ___
+ * ```
*
- * @property {Function} locator - Strong emphasis locator.
- * @param {function(string)} eat - Eater.
- * @param {string} value - Rest of content.
- * @param {boolean?} [silent] - Whether this is a dry run.
- * @return {Node?|boolean} - `strong` node.
- */
-function tokenizeStrong(eat, value, silent) {
- var self = this;
- var index = 0;
- var character = value.charAt(index);
- var now;
- var pedantic;
- var marker;
- var queue;
- var subvalue;
- var length;
- var prev;
-
- if (
- EMPHASIS_MARKERS[character] !== true ||
- value.charAt(++index) !== character
- ) {
- return;
- }
-
- pedantic = self.options.pedantic;
- marker = character;
- subvalue = marker + marker;
- length = value.length;
- index++;
- queue = character = EMPTY;
-
- if (pedantic && isWhiteSpace(value.charAt(index))) {
- return;
- }
-
- while (index < length) {
- prev = character;
- character = value.charAt(index);
-
- if (
- character === marker &&
- value.charAt(index + 1) === marker &&
- (!pedantic || !isWhiteSpace(prev))
- ) {
- character = value.charAt(index + 2);
-
- if (character !== marker) {
- if (!trim(queue)) {
- return;
- }
-
- /* istanbul ignore if - never used (yet) */
- if (silent) {
- return true;
- }
-
- now = eat.now();
- now.column += 2;
- now.offset += 2;
-
- return eat(subvalue + queue + subvalue)(
- self.renderInline(T_STRONG, queue, now)
- );
- }
- }
-
- if (!pedantic && character === C_BACKSLASH) {
- queue += character;
- character = value.charAt(++index);
- }
-
- queue += character;
- index++;
- }
-}
-
-tokenizeStrong.locator = locateStrong;
-
-/**
- * Find possible slight emphasis.
- *
- * @example
- * locateEmphasis('foo *bar'); // 4
- *
- * @param {string} value - Value to search.
- * @param {number} fromIndex - Index to start searching at.
- * @return {number} - Location of possible slight emphasis.
- */
-function locateEmphasis(value, fromIndex) {
- var asterisk = value.indexOf(C_ASTERISK, fromIndex);
- var underscore = value.indexOf(C_UNDERSCORE, fromIndex);
-
- if (underscore === -1) {
- return asterisk;
- }
-
- if (asterisk === -1) {
- return underscore;
- }
-
- return underscore < asterisk ? underscore : asterisk;
-}
-
-/**
- * Tokenise slight emphasis.
- *
- * @example
- * tokenizeEmphasis(eat, '*foo*');
- * tokenizeEmphasis(eat, '_foo_');
- *
- * @property {Function} locator - Slight emphasis locator.
- * @param {function(string)} eat - Eater.
- * @param {string} value - Rest of content.
- * @param {boolean?} [silent] - Whether this is a dry run.
- * @return {Node?|boolean} - `emphasis` node.
- */
-function tokenizeEmphasis(eat, value, silent) {
- var self = this;
- var index = 0;
- var character = value.charAt(index);
- var now;
- var pedantic;
- var marker;
- var queue;
- var subvalue;
- var length;
- var prev;
-
- if (EMPHASIS_MARKERS[character] !== true) {
- return;
- }
-
- pedantic = self.options.pedantic;
- subvalue = marker = character;
- length = value.length;
- index++;
- queue = character = EMPTY;
-
- if (pedantic && isWhiteSpace(value.charAt(index))) {
- return;
- }
-
- while (index < length) {
- prev = character;
- character = value.charAt(index);
-
- if (
- character === marker &&
- (!pedantic || !isWhiteSpace(prev))
- ) {
- character = value.charAt(++index);
-
- if (character !== marker) {
- if (!trim(queue) || prev === marker) {
- return;
- }
-
- if (
- pedantic ||
- marker !== C_UNDERSCORE ||
- !isWordCharacter(character)
- ) {
- /* istanbul ignore if - never used (yet) */
- if (silent) {
- return true;
- }
-
- now = eat.now();
- now.column++;
- now.offset++;
-
- return eat(subvalue + queue + marker)(
- self.renderInline(T_EMPHASIS, queue, now)
- );
- }
- }
-
- queue += marker;
- }
-
- if (!pedantic && character === C_BACKSLASH) {
- queue += character;
- character = value.charAt(++index);
- }
-
- queue += character;
- index++;
- }
-}
-
-tokenizeEmphasis.locator = locateEmphasis;
-
-/**
- * Find a possible deletion.
- *
- * @example
- * locateDeletion('foo ~~bar'); // 4
- *
- * @param {string} value - Value to search.
- * @param {number} fromIndex - Index to start searching at.
- * @return {number} - Location of possible deletion.
- */
-function locateDeletion(value, fromIndex) {
- return value.indexOf(C_TILDE + C_TILDE, fromIndex);
-}
-
-/**
- * Tokenise a deletion.
- *
- * @example
- * tokenizeDeletion(eat, '~~foo~~');
- *
- * @property {Function} locator - Deletion locator.
- * @param {function(string)} eat - Eater.
- * @param {string} value - Rest of content.
- * @param {boolean?} [silent] - Whether this is a dry run.
- * @return {Node?|boolean} - `delete` node.
- */
-function tokenizeDeletion(eat, value, silent) {
- var self = this;
- var character = EMPTY;
- var previous = EMPTY;
- var preceding = EMPTY;
- var subvalue = EMPTY;
- var index;
- var length;
- var now;
-
- if (
- !self.options.gfm ||
- value.charAt(0) !== C_TILDE ||
- value.charAt(1) !== C_TILDE ||
- isWhiteSpace(value.charAt(2))
- ) {
- return;
- }
-
- index = 1;
- length = value.length;
- now = eat.now();
- now.column += 2;
- now.offset += 2;
-
- while (++index < length) {
- character = value.charAt(index);
-
- if (
- character === C_TILDE &&
- previous === C_TILDE &&
- (!preceding || !isWhiteSpace(preceding))
- ) {
- /* istanbul ignore if - never used (yet) */
- if (silent) {
- return true;
- }
-
- return eat(C_TILDE + C_TILDE + subvalue + C_TILDE + C_TILDE)(
- self.renderInline(T_DELETE, subvalue, now)
- );
- }
-
- subvalue += previous;
- preceding = previous;
- previous = character;
- }
-}
-
-tokenizeDeletion.locator = locateDeletion;
-
-/**
- * Find possible inline code.
- *
- * @example
- * locateInlineCode('foo `bar'); // 4
- *
- * @param {string} value - Value to search.
- * @param {number} fromIndex - Index to start searching at.
- * @return {number} - Location of possible inline code.
- */
-function locateInlineCode(value, fromIndex) {
- return value.indexOf(C_TICK, fromIndex);
-}
-
-/**
- * Tokenise inline code.
- *
- * @example
- * tokenizeInlineCode(eat, '`foo()`');
- *
- * @property {Function} locator - Inline code locator.
- * @param {function(string)} eat - Eater.
- * @param {string} value - Rest of content.
- * @param {boolean?} [silent] - Whether this is a dry run.
- * @return {Node?|boolean} - `inlineCode` node.
- */
-function tokenizeInlineCode(eat, value, silent) {
- var self = this;
- var length = value.length;
- var index = 0;
- var queue = EMPTY;
- var tickQueue = EMPTY;
- var contentQueue;
- var subqueue;
- var count;
- var openingCount;
- var subvalue;
- var character;
- var found;
- var next;
-
- while (index < length) {
- if (value.charAt(index) !== C_TICK) {
- break;
- }
-
- queue += C_TICK;
- index++;
- }
-
- if (!queue) {
- return;
- }
-
- subvalue = queue;
- openingCount = index;
- queue = EMPTY;
- next = value.charAt(index);
- count = 0;
-
- while (index < length) {
- character = next;
- next = value.charAt(index + 1);
-
- if (character === C_TICK) {
- count++;
- tickQueue += character;
- } else {
- count = 0;
- queue += character;
- }
-
- if (count && next !== C_TICK) {
- if (count === openingCount) {
- subvalue += queue + tickQueue;
- found = true;
- break;
- }
-
- queue += tickQueue;
- tickQueue = EMPTY;
- }
-
- index++;
- }
-
- if (!found) {
- if (openingCount % 2 !== 0) {
- return;
- }
-
- queue = EMPTY;
- }
-
- /* istanbul ignore if - never used (yet) */
- if (silent) {
- return true;
- }
-
- contentQueue = subqueue = EMPTY;
- length = queue.length;
- index = -1;
-
- while (++index < length) {
- character = queue.charAt(index);
-
- if (isWhiteSpace(character)) {
- subqueue += character;
- continue;
- }
-
- if (subqueue) {
- if (contentQueue) {
- contentQueue += subqueue;
- }
-
- subqueue = EMPTY;
- }
-
- contentQueue += character;
- }
-
- return eat(subvalue)(self.renderRaw(T_INLINE_CODE, contentQueue));
-}
-
-tokenizeInlineCode.locator = locateInlineCode;
-
-/**
- * Find a possible break.
- *
- * @example
- * locateBreak('foo \nbar'); // 3
- *
- * @param {string} value - Value to search.
- * @param {number} fromIndex - Index to start searching at.
- * @return {number} - Location of possible break.
- */
-function locateBreak(value, fromIndex) {
- var index = value.indexOf(C_NEWLINE, fromIndex);
-
- while (index > fromIndex) {
- if (value.charAt(index - 1) !== C_SPACE) {
- break;
- }
-
- index--;
- }
-
- return index;
-}
-
-/**
- * Tokenise a break.
- *
- * @example
- * tokenizeBreak(eat, ' \n');
- *
- * @property {Function} locator - Break locator.
- * @param {function(string)} eat - Eater.
- * @param {string} value - Rest of content.
- * @param {boolean?} [silent] - Whether this is a dry run.
- * @return {Node?|boolean} - `break` node.
- */
-function tokenizeBreak(eat, value, silent) {
- var self = this;
- var breaks = self.options.breaks;
- var length = value.length;
- var index = -1;
- var queue = EMPTY;
- var character;
-
- while (++index < length) {
- character = value.charAt(index);
-
- if (character === C_NEWLINE) {
- if (!breaks && index < MIN_BREAK_LENGTH) {
- return;
- }
-
- /* istanbul ignore if - never used (yet) */
- if (silent) {
- return true;
- }
-
- queue += character;
- return eat(queue)(self.renderVoid(T_BREAK));
- }
-
- if (character !== C_SPACE) {
- return;
- }
-
- queue += character;
- }
-}
-
-tokenizeBreak.locator = locateBreak;
-
-/**
- * Construct a new parser.
- *
- * @example
- * var parser = new Parser(new VFile('Foo'));
- *
- * @constructor
- * @class {Parser}
- * @param {VFile} file - File to parse.
- * @param {Object?} [options] - Passed to
- * `Parser#setOptions()`.
- */
-function Parser(file, options) {
- var self = this;
-
- self.file = file;
- self.inLink = false;
- self.inBlock = false;
- self.inList = false;
- self.atStart = true;
- self.toOffset = vfileLocation(file).toOffset;
-
- self.descape = descapeFactory(self, 'escape');
- self.decode = decodeFactory(self);
-
- self.options = extend({}, self.options);
-
- self.setOptions(options);
-}
-
-/**
- * Set options. Does not overwrite previously set
- * options.
- *
- * @example
- * var parser = new Parser();
- * parser.setOptions({gfm: true});
- *
- * @this {Parser}
- * @throws {Error} - When an option is invalid.
- * @param {Object?} [options] - Parse settings.
- * @return {Parser} - `self`.
- */
-Parser.prototype.setOptions = function (options) {
- var self = this;
- var current = self.options;
- var key;
-
- if (options === null || options === undefined) {
- options = {};
- } else if (typeof options === 'object') {
- options = extend({}, options);
- } else {
- throw new Error(
- 'Invalid value `' + options + '` ' +
- 'for setting `options`'
- );
- }
-
- for (key in defaultOptions) {
- var value = options[key];
-
- if (value === null || value === undefined) {
- value = current[key];
- }
-
- if (typeof value !== 'boolean') {
- throw new Error(
- 'Invalid value `' + value + '` ' +
- 'for setting `options.' + key + '`'
- );
- }
-
- options[key] = value;
- }
-
- self.options = options;
-
- if (options.commonmark) {
- self.escape = escapes.commonmark;
- } else if (options.gfm) {
- self.escape = escapes.gfm;
- } else {
- self.escape = escapes.default;
- }
-
- return self;
-};
-
-/*
- * Expose `defaults`.
- */
-
-Parser.prototype.options = defaultOptions;
-
-/**
- * Factory to track indentation for each line corresponding
- * to the given `start` and the number of invocations.
- *
- * @param {number} start - Starting line.
- * @return {function(offset)} - Indenter.
- */
-Parser.prototype.indent = function (start) {
- var self = this;
- var line = start;
-
- /**
- * Intender which increments the global offset,
- * starting at the bound line, and further incrementing
- * each line for each invocation.
- *
- * @example
- * indenter(2);
- *
- * @param {number} offset - Number to increment the
- * offset.
- */
- function indenter(offset) {
- self.offset[line] = (self.offset[line] || 0) + offset;
+ * In the above example, the thematic break “interupts”
+ * the list. */
+proto.interruptList = [
+ ['fencedCode', {pedantic: false}],
+ ['thematicBreak', {pedantic: false}],
+ ['definition', {commonmark: false}],
+ ['footnote', {commonmark: false}]
+];
- line++;
- }
+/* Nodes that can interupt a blockquote:
+ *
+ * ```markdown
+ * > A paragraph.
+ * ___
+ * ```
+ *
+ * In the above example, the thematic break “interupts”
+ * the blockquote. */
+proto.interruptBlockquote = [
+ ['indentedCode', {commonmark: true}],
+ ['fencedCode', {commonmark: true}],
+ ['atxHeading', {commonmark: true}],
+ ['setextHeading', {commonmark: true}],
+ ['thematicBreak', {commonmark: true}],
+ ['html', {commonmark: true}],
+ ['list', {commonmark: true}],
+ ['definition', {commonmark: false}],
+ ['footnote', {commonmark: false}]
+];
- return indenter;
+/* Handlers. */
+proto.blockTokenizers = {
+ yamlFrontMatter: require('./tokenize/yaml'),
+ newline: require('./tokenize/newline'),
+ indentedCode: require('./tokenize/code-indented'),
+ fencedCode: require('./tokenize/code-fenced'),
+ blockquote: require('./tokenize/blockquote'),
+ atxHeading: require('./tokenize/heading-atx'),
+ thematicBreak: require('./tokenize/thematic-break'),
+ list: require('./tokenize/list'),
+ setextHeading: require('./tokenize/heading-setext'),
+ html: require('./tokenize/html-block'),
+ footnote: require('./tokenize/footnote-definition'),
+ definition: require('./tokenize/definition'),
+ table: require('./tokenize/table'),
+ paragraph: require('./tokenize/paragraph')
};
-/**
- * Get found offsets starting at `start`.
- *
- * @param {number} start - Starting line.
- * @return {Array.<number>} - Offsets starting at `start`.
- */
-Parser.prototype.getIndent = function (start) {
- var offset = this.offset;
- var result = [];
-
- while (++start) {
- if (!(start in offset)) {
- break;
- }
-
- result.push((offset[start] || 0) + 1);
- }
-
- return result;
+proto.inlineTokenizers = {
+ escape: require('./tokenize/escape'),
+ autoLink: require('./tokenize/auto-link'),
+ url: require('./tokenize/url'),
+ html: require('./tokenize/html-inline'),
+ link: require('./tokenize/link'),
+ reference: require('./tokenize/reference'),
+ strong: require('./tokenize/strong'),
+ emphasis: require('./tokenize/emphasis'),
+ deletion: require('./tokenize/delete'),
+ code: require('./tokenize/code-inline'),
+ break: require('./tokenize/break'),
+ text: require('./tokenize/text')
};
-/**
- * Parse the bound file.
- *
- * @example
- * new Parser(new File('_Foo_.')).parse();
- *
- * @this {Parser}
- * @return {Object} - `root` node.
- */
-Parser.prototype.parse = function () {
- var self = this;
- var value = String(self.file);
- var column = 1;
- var node;
-
- /*
- * Clean non-unix newlines: `\r\n` and `\r` are all
- * changed to `\n`. This should not affect positional
- * information.
- */
-
- value = value.replace(EXPRESSION_LINE_BREAKS, C_NEWLINE);
-
- if (value.charCodeAt(0) === 0xFEFF) {
- value = value.slice(1);
- column++;
- self.offset++;
- }
-
- /*
- * Add an `offset` matrix, used to keep track of
- * syntax and white space indentation per line.
- */
-
- self.offset = {};
-
- node = self.renderBlock(T_ROOT, value, {
- 'line': 1,
- 'column': column
- });
-
- node.position = {
- 'start': {
- 'line': 1,
- 'column': 1,
- 'offset': 0
- }
- };
-
- node.position.end = self.eof || extend({}, node.position.start);
-
- if (!self.options.position) {
- removePosition(node);
- }
-
- return node;
-};
-
-/*
- * Enter and exit helpers.
- */
-
-Parser.prototype.exitStart = toggle('atStart', true);
-Parser.prototype.enterList = toggle('inList', false);
-Parser.prototype.enterLink = toggle('inLink', false);
-Parser.prototype.enterBlock = toggle('inBlock', false);
-
-/*
- * Expose helpers
- */
-
-Parser.prototype.renderRaw = renderRaw;
-Parser.prototype.renderVoid = renderVoid;
-Parser.prototype.renderParent = renderParent;
-Parser.prototype.renderInline = renderInline;
-Parser.prototype.renderBlock = renderBlock;
-
-Parser.prototype.renderLink = renderLink;
-Parser.prototype.renderCodeBlock = renderCodeBlock;
-Parser.prototype.renderBlockquote = renderBlockquote;
-Parser.prototype.renderListItem = renderListItem;
-Parser.prototype.renderFootnoteDefinition = renderFootnoteDefinition;
-Parser.prototype.renderHeading = renderHeading;
-Parser.prototype.renderFootnote = renderFootnote;
-
-/**
- * Construct a tokenizer. This creates both
- * `tokenizeInline` and `tokenizeBlock`.
- *
- * @example
- * Parser.prototype.tokenizeInline = tokenizeFactory('inline');
- *
- * @param {string} type - Name of parser, used to find
- * its expressions (`%sMethods`) and tokenizers
- * (`%Tokenizers`).
- * @return {Function} - Tokenizer.
- */
-function tokenizeFactory(type) {
- /**
- * Tokenizer for a bound `type`
- *
- * @example
- * parser = new Parser();
- * parser.tokenizeInline('_foo_');
- *
- * @param {string} value - Content.
- * @param {Object} location - Offset at which `value`
- * starts.
- * @return {Array.<Object>} - Nodes.
- */
- function tokenize(value, location) {
- var self = this;
- var offset = self.offset;
- var tokens = [];
- var methods = self[type + 'Methods'];
- var tokenizers = self[type + 'Tokenizers'];
- var line = location.line;
- var column = location.column;
- var add;
- var index;
- var length;
- var method;
- var name;
- var matched;
- var valueLength;
-
- /*
- * Trim white space only lines.
- */
-
- if (!value) {
- return tokens;
- }
-
- /**
- * Update line, column, and offset based on
- * `value`.
- *
- * @example
- * updatePosition('foo');
- *
- * @param {string} subvalue - Subvalue to eat.
- */
- function updatePosition(subvalue) {
- var lastIndex = -1;
- var index = subvalue.indexOf(C_NEWLINE);
-
- while (index !== -1) {
- line++;
- lastIndex = index;
- index = subvalue.indexOf(C_NEWLINE, index + 1);
- }
-
- if (lastIndex === -1) {
- column += subvalue.length;
- } else {
- column = subvalue.length - lastIndex;
- }
-
- if (line in offset) {
- if (lastIndex !== -1) {
- column += offset[line];
- } else if (column <= offset[line]) {
- column = offset[line] + 1;
- }
- }
- }
+/* Expose precedence. */
+proto.blockMethods = keys(proto.blockTokenizers);
+proto.inlineMethods = keys(proto.inlineTokenizers);
- /**
- * Get offset. Called before the first character is
- * eaten to retrieve the range's offsets.
- *
- * @return {Function} - `done`, to be called when
- * the last character is eaten.
- */
- function getOffset() {
- var indentation = [];
- var pos = line + 1;
+/* Tokenizers. */
+proto.tokenizeBlock = tokenizer('block');
+proto.tokenizeInline = tokenizer('inline');
+proto.tokenizeFactory = tokenizer;
- /**
- * Done. Called when the last character is
- * eaten to retrieve the range’s offsets.
- *
- * @return {Array.<number>} - Offset.
- */
- function done() {
- var last = line + 1;
+/* Get all keys in `value`. */
+function keys(value) {
+ var result = [];
+ var key;
- while (pos < last) {
- indentation.push((offset[pos] || 0) + 1);
+ for (key in value) {
+ result.push(key);
+ }
- pos++;
- }
-
- return indentation;
- }
-
- return done;
- }
-
- /**
- * Get the current position.
- *
- * @example
- * position = now(); // {line: 1, column: 1, offset: 0}
- *
- * @return {Object} - Current Position.
- */
- function now() {
- var pos = {
- 'line': line,
- 'column': column
- };
-
- pos.offset = self.toOffset(pos);
-
- return pos;
- }
-
- /**
- * Store position information for a node.
- *
- * @example
- * start = now();
- * updatePosition('foo');
- * location = new Position(start);
- * // {
- * // start: {line: 1, column: 1, offset: 0},
- * // end: {line: 1, column: 3, offset: 2}
- * // }
- *
- * @param {Object} start - Starting position.
- */
- function Position(start) {
- this.start = start;
- this.end = now();
- }
-
- /**
- * Throw when a value is incorrectly eaten.
- * This shouldn’t happen but will throw on new,
- * incorrect rules.
- *
- * @example
- * // When the current value is set to `foo bar`.
- * validateEat('foo');
- * eat('foo');
- *
- * validateEat('bar');
- * // throws, because the space is not eaten.
- *
- * @param {string} subvalue - Value to be eaten.
- * @throws {Error} - When `subvalue` cannot be eaten.
- */
- function validateEat(subvalue) {
- /* istanbul ignore if */
- if (value.substring(0, subvalue.length) !== subvalue) {
- self.file.fail(ERR_INCORRECTLY_EATEN, now());
- }
- }
-
- /**
- * Mark position and patch `node.position`.
- *
- * @example
- * var update = position();
- * updatePosition('foo');
- * update({});
- * // {
- * // position: {
- * // start: {line: 1, column: 1, offset: 0},
- * // end: {line: 1, column: 3, offset: 2}
- * // }
- * // }
- *
- * @returns {Function} - Updater.
- */
- function position() {
- var before = now();
-
- /**
- * Add the position to a node.
- *
- * @example
- * update({type: 'text', value: 'foo'});
- *
- * @param {Node} node - Node to attach position
- * on.
- * @param {Array} [indent] - Indentation for
- * `node`.
- * @return {Node} - `node`.
- */
- function update(node, indent) {
- var prev = node.position;
- var start = prev ? prev.start : before;
- var combined = [];
- var n = prev && prev.end.line;
- var l = before.line;
-
- node.position = new Position(start);
-
- /*
- * If there was already a `position`, this
- * node was merged. Fixing `start` wasn’t
- * hard, but the indent is different.
- * Especially because some information, the
- * indent between `n` and `l` wasn’t
- * tracked. Luckily, that space is
- * (should be?) empty, so we can safely
- * check for it now.
- */
-
- if (prev && indent && prev.indent) {
- combined = prev.indent;
-
- if (n < l) {
- while (++n < l) {
- combined.push((offset[n] || 0) + 1);
- }
-
- combined.push(before.column);
- }
-
- indent = combined.concat(indent);
- }
-
- node.position.indent = indent || [];
-
- return node;
- }
-
- return update;
- }
-
- /**
- * Add `node` to `parent`s children or to `tokens`.
- * Performs merges where possible.
- *
- * @example
- * add({});
- *
- * add({}, {children: []});
- *
- * @param {Object} node - Node to add.
- * @param {Object} [parent] - Parent to insert into.
- * @return {Object} - Added or merged into node.
- */
- add = function (node, parent) {
- var prev;
- var children;
-
- if (!parent) {
- children = tokens;
- } else {
- children = parent.children;
- }
-
- prev = children[children.length - 1];
-
- if (
- prev &&
- node.type === prev.type &&
- node.type in MERGEABLE_NODES &&
- mergeable(prev) &&
- mergeable(node)
- ) {
- node = MERGEABLE_NODES[node.type].call(
- self, prev, node
- );
- }
-
- if (node !== prev) {
- children.push(node);
- }
-
- if (self.atStart && tokens.length) {
- self.exitStart();
- }
-
- return node;
- };
-
- /**
- * Remove `subvalue` from `value`.
- * `subvalue` must be at the start of `value`.
- *
- * @example
- * eat('foo')({type: 'text', value: 'foo'});
- *
- * @param {string} subvalue - Removed from `value`,
- * and passed to `updatePosition`.
- * @return {Function} - Wrapper around `add`, which
- * also adds `position` to node.
- */
- function eat(subvalue) {
- var indent = getOffset();
- var pos = position();
- var current = now();
-
- validateEat(subvalue);
-
- /**
- * Add the given arguments, add `position` to
- * the returned node, and return the node.
- *
- * @param {Object} node - Node to add.
- * @param {Object} [parent] - Node to insert into.
- * @return {Node} - Added node.
- */
- function apply(node, parent) {
- return pos(add(pos(node), parent), indent);
- }
-
- /**
- * Functions just like apply, but resets the
- * content: the line and column are reversed,
- * and the eaten value is re-added.
- *
- * This is useful for nodes with a single
- * type of content, such as lists and tables.
- *
- * See `apply` above for what parameters are
- * expected.
- *
- * @return {Node} - Added node.
- */
- function reset() {
- var node = apply.apply(null, arguments);
-
- line = current.line;
- column = current.column;
- value = subvalue + value;
-
- return node;
- }
-
- /**
- * Test the position, after eating, and reverse
- * to a not-eaten state.
- *
- * @return {Position} - Position after eating `subvalue`.
- */
- function test() {
- var result = pos({});
-
- line = current.line;
- column = current.column;
- value = subvalue + value;
-
- return result.position;
- }
-
- apply.reset = reset;
- apply.test = reset.test = test;
-
- value = value.substring(subvalue.length);
-
- updatePosition(subvalue);
-
- indent = indent();
-
- return apply;
- }
-
- /*
- * Expose `now` on `eat`.
- */
-
- eat.now = now;
-
- /*
- * Expose `file` on `eat`.
- */
-
- eat.file = self.file;
-
- /*
- * Sync initial offset.
- */
-
- updatePosition(EMPTY);
-
- /*
- * Iterate over `value`, and iterate over all
- * tokenizers. When one eats something, re-iterate
- * with the remaining value. If no tokenizer eats,
- * something failed (should not happen) and an
- * exception is thrown.
- */
-
- while (value) {
- index = -1;
- length = methods.length;
- matched = false;
-
- while (++index < length) {
- name = methods[index];
- method = tokenizers[name];
-
- if (
- method &&
- (!method.onlyAtStart || self.atStart) &&
- (!method.notInList || !self.inList) &&
- (!method.notInBlock || !self.inBlock) &&
- (!method.notInLink || !self.inLink)
- ) {
- valueLength = value.length;
-
- method.apply(self, [eat, value]);
-
- matched = valueLength !== value.length;
-
- if (matched) {
- break;
- }
- }
- }
-
- /* istanbul ignore if */
- if (!matched) {
- self.file.fail(ERR_INFINITE_LOOP, eat.now());
-
- /*
- * Errors are not thrown on `File#fail`
- * when `quiet: true`.
- */
-
- break;
- }
- }
-
- self.eof = now();
-
- return tokens;
- }
-
- return tokenize;
+ return result;
}
-
-/*
- * Expose tokenizers for block-level nodes.
- */
-
-Parser.prototype.blockTokenizers = {
- 'yamlFrontMatter': tokenizeYAMLFrontMatter,
- 'newline': tokenizeNewline,
- 'indentedCode': tokenizeIndentedCode,
- 'fencedCode': tokenizeFencedCode,
- 'blockquote': tokenizeBlockquote,
- 'atxHeading': tokenizeATXHeading,
- 'thematicBreak': tokenizeThematicBreak,
- 'list': tokenizeList,
- 'setextHeading': tokenizeSetextHeading,
- 'html': tokenizeBlockHTML,
- 'footnote': tokenizeFootnoteDefinition,
- 'definition': tokenizeDefinition,
- 'table': tokenizeTable,
- 'paragraph': tokenizeParagraph
-};
-
-/*
- * Expose order in which to parse block-level nodes.
- */
-
-Parser.prototype.blockMethods = [
- 'yamlFrontMatter',
- 'newline',
- 'indentedCode',
- 'fencedCode',
- 'blockquote',
- 'atxHeading',
- 'thematicBreak',
- 'list',
- 'setextHeading',
- 'html',
- 'footnote',
- 'definition',
- 'table',
- 'paragraph'
-];
-
-/**
- * Block tokenizer.
- *
- * @example
- * var parser = new Parser();
- * parser.tokenizeBlock('> foo.');
- *
- * @param {string} value - Content.
- * @return {Array.<Object>} - Nodes.
- */
-
-Parser.prototype.tokenizeBlock = tokenizeFactory(BLOCK);
-
-/*
- * Expose tokenizers for inline-level nodes.
- */
-
-Parser.prototype.inlineTokenizers = {
- 'escape': tokenizeEscape,
- 'autoLink': tokenizeAutoLink,
- 'url': tokenizeURL,
- 'html': tokenizeInlineHTML,
- 'link': tokenizeLink,
- 'reference': tokenizeReference,
- 'strong': tokenizeStrong,
- 'emphasis': tokenizeEmphasis,
- 'deletion': tokenizeDeletion,
- 'code': tokenizeInlineCode,
- 'break': tokenizeBreak,
- 'text': tokenizeText
-};
-
-/*
- * Expose order in which to parse inline-level nodes.
- */
-
-Parser.prototype.inlineMethods = [
- 'escape',
- 'autoLink',
- 'url',
- 'html',
- 'link',
- 'reference',
- 'strong',
- 'emphasis',
- 'deletion',
- 'code',
- 'break',
- 'text'
-];
-
-/**
- * Inline tokenizer.
- *
- * @example
- * var parser = new Parser();
- * parser.tokenizeInline('_foo_');
- *
- * @param {string} value - Content.
- * @return {Array.<Object>} - Nodes.
- */
-
-Parser.prototype.tokenizeInline = tokenizeFactory(INLINE);
-
-/*
- * Expose `tokenizeFactory` so dependencies could create
- * their own tokenizers.
- */
-
-Parser.prototype.tokenizeFactory = tokenizeFactory;
-
-/*
- * Expose `attacher`.
- */
-
-module.exports = Parser;
diff --git a/tools/eslint/node_modules/remark-parse/lib/set-options.js b/tools/eslint/node_modules/remark-parse/lib/set-options.js
new file mode 100644
index 0000000000..3f9abad7c4
--- /dev/null
+++ b/tools/eslint/node_modules/remark-parse/lib/set-options.js
@@ -0,0 +1,59 @@
+/**
+ * @author Titus Wormer
+ * @copyright 2015 Titus Wormer
+ * @license MIT
+ * @module remark:parse
+ * @fileoverview Markdown parser.
+ */
+
+'use strict';
+
+var xtend = require('xtend');
+var escapes = require('markdown-escapes');
+var defaults = require('./defaults');
+
+module.exports = setOptions;
+
+/* Set options. */
+function setOptions(options) {
+ var self = this;
+ var current = self.options;
+ var key;
+ var value;
+
+ if (options == null) {
+ options = {};
+ } else if (typeof options === 'object') {
+ options = xtend(options);
+ } else {
+ throw new Error(
+ 'Invalid value `' + options + '` ' +
+ 'for setting `options`'
+ );
+ }
+
+ for (key in defaults) {
+ value = options[key];
+
+ if (value == null) {
+ value = current[key];
+ }
+
+ if (
+ (key !== 'blocks' && typeof value !== 'boolean') ||
+ (key === 'blocks' && typeof value !== 'object')
+ ) {
+ throw new Error(
+ 'Invalid value `' + value + '` ' +
+ 'for setting `options.' + key + '`'
+ );
+ }
+
+ options[key] = value;
+ }
+
+ self.options = options;
+ self.escape = escapes(options);
+
+ return self;
+}
diff --git a/tools/eslint/node_modules/remark-parse/lib/tokenize/auto-link.js b/tools/eslint/node_modules/remark-parse/lib/tokenize/auto-link.js
new file mode 100644
index 0000000000..3861b48a14
--- /dev/null
+++ b/tools/eslint/node_modules/remark-parse/lib/tokenize/auto-link.js
@@ -0,0 +1,151 @@
+/**
+ * @author Titus Wormer
+ * @copyright 2015 Titus Wormer
+ * @license MIT
+ * @module remark:parse:tokenize:auto-link
+ * @fileoverview Tokenise an auto-link.
+ */
+
+'use strict';
+
+var decode = require('parse-entities');
+var locate = require('../locate/tag');
+
+module.exports = autoLink;
+autoLink.locator = locate;
+autoLink.notInLink = true;
+
+var C_LT = '<';
+var C_GT = '>';
+var C_AT_SIGN = '@';
+var C_SLASH = '/';
+var MAILTO = 'mailto:';
+var MAILTO_LENGTH = MAILTO.length;
+
+/* Tokenise a link. */
+function autoLink(eat, value, silent) {
+ var self;
+ var subvalue;
+ var length;
+ var index;
+ var queue;
+ var character;
+ var hasAtCharacter;
+ var link;
+ var now;
+ var content;
+ var tokenize;
+ var exit;
+
+ if (value.charAt(0) !== C_LT) {
+ return;
+ }
+
+ self = this;
+ subvalue = '';
+ length = value.length;
+ index = 0;
+ queue = '';
+ hasAtCharacter = false;
+ link = '';
+
+ index++;
+ subvalue = C_LT;
+
+ while (index < length) {
+ character = value.charAt(index);
+
+ if (
+ character === ' ' ||
+ character === C_GT ||
+ character === C_AT_SIGN ||
+ (character === ':' && value.charAt(index + 1) === C_SLASH)
+ ) {
+ break;
+ }
+
+ queue += character;
+ index++;
+ }
+
+ if (!queue) {
+ return;
+ }
+
+ link += queue;
+ queue = '';
+
+ character = value.charAt(index);
+ link += character;
+ index++;
+
+ if (character === C_AT_SIGN) {
+ hasAtCharacter = true;
+ } else {
+ if (
+ character !== ':' ||
+ value.charAt(index + 1) !== C_SLASH
+ ) {
+ return;
+ }
+
+ link += C_SLASH;
+ index++;
+ }
+
+ while (index < length) {
+ character = value.charAt(index);
+
+ if (character === ' ' || character === C_GT) {
+ break;
+ }
+
+ queue += character;
+ index++;
+ }
+
+ character = value.charAt(index);
+
+ if (!queue || character !== C_GT) {
+ return;
+ }
+
+ /* istanbul ignore if - never used (yet) */
+ if (silent) {
+ return true;
+ }
+
+ link += queue;
+ content = link;
+ subvalue += link + character;
+ now = eat.now();
+ now.column++;
+ now.offset++;
+
+ if (hasAtCharacter) {
+ if (link.slice(0, MAILTO_LENGTH).toLowerCase() === MAILTO) {
+ content = content.substr(MAILTO_LENGTH);
+ now.column += MAILTO_LENGTH;
+ now.offset += MAILTO_LENGTH;
+ } else {
+ link = MAILTO + link;
+ }
+ }
+
+ /* Temporarily remove support for escapes in autolinks. */
+ tokenize = self.inlineTokenizers.escape;
+ self.inlineTokenizers.escape = null;
+ exit = self.enterLink();
+
+ content = self.tokenizeInline(content, now);
+
+ self.inlineTokenizers.escape = tokenize;
+ exit();
+
+ return eat(subvalue)({
+ type: 'link',
+ title: null,
+ url: decode(link),
+ children: content
+ });
+}
diff --git a/tools/eslint/node_modules/remark-parse/lib/tokenize/blockquote.js b/tools/eslint/node_modules/remark-parse/lib/tokenize/blockquote.js
new file mode 100644
index 0000000000..764e0aa010
--- /dev/null
+++ b/tools/eslint/node_modules/remark-parse/lib/tokenize/blockquote.js
@@ -0,0 +1,137 @@
+/**
+ * @author Titus Wormer
+ * @copyright 2015 Titus Wormer
+ * @license MIT
+ * @module remark:parse:tokenize:blockquote
+ * @fileoverview Tokenise blockquote.
+ */
+
+'use strict';
+
+var trim = require('trim');
+var interrupt = require('../util/interrupt');
+
+module.exports = blockquote;
+
+var C_NEWLINE = '\n';
+var C_TAB = '\t';
+var C_SPACE = ' ';
+var C_GT = '>';
+
+/* Tokenise a blockquote. */
+function blockquote(eat, value, silent) {
+ var self = this;
+ var offsets = self.offset;
+ var tokenizers = self.blockTokenizers;
+ var interruptors = self.interruptBlockquote;
+ var now = eat.now();
+ var currentLine = now.line;
+ var length = value.length;
+ var values = [];
+ var contents = [];
+ var indents = [];
+ var add;
+ var index = 0;
+ var character;
+ var rest;
+ var nextIndex;
+ var content;
+ var line;
+ var startIndex;
+ var prefixed;
+ var exit;
+
+ while (index < length) {
+ character = value.charAt(index);
+
+ if (character !== C_SPACE && character !== C_TAB) {
+ break;
+ }
+
+ index++;
+ }
+
+ if (value.charAt(index) !== C_GT) {
+ return;
+ }
+
+ if (silent) {
+ return true;
+ }
+
+ index = 0;
+
+ while (index < length) {
+ nextIndex = value.indexOf(C_NEWLINE, index);
+ startIndex = index;
+ prefixed = false;
+
+ if (nextIndex === -1) {
+ nextIndex = length;
+ }
+
+ while (index < length) {
+ character = value.charAt(index);
+
+ if (character !== C_SPACE && character !== C_TAB) {
+ break;
+ }
+
+ index++;
+ }
+
+ if (value.charAt(index) === C_GT) {
+ index++;
+ prefixed = true;
+
+ if (value.charAt(index) === C_SPACE) {
+ index++;
+ }
+ } else {
+ index = startIndex;
+ }
+
+ content = value.slice(index, nextIndex);
+
+ if (!prefixed && !trim(content)) {
+ index = startIndex;
+ break;
+ }
+
+ if (!prefixed) {
+ rest = value.slice(index);
+
+ /* Check if the following code contains a possible
+ * block. */
+ if (interrupt(interruptors, tokenizers, self, [eat, rest, true])) {
+ break;
+ }
+ }
+
+ line = startIndex === index ? content : value.slice(startIndex, nextIndex);
+
+ indents.push(index - startIndex);
+ values.push(line);
+ contents.push(content);
+
+ index = nextIndex + 1;
+ }
+
+ index = -1;
+ length = indents.length;
+ add = eat(values.join(C_NEWLINE));
+
+ while (++index < length) {
+ offsets[currentLine] = (offsets[currentLine] || 0) + indents[index];
+ currentLine++;
+ }
+
+ exit = self.enterBlock();
+ contents = self.tokenizeBlock(contents.join(C_NEWLINE), now);
+ exit();
+
+ return add({
+ type: 'blockquote',
+ children: contents
+ });
+}
diff --git a/tools/eslint/node_modules/remark-parse/lib/tokenize/break.js b/tools/eslint/node_modules/remark-parse/lib/tokenize/break.js
new file mode 100644
index 0000000000..6d2d0dcff9
--- /dev/null
+++ b/tools/eslint/node_modules/remark-parse/lib/tokenize/break.js
@@ -0,0 +1,51 @@
+/**
+ * @author Titus Wormer
+ * @copyright 2015 Titus Wormer
+ * @license MIT
+ * @module remark:parse:tokenize:break
+ * @fileoverview Tokenise a break.
+ */
+
+'use strict';
+
+var locate = require('../locate/break');
+
+module.exports = hardBreak;
+hardBreak.locator = locate;
+
+var MIN_BREAK_LENGTH = 2;
+
+/* Tokenise a break. */
+function hardBreak(eat, value, silent) {
+ var self = this;
+ var breaks = self.options.breaks;
+ var length = value.length;
+ var index = -1;
+ var queue = '';
+ var character;
+
+ while (++index < length) {
+ character = value.charAt(index);
+
+ if (character === '\n') {
+ if (!breaks && index < MIN_BREAK_LENGTH) {
+ return;
+ }
+
+ /* istanbul ignore if - never used (yet) */
+ if (silent) {
+ return true;
+ }
+
+ queue += character;
+
+ return eat(queue)({type: 'break'});
+ }
+
+ if (character !== ' ') {
+ return;
+ }
+
+ queue += character;
+ }
+}
diff --git a/tools/eslint/node_modules/remark-parse/lib/tokenize/code-fenced.js b/tools/eslint/node_modules/remark-parse/lib/tokenize/code-fenced.js
new file mode 100644
index 0000000000..f2577405b2
--- /dev/null
+++ b/tools/eslint/node_modules/remark-parse/lib/tokenize/code-fenced.js
@@ -0,0 +1,245 @@
+/**
+ * @author Titus Wormer
+ * @copyright 2015 Titus Wormer
+ * @license MIT
+ * @module remark:parse:tokenize:code-fenced
+ * @fileoverview Tokenise fenced code.
+ */
+
+'use strict';
+
+var trim = require('trim-trailing-lines');
+
+module.exports = fencedCode;
+
+var C_NEWLINE = '\n';
+var C_TAB = '\t';
+var C_SPACE = ' ';
+var C_TILDE = '~';
+var C_TICK = '`';
+
+var MIN_FENCE_COUNT = 3;
+var CODE_INDENT_COUNT = 4;
+
+/* Tokenise fenced code. */
+function fencedCode(eat, value, silent) {
+ var self = this;
+ var settings = self.options;
+ var length = value.length + 1;
+ var index = 0;
+ var subvalue = '';
+ var fenceCount;
+ var marker;
+ var character;
+ var flag;
+ var queue;
+ var content;
+ var exdentedContent;
+ var closing;
+ var exdentedClosing;
+ var indent;
+ var now;
+
+ if (!settings.gfm) {
+ return;
+ }
+
+ /* Eat initial spacing. */
+ while (index < length) {
+ character = value.charAt(index);
+
+ if (character !== C_SPACE && character !== C_TAB) {
+ break;
+ }
+
+ subvalue += character;
+ index++;
+ }
+
+ indent = index;
+
+ /* Eat the fence. */
+ character = value.charAt(index);
+
+ if (character !== C_TILDE && character !== C_TICK) {
+ return;
+ }
+
+ index++;
+ marker = character;
+ fenceCount = 1;
+ subvalue += character;
+
+ while (index < length) {
+ character = value.charAt(index);
+
+ if (character !== marker) {
+ break;
+ }
+
+ subvalue += character;
+ fenceCount++;
+ index++;
+ }
+
+ if (fenceCount < MIN_FENCE_COUNT) {
+ return;
+ }
+
+ /* Eat spacing before flag. */
+ while (index < length) {
+ character = value.charAt(index);
+
+ if (character !== C_SPACE && character !== C_TAB) {
+ break;
+ }
+
+ subvalue += character;
+ index++;
+ }
+
+ /* Eat flag. */
+ flag = '';
+ queue = '';
+
+ while (index < length) {
+ character = value.charAt(index);
+
+ if (
+ character === C_NEWLINE ||
+ character === C_TILDE ||
+ character === C_TICK
+ ) {
+ break;
+ }
+
+ if (character === C_SPACE || character === C_TAB) {
+ queue += character;
+ } else {
+ flag += queue + character;
+ queue = '';
+ }
+
+ index++;
+ }
+
+ character = value.charAt(index);
+
+ if (character && character !== C_NEWLINE) {
+ return;
+ }
+
+ if (silent) {
+ return true;
+ }
+
+ now = eat.now();
+ now.column += subvalue.length;
+ now.offset += subvalue.length;
+
+ subvalue += flag;
+ flag = self.decode.raw(self.unescape(flag), now);
+
+ if (queue) {
+ subvalue += queue;
+ }
+
+ queue = '';
+ closing = '';
+ exdentedClosing = '';
+ content = '';
+ exdentedContent = '';
+
+ /* Eat content. */
+ while (index < length) {
+ character = value.charAt(index);
+ content += closing;
+ exdentedContent += exdentedClosing;
+ closing = '';
+ exdentedClosing = '';
+
+ if (character !== C_NEWLINE) {
+ content += character;
+ exdentedClosing += character;
+ index++;
+ continue;
+ }
+
+ /* Add the newline to `subvalue` if its the first
+ * character. Otherwise, add it to the `closing`
+ * queue. */
+ if (content) {
+ closing += character;
+ exdentedClosing += character;
+ } else {
+ subvalue += character;
+ }
+
+ queue = '';
+ index++;
+
+ while (index < length) {
+ character = value.charAt(index);
+
+ if (character !== C_SPACE) {
+ break;
+ }
+
+ queue += character;
+ index++;
+ }
+
+ closing += queue;
+ exdentedClosing += queue.slice(indent);
+
+ if (queue.length >= CODE_INDENT_COUNT) {
+ continue;
+ }
+
+ queue = '';
+
+ while (index < length) {
+ character = value.charAt(index);
+
+ if (character !== marker) {
+ break;
+ }
+
+ queue += character;
+ index++;
+ }
+
+ closing += queue;
+ exdentedClosing += queue;
+
+ if (queue.length < fenceCount) {
+ continue;
+ }
+
+ queue = '';
+
+ while (index < length) {
+ character = value.charAt(index);
+
+ if (character !== C_SPACE && character !== C_TAB) {
+ break;
+ }
+
+ closing += character;
+ exdentedClosing += character;
+ index++;
+ }
+
+ if (!character || character === C_NEWLINE) {
+ break;
+ }
+ }
+
+ subvalue += content + closing;
+
+ return eat(subvalue)({
+ type: 'code',
+ lang: flag || null,
+ value: trim(exdentedContent)
+ });
+}
diff --git a/tools/eslint/node_modules/remark-parse/lib/tokenize/code-indented.js b/tools/eslint/node_modules/remark-parse/lib/tokenize/code-indented.js
new file mode 100644
index 0000000000..50c581fe26
--- /dev/null
+++ b/tools/eslint/node_modules/remark-parse/lib/tokenize/code-indented.js
@@ -0,0 +1,106 @@
+/**
+ * @author Titus Wormer
+ * @copyright 2015 Titus Wormer
+ * @license MIT
+ * @module remark:parse:tokenize:code-indented
+ * @fileoverview Tokenise indented code.
+ */
+
+'use strict';
+
+var repeat = require('repeat-string');
+var trim = require('trim-trailing-lines');
+
+module.exports = indentedCode;
+
+var C_NEWLINE = '\n';
+var C_TAB = '\t';
+var C_SPACE = ' ';
+
+var CODE_INDENT_COUNT = 4;
+var CODE_INDENT = repeat(C_SPACE, CODE_INDENT_COUNT);
+
+/* Tokenise indented code. */
+function indentedCode(eat, value, silent) {
+ var index = -1;
+ var length = value.length;
+ var subvalue = '';
+ var content = '';
+ var subvalueQueue = '';
+ var contentQueue = '';
+ var character;
+ var blankQueue;
+ var indent;
+
+ while (++index < length) {
+ character = value.charAt(index);
+
+ if (indent) {
+ indent = false;
+
+ subvalue += subvalueQueue;
+ content += contentQueue;
+ subvalueQueue = '';
+ contentQueue = '';
+
+ if (character === C_NEWLINE) {
+ subvalueQueue = character;
+ contentQueue = character;
+ } else {
+ subvalue += character;
+ content += character;
+
+ while (++index < length) {
+ character = value.charAt(index);
+
+ if (!character || character === C_NEWLINE) {
+ contentQueue = character;
+ subvalueQueue = character;
+ break;
+ }
+
+ subvalue += character;
+ content += character;
+ }
+ }
+ } else if (
+ character === C_SPACE &&
+ value.charAt(index + 1) === character &&
+ value.charAt(index + 2) === character &&
+ value.charAt(index + 3) === character
+ ) {
+ subvalueQueue += CODE_INDENT;
+ index += 3;
+ indent = true;
+ } else if (character === C_TAB) {
+ subvalueQueue += character;
+ indent = true;
+ } else {
+ blankQueue = '';
+
+ while (character === C_TAB || character === C_SPACE) {
+ blankQueue += character;
+ character = value.charAt(++index);
+ }
+
+ if (character !== C_NEWLINE) {
+ break;
+ }
+
+ subvalueQueue += blankQueue + character;
+ contentQueue += character;
+ }
+ }
+
+ if (content) {
+ if (silent) {
+ return true;
+ }
+
+ return eat(subvalue)({
+ type: 'code',
+ lang: null,
+ value: trim(content)
+ });
+ }
+}
diff --git a/tools/eslint/node_modules/remark-parse/lib/tokenize/code-inline.js b/tools/eslint/node_modules/remark-parse/lib/tokenize/code-inline.js
new file mode 100644
index 0000000000..9157412753
--- /dev/null
+++ b/tools/eslint/node_modules/remark-parse/lib/tokenize/code-inline.js
@@ -0,0 +1,120 @@
+/**
+ * @author Titus Wormer
+ * @copyright 2015 Titus Wormer
+ * @license MIT
+ * @module remark:parse:tokenize:code-inline
+ * @fileoverview Tokenise inline code.
+ */
+
+'use strict';
+
+var whitespace = require('is-whitespace-character');
+var locate = require('../locate/code-inline');
+
+module.exports = inlineCode;
+inlineCode.locator = locate;
+
+var C_TICK = '`';
+
+/* Tokenise inline code. */
+function inlineCode(eat, value, silent) {
+ var length = value.length;
+ var index = 0;
+ var queue = '';
+ var tickQueue = '';
+ var contentQueue;
+ var subqueue;
+ var count;
+ var openingCount;
+ var subvalue;
+ var character;
+ var found;
+ var next;
+
+ while (index < length) {
+ if (value.charAt(index) !== C_TICK) {
+ break;
+ }
+
+ queue += C_TICK;
+ index++;
+ }
+
+ if (!queue) {
+ return;
+ }
+
+ subvalue = queue;
+ openingCount = index;
+ queue = '';
+ next = value.charAt(index);
+ count = 0;
+
+ while (index < length) {
+ character = next;
+ next = value.charAt(index + 1);
+
+ if (character === C_TICK) {
+ count++;
+ tickQueue += character;
+ } else {
+ count = 0;
+ queue += character;
+ }
+
+ if (count && next !== C_TICK) {
+ if (count === openingCount) {
+ subvalue += queue + tickQueue;
+ found = true;
+ break;
+ }
+
+ queue += tickQueue;
+ tickQueue = '';
+ }
+
+ index++;
+ }
+
+ if (!found) {
+ if (openingCount % 2 !== 0) {
+ return;
+ }
+
+ queue = '';
+ }
+
+ /* istanbul ignore if - never used (yet) */
+ if (silent) {
+ return true;
+ }
+
+ contentQueue = '';
+ subqueue = '';
+ length = queue.length;
+ index = -1;
+
+ while (++index < length) {
+ character = queue.charAt(index);
+
+ if (whitespace(character)) {
+ subqueue += character;
+ continue;
+ }
+
+ if (subqueue) {
+ if (contentQueue) {
+ contentQueue += subqueue;
+ }
+
+ subqueue = '';
+ }
+
+ contentQueue += character;
+ }
+
+ return eat(subvalue)({
+ type: 'inlineCode',
+ value: contentQueue
+ });
+}
diff --git a/tools/eslint/node_modules/remark-parse/lib/tokenize/definition.js b/tools/eslint/node_modules/remark-parse/lib/tokenize/definition.js
new file mode 100644
index 0000000000..3f7345a2c9
--- /dev/null
+++ b/tools/eslint/node_modules/remark-parse/lib/tokenize/definition.js
@@ -0,0 +1,287 @@
+/**
+ * @author Titus Wormer
+ * @copyright 2015 Titus Wormer
+ * @license MIT
+ * @module remark:parse:tokenize:definition
+ * @fileoverview Tokenise a definition.
+ */
+
+'use strict';
+
+var whitespace = require('is-whitespace-character');
+var normalize = require('../util/normalize');
+
+module.exports = definition;
+definition.notInList = true;
+definition.notInBlock = true;
+
+var C_DOUBLE_QUOTE = '"';
+var C_SINGLE_QUOTE = '\'';
+var C_BACKSLASH = '\\';
+var C_NEWLINE = '\n';
+var C_TAB = '\t';
+var C_SPACE = ' ';
+var C_BRACKET_OPEN = '[';
+var C_BRACKET_CLOSE = ']';
+var C_PAREN_OPEN = '(';
+var C_PAREN_CLOSE = ')';
+var C_COLON = ':';
+var C_LT = '<';
+var C_GT = '>';
+
+/* Tokenise a definition. */
+function definition(eat, value, silent) {
+ var self = this;
+ var commonmark = self.options.commonmark;
+ var index = 0;
+ var length = value.length;
+ var subvalue = '';
+ var beforeURL;
+ var beforeTitle;
+ var queue;
+ var character;
+ var test;
+ var identifier;
+ var url;
+ var title;
+
+ while (index < length) {
+ character = value.charAt(index);
+
+ if (character !== C_SPACE && character !== C_TAB) {
+ break;
+ }
+
+ subvalue += character;
+ index++;
+ }
+
+ character = value.charAt(index);
+
+ if (character !== C_BRACKET_OPEN) {
+ return;
+ }
+
+ index++;
+ subvalue += character;
+ queue = '';
+
+ while (index < length) {
+ character = value.charAt(index);
+
+ if (character === C_BRACKET_CLOSE) {
+ break;
+ } else if (character === C_BACKSLASH) {
+ queue += character;
+ index++;
+ character = value.charAt(index);
+ }
+
+ queue += character;
+ index++;
+ }
+
+ if (
+ !queue ||
+ value.charAt(index) !== C_BRACKET_CLOSE ||
+ value.charAt(index + 1) !== C_COLON
+ ) {
+ return;
+ }
+
+ identifier = queue;
+ subvalue += queue + C_BRACKET_CLOSE + C_COLON;
+ index = subvalue.length;
+ queue = '';
+
+ while (index < length) {
+ character = value.charAt(index);
+
+ if (
+ character !== C_TAB &&
+ character !== C_SPACE &&
+ character !== C_NEWLINE
+ ) {
+ break;
+ }
+
+ subvalue += character;
+ index++;
+ }
+
+ character = value.charAt(index);
+ queue = '';
+ beforeURL = subvalue;
+
+ if (character === C_LT) {
+ index++;
+
+ while (index < length) {
+ character = value.charAt(index);
+
+ if (!isEnclosedURLCharacter(character)) {
+ break;
+ }
+
+ queue += character;
+ index++;
+ }
+
+ character = value.charAt(index);
+
+ if (character === isEnclosedURLCharacter.delimiter) {
+ subvalue += C_LT + queue + character;
+ index++;
+ } else {
+ if (commonmark) {
+ return;
+ }
+
+ index -= queue.length + 1;
+ queue = '';
+ }
+ }
+
+ if (!queue) {
+ while (index < length) {
+ character = value.charAt(index);
+
+ if (!isUnclosedURLCharacter(character)) {
+ break;
+ }
+
+ queue += character;
+ index++;
+ }
+
+ subvalue += queue;
+ }
+
+ if (!queue) {
+ return;
+ }
+
+ url = queue;
+ queue = '';
+
+ while (index < length) {
+ character = value.charAt(index);
+
+ if (
+ character !== C_TAB &&
+ character !== C_SPACE &&
+ character !== C_NEWLINE
+ ) {
+ break;
+ }
+
+ queue += character;
+ index++;
+ }
+
+ character = value.charAt(index);
+ test = null;
+
+ if (character === C_DOUBLE_QUOTE) {
+ test = C_DOUBLE_QUOTE;
+ } else if (character === C_SINGLE_QUOTE) {
+ test = C_SINGLE_QUOTE;
+ } else if (character === C_PAREN_OPEN) {
+ test = C_PAREN_CLOSE;
+ }
+
+ if (!test) {
+ queue = '';
+ index = subvalue.length;
+ } else if (queue) {
+ subvalue += queue + character;
+ index = subvalue.length;
+ queue = '';
+
+ while (index < length) {
+ character = value.charAt(index);
+
+ if (character === test) {
+ break;
+ }
+
+ if (character === C_NEWLINE) {
+ index++;
+ character = value.charAt(index);
+
+ if (character === C_NEWLINE || character === test) {
+ return;
+ }
+
+ queue += C_NEWLINE;
+ }
+
+ queue += character;
+ index++;
+ }
+
+ character = value.charAt(index);
+
+ if (character !== test) {
+ return;
+ }
+
+ beforeTitle = subvalue;
+ subvalue += queue + character;
+ index++;
+ title = queue;
+ queue = '';
+ } else {
+ return;
+ }
+
+ while (index < length) {
+ character = value.charAt(index);
+
+ if (character !== C_TAB && character !== C_SPACE) {
+ break;
+ }
+
+ subvalue += character;
+ index++;
+ }
+
+ character = value.charAt(index);
+
+ if (!character || character === C_NEWLINE) {
+ if (silent) {
+ return true;
+ }
+
+ beforeURL = eat(beforeURL).test().end;
+ url = self.decode.raw(self.unescape(url), beforeURL);
+
+ if (title) {
+ beforeTitle = eat(beforeTitle).test().end;
+ title = self.decode.raw(self.unescape(title), beforeTitle);
+ }
+
+ return eat(subvalue)({
+ type: 'definition',
+ identifier: normalize(identifier),
+ title: title || null,
+ url: url
+ });
+ }
+}
+
+/* Check if `character` can be inside an enclosed URI. */
+function isEnclosedURLCharacter(character) {
+ return character !== C_GT &&
+ character !== C_BRACKET_OPEN &&
+ character !== C_BRACKET_CLOSE;
+}
+
+isEnclosedURLCharacter.delimiter = C_GT;
+
+/* Check if `character` can be inside an unclosed URI. */
+function isUnclosedURLCharacter(character) {
+ return character !== C_BRACKET_OPEN &&
+ character !== C_BRACKET_CLOSE &&
+ !whitespace(character);
+}
diff --git a/tools/eslint/node_modules/remark-parse/lib/tokenize/delete.js b/tools/eslint/node_modules/remark-parse/lib/tokenize/delete.js
new file mode 100644
index 0000000000..60ae9c4936
--- /dev/null
+++ b/tools/eslint/node_modules/remark-parse/lib/tokenize/delete.js
@@ -0,0 +1,69 @@
+/**
+ * @author Titus Wormer
+ * @copyright 2015 Titus Wormer
+ * @license MIT
+ * @module remark:parse:tokenize:delete
+ * @fileoverview Tokenise strikethrough.
+ */
+
+'use strict';
+
+var whitespace = require('is-whitespace-character');
+var locate = require('../locate/delete');
+
+module.exports = strikethrough;
+strikethrough.locator = locate;
+
+var C_TILDE = '~';
+var DOUBLE = '~~';
+
+/* Tokenise strikethrough. */
+function strikethrough(eat, value, silent) {
+ var self = this;
+ var character = '';
+ var previous = '';
+ var preceding = '';
+ var subvalue = '';
+ var index;
+ var length;
+ var now;
+
+ if (
+ !self.options.gfm ||
+ value.charAt(0) !== C_TILDE ||
+ value.charAt(1) !== C_TILDE ||
+ whitespace(value.charAt(2))
+ ) {
+ return;
+ }
+
+ index = 1;
+ length = value.length;
+ now = eat.now();
+ now.column += 2;
+ now.offset += 2;
+
+ while (++index < length) {
+ character = value.charAt(index);
+
+ if (
+ character === C_TILDE &&
+ previous === C_TILDE &&
+ (!preceding || !whitespace(preceding))
+ ) {
+ /* istanbul ignore if - never used (yet) */
+ if (silent) {
+ return true;
+ }
+
+ return eat(DOUBLE + subvalue + DOUBLE)({
+ type: 'delete',
+ children: self.tokenizeInline(subvalue, now)
+ });
+ }
+
+ subvalue += previous;
+ preceding = previous;
+ previous = character;
+ }
+}
diff --git a/tools/eslint/node_modules/remark-parse/lib/tokenize/emphasis.js b/tools/eslint/node_modules/remark-parse/lib/tokenize/emphasis.js
new file mode 100644
index 0000000000..4624936922
--- /dev/null
+++ b/tools/eslint/node_modules/remark-parse/lib/tokenize/emphasis.js
@@ -0,0 +1,94 @@
+/**
+ * @author Titus Wormer
+ * @copyright 2015 Titus Wormer
+ * @license MIT
+ * @module remark:parse:tokenize:emphasis
+ * @fileoverview Tokenise emphasis.
+ */
+
+'use strict';
+
+var trim = require('trim');
+var word = require('is-word-character');
+var whitespace = require('is-whitespace-character');
+var locate = require('../locate/emphasis');
+
+module.exports = emphasis;
+emphasis.locator = locate;
+
+var C_ASTERISK = '*';
+var C_UNDERSCORE = '_';
+
+/* Tokenise emphasis. */
+function emphasis(eat, value, silent) {
+ var self = this;
+ var index = 0;
+ var character = value.charAt(index);
+ var now;
+ var pedantic;
+ var marker;
+ var queue;
+ var subvalue;
+ var length;
+ var prev;
+
+ if (character !== C_ASTERISK && character !== C_UNDERSCORE) {
+ return;
+ }
+
+ pedantic = self.options.pedantic;
+ subvalue = character;
+ marker = character;
+ length = value.length;
+ index++;
+ queue = '';
+ character = '';
+
+ if (pedantic && whitespace(value.charAt(index))) {
+ return;
+ }
+
+ while (index < length) {
+ prev = character;
+ character = value.charAt(index);
+
+ if (character === marker && (!pedantic || !whitespace(prev))) {
+ character = value.charAt(++index);
+
+ if (character !== marker) {
+ if (!trim(queue) || prev === marker) {
+ return;
+ }
+
+ if (!pedantic && marker === C_UNDERSCORE && word(character)) {
+ queue += marker;
+ continue;
+ }
+
+ /* istanbul ignore if - never used (yet) */
+ if (silent) {
+ return true;
+ }
+
+ now = eat.now();
+ now.column++;
+ now.offset++;
+
+ return eat(subvalue + queue + marker)({
+ type: 'emphasis',
+ children: self.tokenizeInline(queue, now)
+ });
+ }
+
+ queue += marker;
+ }
+
+ if (!pedantic && character === '\\') {
+ queue += character;
+ character = value.charAt(++index);
+ }
+
+ queue += character;
+ index++;
+ }
+}
diff --git a/tools/eslint/node_modules/remark-parse/lib/tokenize/escape.js b/tools/eslint/node_modules/remark-parse/lib/tokenize/escape.js
new file mode 100644
index 0000000000..3e41a4cec5
--- /dev/null
+++ b/tools/eslint/node_modules/remark-parse/lib/tokenize/escape.js
@@ -0,0 +1,43 @@
+/**
+ * @author Titus Wormer
+ * @copyright 2015 Titus Wormer
+ * @license MIT
+ * @module remark:parse:tokenize:escape
+ * @fileoverview Tokenise an escape.
+ */
+
+'use strict';
+
+var locate = require('../locate/escape');
+
+module.exports = escape;
+escape.locator = locate;
+
+/* Tokenise an escape. */
+function escape(eat, value, silent) {
+ var self = this;
+ var character;
+ var node;
+
+ if (value.charAt(0) === '\\') {
+ character = value.charAt(1);
+
+ if (self.escape.indexOf(character) !== -1) {
+ /* istanbul ignore if - never used (yet) */
+ if (silent) {
+ return true;
+ }
+
+ if (character === '\n') {
+ node = {type: 'break'};
+ } else {
+ node = {
+ type: 'text',
+ value: character
+ };
+ }
+
+ return eat('\\' + character)(node);
+ }
+ }
+}
diff --git a/tools/eslint/node_modules/remark-parse/lib/tokenize/footnote-definition.js b/tools/eslint/node_modules/remark-parse/lib/tokenize/footnote-definition.js
new file mode 100644
index 0000000000..3537ccb611
--- /dev/null
+++ b/tools/eslint/node_modules/remark-parse/lib/tokenize/footnote-definition.js
@@ -0,0 +1,194 @@
+/**
+ * @author Titus Wormer
+ * @copyright 2015 Titus Wormer
+ * @license MIT
+ * @module remark:parse:tokenize:footnote-definition
+ * @fileoverview Tokenise footnote definition.
+ */
+
+'use strict';
+
+var whitespace = require('is-whitespace-character');
+var normalize = require('../util/normalize');
+
+module.exports = footnoteDefinition;
+footnoteDefinition.notInList = true;
+footnoteDefinition.notInBlock = true;
+
+var C_BACKSLASH = '\\';
+var C_NEWLINE = '\n';
+var C_TAB = '\t';
+var C_SPACE = ' ';
+var C_BRACKET_OPEN = '[';
+var C_BRACKET_CLOSE = ']';
+var C_CARET = '^';
+var C_COLON = ':';
+
+var EXPRESSION_INITIAL_TAB = /^( {4}|\t)?/gm;
+
+/* Tokenise a footnote definition. */
+function footnoteDefinition(eat, value, silent) {
+ var self = this;
+ var offsets = self.offset;
+ var index;
+ var length;
+ var subvalue;
+ var now;
+ var currentLine;
+ var content;
+ var queue;
+ var subqueue;
+ var character;
+ var identifier;
+ var add;
+ var exit;
+
+ if (!self.options.footnotes) {
+ return;
+ }
+
+ index = 0;
+ length = value.length;
+ subvalue = '';
+ now = eat.now();
+ currentLine = now.line;
+
+ while (index < length) {
+ character = value.charAt(index);
+
+ if (!whitespace(character)) {
+ break;
+ }
+
+ subvalue += character;
+ index++;
+ }
+
+ if (
+ value.charAt(index) !== C_BRACKET_OPEN ||
+ value.charAt(index + 1) !== C_CARET
+ ) {
+ return;
+ }
+
+ subvalue += C_BRACKET_OPEN + C_CARET;
+ index = subvalue.length;
+ queue = '';
+
+ while (index < length) {
+ character = value.charAt(index);
+
+ if (character === C_BRACKET_CLOSE) {
+ break;
+ } else if (character === C_BACKSLASH) {
+ queue += character;
+ index++;
+ character = value.charAt(index);
+ }
+
+ queue += character;
+ index++;
+ }
+
+ if (
+ !queue ||
+ value.charAt(index) !== C_BRACKET_CLOSE ||
+ value.charAt(index + 1) !== C_COLON
+ ) {
+ return;
+ }
+
+ if (silent) {
+ return true;
+ }
+
+ identifier = normalize(queue);
+ subvalue += queue + C_BRACKET_CLOSE + C_COLON;
+ index = subvalue.length;
+
+ while (index < length) {
+ character = value.charAt(index);
+
+ if (character !== C_TAB && character !== C_SPACE) {
+ break;
+ }
+
+ subvalue += character;
+ index++;
+ }
+
+ now.column += subvalue.length;
+ now.offset += subvalue.length;
+ queue = '';
+ content = '';
+ subqueue = '';
+
+ while (index < length) {
+ character = value.charAt(index);
+
+ if (character === C_NEWLINE) {
+ subqueue = character;
+ index++;
+
+ while (index < length) {
+ character = value.charAt(index);
+
+ if (character !== C_NEWLINE) {
+ break;
+ }
+
+ subqueue += character;
+ index++;
+ }
+
+ queue += subqueue;
+ subqueue = '';
+
+ while (index < length) {
+ character = value.charAt(index);
+
+ if (character !== C_SPACE) {
+ break;
+ }
+
+ subqueue += character;
+ index++;
+ }
+
+ if (subqueue.length === 0) {
+ break;
+ }
+
+ queue += subqueue;
+ }
+
+ if (queue) {
+ content += queue;
+ queue = '';
+ }
+
+ content += character;
+ index++;
+ }
+
+ subvalue += content;
+
+ content = content.replace(EXPRESSION_INITIAL_TAB, function (line) {
+ offsets[currentLine] = (offsets[currentLine] || 0) + line.length;
+ currentLine++;
+
+ return '';
+ });
+
+ add = eat(subvalue);
+
+ exit = self.enterBlock();
+ content = self.tokenizeBlock(content, now);
+ exit();
+
+ return add({
+ type: 'footnoteDefinition',
+ identifier: identifier,
+ children: content
+ });
+}
diff --git a/tools/eslint/node_modules/remark-parse/lib/tokenize/heading-atx.js b/tools/eslint/node_modules/remark-parse/lib/tokenize/heading-atx.js
new file mode 100644
index 0000000000..e5fdedc537
--- /dev/null
+++ b/tools/eslint/node_modules/remark-parse/lib/tokenize/heading-atx.js
@@ -0,0 +1,150 @@
+/**
+ * @author Titus Wormer
+ * @copyright 2015 Titus Wormer
+ * @license MIT
+ * @module remark:parse:tokenize:heading-atx
+ * @fileoverview Tokenise an ATX-style heading.
+ */
+
+'use strict';
+
+module.exports = atxHeading;
+
+var C_NEWLINE = '\n';
+var C_TAB = '\t';
+var C_SPACE = ' ';
+var C_HASH = '#';
+
+var MAX_ATX_COUNT = 6;
+
+/* Tokenise an ATX-style heading. */
+function atxHeading(eat, value, silent) {
+ var self = this;
+ var settings = self.options;
+ var length = value.length + 1;
+ var index = -1;
+ var now = eat.now();
+ var subvalue = '';
+ var content = '';
+ var character;
+ var queue;
+ var depth;
+
+ /* Eat initial spacing. */
+ while (++index < length) {
+ character = value.charAt(index);
+
+ if (character !== C_SPACE && character !== C_TAB) {
+ index--;
+ break;
+ }
+
+ subvalue += character;
+ }
+
+ /* Eat hashes. */
+ depth = 0;
+
+ while (++index <= length) {
+ character = value.charAt(index);
+
+ if (character !== C_HASH) {
+ index--;
+ break;
+ }
+
+ subvalue += character;
+ depth++;
+ }
+
+ if (depth > MAX_ATX_COUNT) {
+ return;
+ }
+
+ if (
+ !depth ||
+ (!settings.pedantic && value.charAt(index + 1) === C_HASH)
+ ) {
+ return;
+ }
+
+ length = value.length + 1;
+
+ /* Eat intermediate white-space. */
+ queue = '';
+
+ while (++index < length) {
+ character = value.charAt(index);
+
+ if (character !== C_SPACE && character !== C_TAB) {
+ index--;
+ break;
+ }
+
+ queue += character;
+ }
+
+ /* Exit when not in pedantic mode without spacing. */
+ if (
+ !settings.pedantic &&
+ queue.length === 0 &&
+ character &&
+ character !== C_NEWLINE
+ ) {
+ return;
+ }
+
+ if (silent) {
+ return true;
+ }
+
+ /* Eat content. */
+ subvalue += queue;
+ queue = '';
+ content = '';
+
+ while (++index < length) {
+ character = value.charAt(index);
+
+ if (!character || character === C_NEWLINE) {
+ break;
+ }
+
+ if (
+ character !== C_SPACE &&
+ character !== C_TAB &&
+ character !== C_HASH
+ ) {
+ content += queue + character;
+ queue = '';
+ continue;
+ }
+
+ while (character === C_SPACE || character === C_TAB) {
+ queue += character;
+ character = value.charAt(++index);
+ }
+
+ while (character === C_HASH) {
+ queue += character;
+ character = value.charAt(++index);
+ }
+
+ while (character === C_SPACE || character === C_TAB) {
+ queue += character;
+ character = value.charAt(++index);
+ }
+
+ index--;
+ }
+
+ now.column += subvalue.length;
+ now.offset += subvalue.length;
+ subvalue += content + queue;
+
+ return eat(subvalue)({
+ type: 'heading',
+ depth: depth,
+ children: self.tokenizeInline(content, now)
+ });
+}
diff --git a/tools/eslint/node_modules/remark-parse/lib/tokenize/heading-setext.js b/tools/eslint/node_modules/remark-parse/lib/tokenize/heading-setext.js
new file mode 100644
index 0000000000..db8bbcfb73
--- /dev/null
+++ b/tools/eslint/node_modules/remark-parse/lib/tokenize/heading-setext.js
@@ -0,0 +1,116 @@
+/**
+ * @author Titus Wormer
+ * @copyright 2015 Titus Wormer
+ * @license MIT
+ * @module remark:parse:tokenize:heading-setext
+ * @fileoverview Tokenise an setext-style heading.
+ */
+
+'use strict';
+
+module.exports = setextHeading;
+
+var C_NEWLINE = '\n';
+var C_TAB = '\t';
+var C_SPACE = ' ';
+var C_EQUALS = '=';
+var C_DASH = '-';
+
+var MAX_HEADING_INDENT = 3;
+
+/* Map of characters which can be used to mark setext
+ * headers, mapping to their corresponding depth. */
+var SETEXT_MARKERS = {};
+
+SETEXT_MARKERS[C_EQUALS] = 1;
+SETEXT_MARKERS[C_DASH] = 2;
+
+/* Tokenise an setext-style heading. */
+function setextHeading(eat, value, silent) {
+ var self = this;
+ var now = eat.now();
+ var length = value.length;
+ var index = -1;
+ var subvalue = '';
+ var content;
+ var queue;
+ var character;
+ var marker;
+ var depth;
+
+ /* Eat initial indentation. */
+ while (++index < length) {
+ character = value.charAt(index);
+
+ if (character !== C_SPACE || index >= MAX_HEADING_INDENT) {
+ index--;
+ break;
+ }
+
+ subvalue += character;
+ }
+
+ /* Eat content. */
+ content = '';
+ queue = '';
+
+ while (++index < length) {
+ character = value.charAt(index);
+
+ if (character === C_NEWLINE) {
+ index--;
+ break;
+ }
+
+ if (character === C_SPACE || character === C_TAB) {
+ queue += character;
+ } else {
+ content += queue + character;
+ queue = '';
+ }
+ }
+
+ now.column += subvalue.length;
+ now.offset += subvalue.length;
+ subvalue += content + queue;
+
+ /* Ensure the content is followed by a newline and a
+ * valid marker. */
+ character = value.charAt(++index);
+ marker = value.charAt(++index);
+
+ if (character !== C_NEWLINE || !SETEXT_MARKERS[marker]) {
+ return;
+ }
+
+ subvalue += character;
+
+ /* Eat Setext-line. */
+ queue = marker;
+ depth = SETEXT_MARKERS[marker];
+
+ while (++index < length) {
+ character = value.charAt(index);
+
+ if (character !== marker) {
+ if (character !== C_NEWLINE) {
+ return;
+ }
+
+ index--;
+ break;
+ }
+
+ queue += character;
+ }
+
+ if (silent) {
+ return true;
+ }
+
+ return eat(subvalue + queue)({
+ type: 'heading',
+ depth: depth,
+ children: self.tokenizeInline(content, now)
+ });
+}
diff --git a/tools/eslint/node_modules/remark-parse/lib/tokenize/html-block.js b/tools/eslint/node_modules/remark-parse/lib/tokenize/html-block.js
new file mode 100644
index 0000000000..dc861b53c3
--- /dev/null
+++ b/tools/eslint/node_modules/remark-parse/lib/tokenize/html-block.js
@@ -0,0 +1,103 @@
+/**
+ * @author Titus Wormer
+ * @copyright 2015 Titus Wormer
+ * @license MIT
+ * @module remark:parse:tokenize:html-block
+ * @fileoverview Tokenise block HTML.
+ */
+
+'use strict';
+
+var openCloseTag = require('../util/html').openCloseTag;
+
+module.exports = blockHTML;
+
+var C_TAB = '\t';
+var C_SPACE = ' ';
+var C_NEWLINE = '\n';
+var C_LT = '<';
+
+/* Tokenise block HTML. */
+function blockHTML(eat, value, silent) {
+ var self = this;
+ var blocks = self.options.blocks;
+ var length = value.length;
+ var index = 0;
+ var next;
+ var line;
+ var offset;
+ var character;
+ var count;
+ var sequence;
+ var subvalue;
+
+ var sequences = [
+ [/^<(script|pre|style)(?=(\s|>|$))/i, /<\/(script|pre|style)>/i, true],
+ [/^<!--/, /-->/, true],
+ [/^<\?/, /\?>/, true],
+ [/^<![A-Za-z]/, />/, true],
+ [/^<!\[CDATA\[/, /\]\]>/, true],
+ [new RegExp('^</?(' + blocks.join('|') + ')(?=(\\s|/?>|$))', 'i'), /^$/, true],
+ [new RegExp(openCloseTag.source + '\\s*$'), /^$/, false]
+ ];
+
+ /* Eat initial spacing. */
+ while (index < length) {
+ character = value.charAt(index);
+
+ if (character !== C_TAB && character !== C_SPACE) {
+ break;
+ }
+
+ index++;
+ }
+
+ if (value.charAt(index) !== C_LT) {
+ return;
+ }
+
+ next = value.indexOf(C_NEWLINE, index + 1);
+ next = next === -1 ? length : next;
+ line = value.slice(index, next);
+ offset = -1;
+ count = sequences.length;
+
+ while (++offset < count) {
+ if (sequences[offset][0].test(line)) {
+ sequence = sequences[offset];
+ break;
+ }
+ }
+
+ if (!sequence) {
+ return;
+ }
+
+ if (silent) {
+ return sequence[2];
+ }
+
+ index = next;
+
+ if (!sequence[1].test(line)) {
+ while (index < length) {
+ next = value.indexOf(C_NEWLINE, index + 1);
+ next = next === -1 ? length : next;
+ line = value.slice(index + 1, next);
+
+ if (sequence[1].test(line)) {
+ if (line) {
+ index = next;
+ }
+
+ break;
+ }
+
+ index = next;
+ }
+ }
+
+ subvalue = value.slice(0, index);
+
+ return eat(subvalue)({type: 'html', value: subvalue});
+}
diff --git a/tools/eslint/node_modules/remark-parse/lib/tokenize/html-inline.js b/tools/eslint/node_modules/remark-parse/lib/tokenize/html-inline.js
new file mode 100644
index 0000000000..d8c0b9ab21
--- /dev/null
+++ b/tools/eslint/node_modules/remark-parse/lib/tokenize/html-inline.js
@@ -0,0 +1,63 @@
+/**
+ * @author Titus Wormer
+ * @copyright 2015 Titus Wormer
+ * @license MIT
+ * @module remark:parse:tokenize:html-inline
+ * @fileoverview Tokenise inline HTML.
+ */
+
+'use strict';
+
+var alphabetical = require('is-alphabetical');
+var locate = require('../locate/tag');
+var tag = require('../util/html').tag;
+
+module.exports = inlineHTML;
+inlineHTML.locator = locate;
+
+var EXPRESSION_HTML_LINK_OPEN = /^<a /i;
+var EXPRESSION_HTML_LINK_CLOSE = /^<\/a>/i;
+
+/* Tokenise inline HTML. */
+function inlineHTML(eat, value, silent) {
+ var self = this;
+ var length = value.length;
+ var character;
+ var subvalue;
+
+ if (value.charAt(0) !== '<' || length < 3) {
+ return;
+ }
+
+ character = value.charAt(1);
+
+ if (
+ !alphabetical(character) &&
+ character !== '?' &&
+ character !== '!' &&
+ character !== '/'
+ ) {
+ return;
+ }
+
+ subvalue = value.match(tag);
+
+ if (!subvalue) {
+ return;
+ }
+
+ /* istanbul ignore if - not used yet. */
+ if (silent) {
+ return true;
+ }
+
+ subvalue = subvalue[0];
+
+ if (!self.inLink && EXPRESSION_HTML_LINK_OPEN.test(subvalue)) {
+ self.inLink = true;
+ } else if (self.inLink && EXPRESSION_HTML_LINK_CLOSE.test(subvalue)) {
+ self.inLink = false;
+ }
+
+ return eat(subvalue)({type: 'html', value: subvalue});
+}
diff --git a/tools/eslint/node_modules/remark-parse/lib/tokenize/link.js b/tools/eslint/node_modules/remark-parse/lib/tokenize/link.js
new file mode 100644
index 0000000000..fb11c50990
--- /dev/null
+++ b/tools/eslint/node_modules/remark-parse/lib/tokenize/link.js
@@ -0,0 +1,399 @@
+/**
+ * @author Titus Wormer
+ * @copyright 2015 Titus Wormer
+ * @license MIT
+ * @module remark:parse:tokenize:link
+ * @fileoverview Tokenise a link.
+ */
+
+'use strict';
+
+var has = require('has');
+var whitespace = require('is-whitespace-character');
+var locate = require('../locate/link');
+
+module.exports = link;
+link.locator = locate;
+
+var C_BACKSLASH = '\\';
+var C_BRACKET_OPEN = '[';
+var C_BRACKET_CLOSE = ']';
+var C_PAREN_OPEN = '(';
+var C_PAREN_CLOSE = ')';
+var C_LT = '<';
+var C_GT = '>';
+var C_TICK = '`';
+var C_DOUBLE_QUOTE = '"';
+var C_SINGLE_QUOTE = '\'';
+
+/* Map of characters, which can be used to mark link
+ * and image titles. */
+var LINK_MARKERS = {};
+
+LINK_MARKERS[C_DOUBLE_QUOTE] = C_DOUBLE_QUOTE;
+LINK_MARKERS[C_SINGLE_QUOTE] = C_SINGLE_QUOTE;
+
+/* Map of characters, which can be used to mark link
+ * and image titles in commonmark-mode. */
+var COMMONMARK_LINK_MARKERS = {};
+
+COMMONMARK_LINK_MARKERS[C_DOUBLE_QUOTE] = C_DOUBLE_QUOTE;
+COMMONMARK_LINK_MARKERS[C_SINGLE_QUOTE] = C_SINGLE_QUOTE;
+COMMONMARK_LINK_MARKERS[C_PAREN_OPEN] = C_PAREN_CLOSE;
+
+/* Tokenise a link. */
+function link(eat, value, silent) {
+ var self = this;
+ var subvalue = '';
+ var index = 0;
+ var character = value.charAt(0);
+ var commonmark = self.options.commonmark;
+ var gfm = self.options.gfm;
+ var closed;
+ var count;
+ var opening;
+ var beforeURL;
+ var beforeTitle;
+ var subqueue;
+ var hasMarker;
+ var markers;
+ var isImage;
+ var content;
+ var marker;
+ var length;
+ var title;
+ var depth;
+ var queue;
+ var url;
+ var now;
+ var exit;
+ var node;
+
+ /* Detect whether this is an image. */
+ if (character === '!') {
+ isImage = true;
+ subvalue = character;
+ character = value.charAt(++index);
+ }
+
+ /* Eat the opening. */
+ if (character !== C_BRACKET_OPEN) {
+ return;
+ }
+
+ /* Exit when this is a link and we’re already inside
+ * a link. */
+ if (!isImage && self.inLink) {
+ return;
+ }
+
+ subvalue += character;
+ queue = '';
+ index++;
+
+ /* Eat the content. */
+ length = value.length;
+ now = eat.now();
+ depth = 0;
+
+ now.column += index;
+ now.offset += index;
+
+ while (index < length) {
+ character = value.charAt(index);
+ subqueue = character;
+
+ if (character === C_TICK) {
+ /* Inline-code in link content. */
+ count = 1;
+
+ while (value.charAt(index + 1) === C_TICK) {
+ subqueue += character;
+ index++;
+ count++;
+ }
+
+ if (!opening) {
+ opening = count;
+ } else if (count >= opening) {
+ opening = 0;
+ }
+ } else if (character === C_BACKSLASH) {
+ /* Allow brackets to be escaped. */
+ index++;
+ subqueue += value.charAt(index);
+ /* In GFM mode, brackets in code still count.
+ * In all other modes, they don’t. This empty
+ * block prevents the next statements are
+ * entered. */
+ } else if ((!opening || gfm) && character === C_BRACKET_OPEN) {
+ depth++;
+ } else if ((!opening || gfm) && character === C_BRACKET_CLOSE) {
+ if (depth) {
+ depth--;
+ } else {
+ /* Allow white-space between content and
+ * url in GFM mode. */
+ if (gfm) {
+ while (index < length) {
+ character = value.charAt(index + 1);
+
+ if (!whitespace(character)) {
+ break;
+ }
+
+ subqueue += character;
+ index++;
+ }
+ }
+
+ if (value.charAt(index + 1) !== C_PAREN_OPEN) {
+ return;
+ }
+
+ subqueue += C_PAREN_OPEN;
+ closed = true;
+ index++;
+
+ break;
+ }
+ }
+
+ queue += subqueue;
+ subqueue = '';
+ index++;
+ }
+
+ /* Eat the content closing. */
+ if (!closed) {
+ return;
+ }
+
+ content = queue;
+ subvalue += queue + subqueue;
+ index++;
+
+ /* Eat white-space. */
+ while (index < length) {
+ character = value.charAt(index);
+
+ if (!whitespace(character)) {
+ break;
+ }
+
+ subvalue += character;
+ index++;
+ }
+
+ /* Eat the URL. */
+ character = value.charAt(index);
+ markers = commonmark ? COMMONMARK_LINK_MARKERS : LINK_MARKERS;
+ queue = '';
+ beforeURL = subvalue;
+
+ if (character === C_LT) {
+ index++;
+ beforeURL += C_LT;
+
+ while (index < length) {
+ character = value.charAt(index);
+
+ if (character === C_GT) {
+ break;
+ }
+
+ if (commonmark && character === '\n') {
+ return;
+ }
+
+ queue += character;
+ index++;
+ }
+
+ if (value.charAt(index) !== C_GT) {
+ return;
+ }
+
+ subvalue += C_LT + queue + C_GT;
+ url = queue;
+ index++;
+ } else {
+ character = null;
+ subqueue = '';
+
+ while (index < length) {
+ character = value.charAt(index);
+
+ if (subqueue && has(markers, character)) {
+ break;
+ }
+
+ if (whitespace(character)) {
+ if (commonmark) {
+ break;
+ }
+
+ subqueue += character;
+ } else {
+ if (character === C_PAREN_OPEN) {
+ depth++;
+ } else if (character === C_PAREN_CLOSE) {
+ if (depth === 0) {
+ break;
+ }
+
+ depth--;
+ }
+
+ queue += subqueue;
+ subqueue = '';
+
+ if (character === C_BACKSLASH) {
+ queue += C_BACKSLASH;
+ character = value.charAt(++index);
+ }
+
+ queue += character;
+ }
+
+ index++;
+ }
+
+ subvalue += queue;
+ url = queue;
+ index = subvalue.length;
+ }
+
+ /* Eat white-space. */
+ queue = '';
+
+ while (index < length) {
+ character = value.charAt(index);
+
+ if (!whitespace(character)) {
+ break;
+ }
+
+ queue += character;
+ index++;
+ }
+
+ character = value.charAt(index);
+ subvalue += queue;
+
+ /* Eat the title. */
+ if (queue && has(markers, character)) {
+ index++;
+ subvalue += character;
+ queue = '';
+ marker = markers[character];
+ beforeTitle = subvalue;
+
+ /* In commonmark-mode, things are pretty easy: the
+ * marker cannot occur inside the title.
+ *
+ * Non-commonmark does, however, support nested
+ * delimiters. */
+ if (commonmark) {
+ while (index < length) {
+ character = value.charAt(index);
+
+ if (character === marker) {
+ break;
+ }
+
+ if (character === C_BACKSLASH) {
+ queue += C_BACKSLASH;
+ character = value.charAt(++index);
+ }
+
+ index++;
+ queue += character;
+ }
+
+ character = value.charAt(index);
+
+ if (character !== marker) {
+ return;
+ }
+
+ title = queue;
+ subvalue += queue + character;
+ index++;
+
+ while (index < length) {
+ character = value.charAt(index);
+
+ if (!whitespace(character)) {
+ break;
+ }
+
+ subvalue += character;
+ index++;
+ }
+ } else {
+ subqueue = '';
+
+ while (index < length) {
+ character = value.charAt(index);
+
+ if (character === marker) {
+ if (hasMarker) {
+ queue += marker + subqueue;
+ subqueue = '';
+ }
+
+ hasMarker = true;
+ } else if (!hasMarker) {
+ queue += character;
+ } else if (character === C_PAREN_CLOSE) {
+ subvalue += queue + marker + subqueue;
+ title = queue;
+ break;
+ } else if (whitespace(character)) {
+ subqueue += character;
+ } else {
+ queue += marker + subqueue + character;
+ subqueue = '';
+ hasMarker = false;
+ }
+
+ index++;
+ }
+ }
+ }
+
+ if (value.charAt(index) !== C_PAREN_CLOSE) {
+ return;
+ }
+
+ /* istanbul ignore if - never used (yet) */
+ if (silent) {
+ return true;
+ }
+
+ subvalue += C_PAREN_CLOSE;
+
+ url = self.decode.raw(self.unescape(url), eat(beforeURL).test().end);
+
+ if (title) {
+ beforeTitle = eat(beforeTitle).test().end;
+ title = self.decode.raw(self.unescape(title), beforeTitle);
+ }
+
+ node = {
+ type: isImage ? 'image' : 'link',
+ title: title || null,
+ url: url
+ };
+
+ if (isImage) {
+ node.alt = self.decode.raw(self.unescape(content), now) || null;
+ } else {
+ exit = self.enterLink();
+ node.children = self.tokenizeInline(content, now);
+ exit();
+ }
+
+ return eat(subvalue)(node);
+}
diff --git a/tools/eslint/node_modules/remark-parse/lib/tokenize/list.js b/tools/eslint/node_modules/remark-parse/lib/tokenize/list.js
new file mode 100644
index 0000000000..da8002e574
--- /dev/null
+++ b/tools/eslint/node_modules/remark-parse/lib/tokenize/list.js
@@ -0,0 +1,494 @@
+/**
+ * @author Titus Wormer
+ * @copyright 2015 Titus Wormer
+ * @license MIT
+ * @module remark:parse:tokenize:list
+ * @fileoverview Tokenise a list.
+ */
+
+'use strict';
+
+/* eslint-disable max-params */
+
+var trim = require('trim');
+var repeat = require('repeat-string');
+var decimal = require('is-decimal');
+var getIndent = require('../util/get-indentation');
+var removeIndent = require('../util/remove-indentation');
+var interrupt = require('../util/interrupt');
+
+module.exports = list;
+
+var C_ASTERISK = '*';
+var C_UNDERSCORE = '_';
+var C_PLUS = '+';
+var C_DASH = '-';
+var C_DOT = '.';
+var C_SPACE = ' ';
+var C_NEWLINE = '\n';
+var C_TAB = '\t';
+var C_PAREN_CLOSE = ')';
+var C_X_LOWER = 'x';
+
+var TAB_SIZE = 4;
+var EXPRESSION_LOOSE_LIST_ITEM = /\n\n(?!\s*$)/;
+var EXPRESSION_TASK_ITEM = /^\[([ \t]|x|X)][ \t]/;
+var EXPRESSION_BULLET = /^([ \t]*)([*+-]|\d+[.)])( {1,4}(?! )| |\t|$|(?=\n))([^\n]*)/;
+var EXPRESSION_PEDANTIC_BULLET = /^([ \t]*)([*+-]|\d+[.)])([ \t]+)/;
+var EXPRESSION_INITIAL_INDENT = /^( {1,4}|\t)?/gm;
+
+/* Map of characters which can be used to mark
+ * list-items. */
+var LIST_UNORDERED_MARKERS = {};
+
+LIST_UNORDERED_MARKERS[C_ASTERISK] = true;
+LIST_UNORDERED_MARKERS[C_PLUS] = true;
+LIST_UNORDERED_MARKERS[C_DASH] = true;
+
+/* Map of characters which can be used to mark
+ * list-items after a digit. */
+var LIST_ORDERED_MARKERS = {};
+
+LIST_ORDERED_MARKERS[C_DOT] = true;
+
+/* Map of characters which can be used to mark
+ * list-items after a digit. */
+var LIST_ORDERED_COMMONMARK_MARKERS = {};
+
+LIST_ORDERED_COMMONMARK_MARKERS[C_DOT] = true;
+LIST_ORDERED_COMMONMARK_MARKERS[C_PAREN_CLOSE] = true;
+
+/* Tokenise a list. */
+function list(eat, value, silent) {
+ var self = this;
+ var commonmark = self.options.commonmark;
+ var pedantic = self.options.pedantic;
+ var tokenizers = self.blockTokenizers;
+ var interuptors = self.interruptList;
+ var markers;
+ var index = 0;
+ var length = value.length;
+ var start = null;
+ var size = 0;
+ var queue;
+ var ordered;
+ var character;
+ var marker;
+ var nextIndex;
+ var startIndex;
+ var prefixed;
+ var currentMarker;
+ var content;
+ var line;
+ var prevEmpty;
+ var empty;
+ var items;
+ var allLines;
+ var emptyLines;
+ var item;
+ var enterTop;
+ var exitBlockquote;
+ var isLoose;
+ var node;
+ var now;
+ var end;
+ var indented;
+
+ while (index < length) {
+ character = value.charAt(index);
+
+ if (character === C_TAB) {
+ size += TAB_SIZE - (size % TAB_SIZE);
+ } else if (character === C_SPACE) {
+ size++;
+ } else {
+ break;
+ }
+
+ index++;
+ }
+
+ if (size >= TAB_SIZE) {
+ return;
+ }
+
+ character = value.charAt(index);
+
+ markers = commonmark ?
+ LIST_ORDERED_COMMONMARK_MARKERS :
+ LIST_ORDERED_MARKERS;
+
+ if (LIST_UNORDERED_MARKERS[character] === true) {
+ marker = character;
+ ordered = false;
+ } else {
+ ordered = true;
+ queue = '';
+
+ while (index < length) {
+ character = value.charAt(index);
+
+ if (!decimal(character)) {
+ break;
+ }
+
+ queue += character;
+ index++;
+ }
+
+ character = value.charAt(index);
+
+ if (!queue || markers[character] !== true) {
+ return;
+ }
+
+ start = parseInt(queue, 10);
+ marker = character;
+ }
+
+ character = value.charAt(++index);
+
+ if (character !== C_SPACE && character !== C_TAB) {
+ return;
+ }
+
+ if (silent) {
+ return true;
+ }
+
+ index = 0;
+ items = [];
+ allLines = [];
+ emptyLines = [];
+
+ while (index < length) {
+ nextIndex = value.indexOf(C_NEWLINE, index);
+ startIndex = index;
+ prefixed = false;
+ indented = false;
+
+ if (nextIndex === -1) {
+ nextIndex = length;
+ }
+
+ end = index + TAB_SIZE;
+ size = 0;
+
+ while (index < length) {
+ character = value.charAt(index);
+
+ if (character === C_TAB) {
+ size += TAB_SIZE - (size % TAB_SIZE);
+ } else if (character === C_SPACE) {
+ size++;
+ } else {
+ break;
+ }
+
+ index++;
+ }
+
+ if (size >= TAB_SIZE) {
+ indented = true;
+ }
+
+ if (item && size >= item.indent) {
+ indented = true;
+ }
+
+ character = value.charAt(index);
+ currentMarker = null;
+
+ if (!indented) {
+ if (LIST_UNORDERED_MARKERS[character] === true) {
+ currentMarker = character;
+ index++;
+ size++;
+ } else {
+ queue = '';
+
+ while (index < length) {
+ character = value.charAt(index);
+
+ if (!decimal(character)) {
+ break;
+ }
+
+ queue += character;
+ index++;
+ }
+
+ character = value.charAt(index);
+ index++;
+
+ if (queue && markers[character] === true) {
+ currentMarker = character;
+ size += queue.length + 1;
+ }
+ }
+
+ if (currentMarker) {
+ character = value.charAt(index);
+
+ if (character === C_TAB) {
+ size += TAB_SIZE - (size % TAB_SIZE);
+ index++;
+ } else if (character === C_SPACE) {
+ end = index + TAB_SIZE;
+
+ while (index < end) {
+ if (value.charAt(index) !== C_SPACE) {
+ break;
+ }
+
+ index++;
+ size++;
+ }
+
+ if (index === end && value.charAt(index) === C_SPACE) {
+ index -= TAB_SIZE - 1;
+ size -= TAB_SIZE - 1;
+ }
+ } else if (character !== C_NEWLINE && character !== '') {
+ currentMarker = null;
+ }
+ }
+ }
+
+ if (currentMarker) {
+ if (!pedantic && marker !== currentMarker) {
+ break;
+ }
+
+ prefixed = true;
+ } else {
+ if (!commonmark && !indented && value.charAt(startIndex) === C_SPACE) {
+ indented = true;
+ } else if (commonmark && item) {
+ indented = size >= item.indent || size > TAB_SIZE;
+ }
+
+ prefixed = false;
+ index = startIndex;
+ }
+
+ line = value.slice(startIndex, nextIndex);
+ content = startIndex === index ? line : value.slice(index, nextIndex);
+
+ if (
+ currentMarker === C_ASTERISK ||
+ currentMarker === C_UNDERSCORE ||
+ currentMarker === C_DASH
+ ) {
+ if (tokenizers.thematicBreak.call(self, eat, line, true)) {
+ break;
+ }
+ }
+
+ prevEmpty = empty;
+ empty = !trim(content).length;
+
+ if (indented && item) {
+ item.value = item.value.concat(emptyLines, line);
+ allLines = allLines.concat(emptyLines, line);
+ emptyLines = [];
+ } else if (prefixed) {
+ if (emptyLines.length !== 0) {
+ item.value.push('');
+ item.trail = emptyLines.concat();
+ }
+
+ item = {
+ value: [line],
+ indent: size,
+ trail: []
+ };
+
+ items.push(item);
+ allLines = allLines.concat(emptyLines, line);
+ emptyLines = [];
+ } else if (empty) {
+ if (prevEmpty) {
+ break;
+ }
+
+ emptyLines.push(line);
+ } else {
+ if (prevEmpty) {
+ break;
+ }
+
+ if (interrupt(interuptors, tokenizers, self, [eat, line, true])) {
+ break;
+ }
+
+ item.value = item.value.concat(emptyLines, line);
+ allLines = allLines.concat(emptyLines, line);
+ emptyLines = [];
+ }
+
+ index = nextIndex + 1;
+ }
+
+ node = eat(allLines.join(C_NEWLINE)).reset({
+ type: 'list',
+ ordered: ordered,
+ start: start,
+ loose: null,
+ children: []
+ });
+
+ enterTop = self.enterList();
+ exitBlockquote = self.enterBlock();
+ isLoose = false;
+ index = -1;
+ length = items.length;
+
+ while (++index < length) {
+ item = items[index].value.join(C_NEWLINE);
+ now = eat.now();
+
+ item = eat(item)(listItem(self, item, now), node);
+
+ if (item.loose) {
+ isLoose = true;
+ }
+
+ item = items[index].trail.join(C_NEWLINE);
+
+ if (index !== length - 1) {
+ item += C_NEWLINE;
+ }
+
+ eat(item);
+ }
+
+ enterTop();
+ exitBlockquote();
+
+ node.loose = isLoose;
+
+ return node;
+}
+
+/**
+ * Create a list-item node.
+ *
+ * @example
+ * listItem('- _foo_', now());
+ *
+ * @param {Object} ctx - Parser.
+ * @param {Object} value - List-item.
+ * @param {Object} position - List-item location.
+ * @return {Object} - `listItem` node.
+ */
+function listItem(ctx, value, position) {
+ var offsets = ctx.offset;
+ var fn = ctx.options.pedantic ? pedanticListItem : normalListItem;
+ var checked = null;
+ var task;
+ var indent;
+
+ value = fn.apply(null, arguments);
+
+ if (ctx.options.gfm) {
+ task = value.match(EXPRESSION_TASK_ITEM);
+
+ if (task) {
+ indent = task[0].length;
+ checked = task[1].toLowerCase() === C_X_LOWER;
+ offsets[position.line] += indent;
+ value = value.slice(indent);
+ }
+ }
+
+ return {
+ type: 'listItem',
+ loose: EXPRESSION_LOOSE_LIST_ITEM.test(value) ||
+ value.charAt(value.length - 1) === C_NEWLINE,
+ checked: checked,
+ children: ctx.tokenizeBlock(value, position)
+ };
+}
+
+/* Create a list-item using overly simple mechanics. */
+function pedanticListItem(ctx, value, position) {
+ var offsets = ctx.offset;
+ var line = position.line;
+
+ /* Remove the list-item’s bullet. */
+ value = value.replace(EXPRESSION_PEDANTIC_BULLET, replacer);
+
+ /* The initial line was also matched by the below, so
+ * we reset the `line`. */
+ line = position.line;
+
+ return value.replace(EXPRESSION_INITIAL_INDENT, replacer);
+
+ /* A simple replacer which removed all matches,
+ * and adds their length to `offset`. */
+ function replacer($0) {
+ offsets[line] = (offsets[line] || 0) + $0.length;
+ line++;
+
+ return '';
+ }
+}
+
+/* Create a list-item using sane mechanics. */
+function normalListItem(ctx, value, position) {
+ var offsets = ctx.offset;
+ var line = position.line;
+ var max;
+ var bullet;
+ var rest;
+ var lines;
+ var trimmedLines;
+ var index;
+ var length;
+
+ /* Remove the list-item’s bullet. */
+ value = value.replace(EXPRESSION_BULLET, replacer);
+
+ lines = value.split(C_NEWLINE);
+
+ trimmedLines = removeIndent(value, getIndent(max).indent).split(C_NEWLINE);
+
+ /* We replaced the initial bullet with something
+ * else above, which was used to trick
+ * `removeIndentation` into removing some more
+ * characters when possible. However, that could
+ * result in the initial line to be stripped more
+ * than it should be. */
+ trimmedLines[0] = rest;
+
+ offsets[line] = (offsets[line] || 0) + bullet.length;
+ line++;
+
+ index = 0;
+ length = lines.length;
+
+ while (++index < length) {
+ offsets[line] = (offsets[line] || 0) +
+ lines[index].length - trimmedLines[index].length;
+ line++;
+ }
+
+ return trimmedLines.join(C_NEWLINE);
+
+ function replacer($0, $1, $2, $3, $4) {
+ bullet = $1 + $2 + $3;
+ rest = $4;
+
+ /* Make sure that the first nine numbered list items
+ * can indent with an extra space. That is, when
+ * the bullet did not receive an extra final space. */
+ if (Number($2) < 10 && bullet.length % 2 === 1) {
+ $2 = C_SPACE + $2;
+ }
+
+ max = $1 + repeat(C_SPACE, $2.length) + $3;
+
+ return max + rest;
+ }
+}
diff --git a/tools/eslint/node_modules/remark-parse/lib/tokenize/newline.js b/tools/eslint/node_modules/remark-parse/lib/tokenize/newline.js
new file mode 100644
index 0000000000..f710e0ef97
--- /dev/null
+++ b/tools/eslint/node_modules/remark-parse/lib/tokenize/newline.js
@@ -0,0 +1,55 @@
+/**
+ * @author Titus Wormer
+ * @copyright 2015 Titus Wormer
+ * @license MIT
+ * @module remark:parse:tokenize:newline
+ * @fileoverview Tokenise a newline.
+ */
+
+'use strict';
+
+var whitespace = require('is-whitespace-character');
+
+module.exports = newline;
+
+/* Tokenise newline. */
+function newline(eat, value, silent) {
+ var character = value.charAt(0);
+ var length;
+ var subvalue;
+ var queue;
+ var index;
+
+ if (character !== '\n') {
+ return;
+ }
+
+ /* istanbul ignore if - never used (yet) */
+ if (silent) {
+ return true;
+ }
+
+ index = 1;
+ length = value.length;
+ subvalue = character;
+ queue = '';
+
+ while (index < length) {
+ character = value.charAt(index);
+
+ if (!whitespace(character)) {
+ break;
+ }
+
+ queue += character;
+
+ if (character === '\n') {
+ subvalue += queue;
+ queue = '';
+ }
+
+ index++;
+ }
+
+ eat(subvalue);
+}
diff --git a/tools/eslint/node_modules/remark-parse/lib/tokenize/paragraph.js b/tools/eslint/node_modules/remark-parse/lib/tokenize/paragraph.js
new file mode 100644
index 0000000000..7d064522ff
--- /dev/null
+++ b/tools/eslint/node_modules/remark-parse/lib/tokenize/paragraph.js
@@ -0,0 +1,130 @@
+/**
+ * @author Titus Wormer
+ * @copyright 2015 Titus Wormer
+ * @license MIT
+ * @module remark:parse:tokenize:paragraph
+ * @fileoverview Tokenise a paragraph.
+ */
+
+'use strict';
+
+var trim = require('trim');
+var decimal = require('is-decimal');
+var trimTrailingLines = require('trim-trailing-lines');
+var interrupt = require('../util/interrupt');
+
+module.exports = paragraph;
+
+var C_NEWLINE = '\n';
+var C_TAB = '\t';
+var C_SPACE = ' ';
+
+var TAB_SIZE = 4;
+
+/* Tokenise paragraph. */
+function paragraph(eat, value, silent) {
+ var self = this;
+ var settings = self.options;
+ var commonmark = settings.commonmark;
+ var gfm = settings.gfm;
+ var tokenizers = self.blockTokenizers;
+ var interruptors = self.interruptParagraph;
+ var index = value.indexOf(C_NEWLINE);
+ var length = value.length;
+ var position;
+ var subvalue;
+ var character;
+ var size;
+ var now;
+
+ while (index < length) {
+ /* Eat everything if there’s no following newline. */
+ if (index === -1) {
+ index = length;
+ break;
+ }
+
+ /* Stop if the next character is NEWLINE. */
+ if (value.charAt(index + 1) === C_NEWLINE) {
+ break;
+ }
+
+ /* In commonmark-mode, following indented lines
+ * are part of the paragraph. */
+ if (commonmark) {
+ size = 0;
+ position = index + 1;
+
+ while (position < length) {
+ character = value.charAt(position);
+
+ if (character === C_TAB) {
+ size = TAB_SIZE;
+ break;
+ } else if (character === C_SPACE) {
+ size++;
+ } else {
+ break;
+ }
+
+ position++;
+ }
+
+ if (size >= TAB_SIZE) {
+ index = value.indexOf(C_NEWLINE, index + 1);
+ continue;
+ }
+ }
+
+ subvalue = value.slice(index + 1);
+
+ /* Check if the following code contains a possible
+ * block. */
+ if (interrupt(interruptors, tokenizers, self, [eat, subvalue, true])) {
+ break;
+ }
+
+ /* Break if the following line starts a list, when
+ * already in a list, or when in commonmark, or when
+ * in gfm mode and the bullet is *not* numeric. */
+ if (
+ tokenizers.list.call(self, eat, subvalue, true) &&
+ (
+ self.inList ||
+ commonmark ||
+ (gfm && !decimal(trim.left(subvalue).charAt(0)))
+ )
+ ) {
+ break;
+ }
+
+ position = index;
+ index = value.indexOf(C_NEWLINE, index + 1);
+
+ if (index !== -1 && trim(value.slice(position, index)) === '') {
+ index = position;
+ break;
+ }
+ }
+
+ subvalue = value.slice(0, index);
+
+ if (trim(subvalue) === '') {
+ eat(subvalue);
+
+ return null;
+ }
+
+ /* istanbul ignore if - never used (yet) */
+ if (silent) {
+ return true;
+ }
+
+ now = eat.now();
+ subvalue = trimTrailingLines(subvalue);
+
+ return eat(subvalue)({
+ type: 'paragraph',
+ children: self.tokenizeInline(subvalue, now)
+ });
+}
diff --git a/tools/eslint/node_modules/remark-parse/lib/tokenize/reference.js b/tools/eslint/node_modules/remark-parse/lib/tokenize/reference.js
new file mode 100644
index 0000000000..1fa150d9e6
--- /dev/null
+++ b/tools/eslint/node_modules/remark-parse/lib/tokenize/reference.js
@@ -0,0 +1,219 @@
+/**
+ * @author Titus Wormer
+ * @copyright 2015 Titus Wormer
+ * @license MIT
+ * @module remark:parse:tokenize:reference
+ * @fileoverview Tokenise a reference.
+ */
+
+'use strict';
+
+var whitespace = require('is-whitespace-character');
+var locate = require('../locate/link');
+var normalize = require('../util/normalize');
+
+module.exports = reference;
+reference.locator = locate;
+
+var T_LINK = 'link';
+var T_IMAGE = 'image';
+var T_FOOTNOTE = 'footnote';
+var REFERENCE_TYPE_SHORTCUT = 'shortcut';
+var REFERENCE_TYPE_COLLAPSED = 'collapsed';
+var REFERENCE_TYPE_FULL = 'full';
+var C_CARET = '^';
+var C_BACKSLASH = '\\';
+var C_BRACKET_OPEN = '[';
+var C_BRACKET_CLOSE = ']';
+
+/* Tokenise a reference. */
+function reference(eat, value, silent) {
+ var self = this;
+ var character = value.charAt(0);
+ var index = 0;
+ var length = value.length;
+ var subvalue = '';
+ var intro = '';
+ var type = T_LINK;
+ var referenceType = REFERENCE_TYPE_SHORTCUT;
+ var content;
+ var identifier;
+ var now;
+ var node;
+ var exit;
+ var queue;
+ var bracketed;
+ var depth;
+
+ /* Check whether we’re eating an image. */
+ if (character === '!') {
+ type = T_IMAGE;
+ intro = character;
+ character = value.charAt(++index);
+ }
+
+ if (character !== C_BRACKET_OPEN) {
+ return;
+ }
+
+ index++;
+ intro += character;
+ queue = '';
+
+ /* Check whether we’re eating a footnote. */
+ if (
+ self.options.footnotes &&
+ type === T_LINK &&
+ value.charAt(index) === C_CARET
+ ) {
+ intro += C_CARET;
+ index++;
+ type = T_FOOTNOTE;
+ }
+
+ /* Eat the text. */
+ depth = 0;
+
+ while (index < length) {
+ character = value.charAt(index);
+
+ if (character === C_BRACKET_OPEN) {
+ bracketed = true;
+ depth++;
+ } else if (character === C_BRACKET_CLOSE) {
+ if (!depth) {
+ break;
+ }
+
+ depth--;
+ }
+
+ if (character === C_BACKSLASH) {
+ queue += C_BACKSLASH;
+ character = value.charAt(++index);
+ }
+
+ queue += character;
+ index++;
+ }
+
+ subvalue = queue;
+ content = queue;
+ character = value.charAt(index);
+
+ if (character !== C_BRACKET_CLOSE) {
+ return;
+ }
+
+ index++;
+ subvalue += character;
+ queue = '';
+
+ while (index < length) {
+ character = value.charAt(index);
+
+ if (!whitespace(character)) {
+ break;
+ }
+
+ queue += character;
+ index++;
+ }
+
+ character = value.charAt(index);
+
+ if (character === C_BRACKET_OPEN) {
+ identifier = '';
+ queue += character;
+ index++;
+
+ while (index < length) {
+ character = value.charAt(index);
+
+ if (character === C_BRACKET_OPEN || character === C_BRACKET_CLOSE) {
+ break;
+ }
+
+ if (character === C_BACKSLASH) {
+ identifier += C_BACKSLASH;
+ character = value.charAt(++index);
+ }
+
+ identifier += character;
+ index++;
+ }
+
+ character = value.charAt(index);
+
+ if (character === C_BRACKET_CLOSE) {
+ referenceType = identifier ? REFERENCE_TYPE_FULL : REFERENCE_TYPE_COLLAPSED;
+ queue += identifier + character;
+ index++;
+ } else {
+ identifier = '';
+ }
+
+ subvalue += queue;
+ queue = '';
+ } else {
+ if (!content) {
+ return;
+ }
+
+ identifier = content;
+ }
+
+ /* Brackets cannot be inside the identifier. */
+ if (referenceType !== REFERENCE_TYPE_FULL && bracketed) {
+ return;
+ }
+
+ /* Inline footnotes cannot have an identifier. */
+ if (type === T_FOOTNOTE && referenceType !== REFERENCE_TYPE_SHORTCUT) {
+ type = T_LINK;
+ intro = C_BRACKET_OPEN + C_CARET;
+ content = C_CARET + content;
+ }
+
+ subvalue = intro + subvalue;
+
+ if (type === T_LINK && self.inLink) {
+ return null;
+ }
+
+ /* istanbul ignore if - never used (yet) */
+ if (silent) {
+ return true;
+ }
+
+ if (type === T_FOOTNOTE && content.indexOf(' ') !== -1) {
+ return eat(subvalue)({
+ type: 'footnote',
+ children: this.tokenizeInline(content, eat.now())
+ });
+ }
+
+ now = eat.now();
+ now.column += intro.length;
+ now.offset += intro.length;
+ identifier = referenceType === REFERENCE_TYPE_FULL ? identifier : content;
+
+ node = {
+ type: type + 'Reference',
+ identifier: normalize(identifier)
+ };
+
+ if (type === T_LINK || type === T_IMAGE) {
+ node.referenceType = referenceType;
+ }
+
+ if (type === T_LINK) {
+ exit = self.enterLink();
+ node.children = self.tokenizeInline(content, now);
+ exit();
+ } else if (type === T_IMAGE) {
+ node.alt = self.decode.raw(self.unescape(content), now) || null;
+ }
+
+ return eat(subvalue)(node);
+}
diff --git a/tools/eslint/node_modules/remark-parse/lib/tokenize/strong.js b/tools/eslint/node_modules/remark-parse/lib/tokenize/strong.js
new file mode 100644
index 0000000000..765993fa0b
--- /dev/null
+++ b/tools/eslint/node_modules/remark-parse/lib/tokenize/strong.js
@@ -0,0 +1,93 @@
+/**
+ * @author Titus Wormer
+ * @copyright 2015 Titus Wormer
+ * @license MIT
+ * @module remark:parse:tokenize:strong
+ * @fileoverview Tokenise strong.
+ */
+
+'use strict';
+
+var trim = require('trim');
+var whitespace = require('is-whitespace-character');
+var locate = require('../locate/strong');
+
+module.exports = strong;
+strong.locator = locate;
+
+var C_ASTERISK = '*';
+var C_UNDERSCORE = '_';
+
+/* Tokenise strong. */
+function strong(eat, value, silent) {
+ var self = this;
+ var index = 0;
+ var character = value.charAt(index);
+ var now;
+ var pedantic;
+ var marker;
+ var queue;
+ var subvalue;
+ var length;
+ var prev;
+
+ if (
+ (character !== C_ASTERISK && character !== C_UNDERSCORE) ||
+ value.charAt(++index) !== character
+ ) {
+ return;
+ }
+
+ pedantic = self.options.pedantic;
+ marker = character;
+ subvalue = marker + marker;
+ length = value.length;
+ index++;
+ queue = '';
+ character = '';
+
+ if (pedantic && whitespace(value.charAt(index))) {
+ return;
+ }
+
+ while (index < length) {
+ prev = character;
+ character = value.charAt(index);
+
+ if (
+ character === marker &&
+ value.charAt(index + 1) === marker &&
+ (!pedantic || !whitespace(prev))
+ ) {
+ character = value.charAt(index + 2);
+
+ if (character !== marker) {
+ if (!trim(queue)) {
+ return;
+ }
+
+ /* istanbul ignore if - never used (yet) */
+ if (silent) {
+ return true;
+ }
+
+ now = eat.now();
+ now.column += 2;
+ now.offset += 2;
+
+ return eat(subvalue + queue + subvalue)({
+ type: 'strong',
+ children: self.tokenizeInline(queue, now)
+ });
+ }
+ }
+
+ if (!pedantic && character === '\\') {
+ queue += character;
+ character = value.charAt(++index);
+ }
+
+ queue += character;
+ index++;
+ }
+}
diff --git a/tools/eslint/node_modules/remark-parse/lib/tokenize/table.js b/tools/eslint/node_modules/remark-parse/lib/tokenize/table.js
new file mode 100644
index 0000000000..c440067e10
--- /dev/null
+++ b/tools/eslint/node_modules/remark-parse/lib/tokenize/table.js
@@ -0,0 +1,276 @@
+/**
+ * @author Titus Wormer
+ * @copyright 2015 Titus Wormer
+ * @license MIT
+ * @module remark:parse:tokenize:table
+ * @fileoverview Tokenise a table.
+ */
+
+'use strict';
+
+var whitespace = require('is-whitespace-character');
+
+module.exports = table;
+table.notInList = true;
+
+var C_BACKSLASH = '\\';
+var C_TICK = '`';
+var C_DASH = '-';
+var C_PIPE = '|';
+var C_COLON = ':';
+var C_SPACE = ' ';
+var C_NEWLINE = '\n';
+var C_TAB = '\t';
+
+var MIN_TABLE_COLUMNS = 1;
+var MIN_TABLE_ROWS = 2;
+
+var TABLE_ALIGN_LEFT = 'left';
+var TABLE_ALIGN_CENTER = 'center';
+var TABLE_ALIGN_RIGHT = 'right';
+var TABLE_ALIGN_NONE = null;
+
+/* Tokenise a table. */
+function table(eat, value, silent) {
+ var self = this;
+ var index;
+ var alignments;
+ var alignment;
+ var subvalue;
+ var row;
+ var length;
+ var lines;
+ var queue;
+ var character;
+ var hasDash;
+ var align;
+ var cell;
+ var preamble;
+ var count;
+ var opening;
+ var now;
+ var position;
+ var lineCount;
+ var line;
+ var rows;
+ var table;
+ var lineIndex;
+ var pipeIndex;
+ var first;
+
+ /* Exit when not in gfm-mode. */
+ if (!self.options.gfm) {
+ return;
+ }
+
+ /* Get the rows.
+ * Detecting tables soon is hard, so there are some
+ * checks for performance here, such as the minimum
+ * number of rows, and allowed characters in the
+ * alignment row. */
+ index = 0;
+ lineCount = 0;
+ length = value.length + 1;
+ lines = [];
+
+ while (index < length) {
+ lineIndex = value.indexOf(C_NEWLINE, index);
+ pipeIndex = value.indexOf(C_PIPE, index + 1);
+
+ if (lineIndex === -1) {
+ lineIndex = value.length;
+ }
+
+ if (pipeIndex === -1 || pipeIndex > lineIndex) {
+ if (lineCount < MIN_TABLE_ROWS) {
+ return;
+ }
+
+ break;
+ }
+
+ lines.push(value.slice(index, lineIndex));
+ lineCount++;
+ index = lineIndex + 1;
+ }
+
+ /* Parse the alignment row. */
+ subvalue = lines.join(C_NEWLINE);
+ alignments = lines.splice(1, 1)[0] || [];
+ index = 0;
+ length = alignments.length;
+ lineCount--;
+ alignment = false;
+ align = [];
+
+ while (index < length) {
+ character = alignments.charAt(index);
+
+ if (character === C_PIPE) {
+ hasDash = null;
+
+ if (alignment === false) {
+ if (first === false) {
+ return;
+ }
+ } else {
+ align.push(alignment);
+ alignment = false;
+ }
+
+ first = false;
+ } else if (character === C_DASH) {
+ hasDash = true;
+ alignment = alignment || TABLE_ALIGN_NONE;
+ } else if (character === C_COLON) {
+ if (alignment === TABLE_ALIGN_LEFT) {
+ alignment = TABLE_ALIGN_CENTER;
+ } else if (hasDash && alignment === TABLE_ALIGN_NONE) {
+ alignment = TABLE_ALIGN_RIGHT;
+ } else {
+ alignment = TABLE_ALIGN_LEFT;
+ }
+ } else if (!whitespace(character)) {
+ return;
+ }
+
+ index++;
+ }
+
+ if (alignment !== false) {
+ align.push(alignment);
+ }
+
+ /* Exit when without enough columns. */
+ if (align.length < MIN_TABLE_COLUMNS) {
+ return;
+ }
+
+ /* istanbul ignore if - never used (yet) */
+ if (silent) {
+ return true;
+ }
+
+ /* Parse the rows. */
+ position = -1;
+ rows = [];
+
+ table = eat(subvalue).reset({
+ type: 'table',
+ align: align,
+ children: rows
+ });
+
+ while (++position < lineCount) {
+ line = lines[position];
+ row = {type: 'tableRow', children: []};
+
+ /* Eat a newline character when this is not the
+ * first row. */
+ if (position) {
+ eat(C_NEWLINE);
+ }
+
+ /* Eat the row. */
+ eat(line).reset(row, table);
+
+ length = line.length + 1;
+ index = 0;
+ queue = '';
+ cell = '';
+ preamble = true;
+ count = null;
+ opening = null;
+
+ while (index < length) {
+ character = line.charAt(index);
+
+ if (character === C_TAB || character === C_SPACE) {
+ if (cell) {
+ queue += character;
+ } else {
+ eat(character);
+ }
+
+ index++;
+ continue;
+ }
+
+ if (character === '' || character === C_PIPE) {
+ if (preamble) {
+ eat(character);
+ } else {
+ if (character && opening) {
+ queue += character;
+ index++;
+ continue;
+ }
+
+ if ((cell || character) && !preamble) {
+ subvalue = cell;
+
+ if (queue.length > 1) {
+ if (character) {
+ subvalue += queue.slice(0, queue.length - 1);
+ queue = queue.charAt(queue.length - 1);
+ } else {
+ subvalue += queue;
+ queue = '';
+ }
+ }
+
+ now = eat.now();
+
+ eat(subvalue)({
+ type: 'tableCell',
+ children: self.tokenizeInline(cell, now)
+ }, row);
+ }
+
+ eat(queue + character);
+
+ queue = '';
+ cell = '';
+ }
+ } else {
+ if (queue) {
+ cell += queue;
+ queue = '';
+ }
+
+ cell += character;
+
+ if (character === C_BACKSLASH && index !== length - 2) {
+ cell += line.charAt(index + 1);
+ index++;
+ }
+
+ if (character === C_TICK) {
+ count = 1;
+
+ while (line.charAt(index + 1) === character) {
+ cell += character;
+ index++;
+ count++;
+ }
+
+ if (!opening) {
+ opening = count;
+ } else if (count >= opening) {
+ opening = 0;
+ }
+ }
+ }
+
+ preamble = false;
+ index++;
+ }
+
+ /* Eat the alignment row. */
+ if (!position) {
+ eat(C_NEWLINE + alignments);
+ }
+ }
+
+ return table;
+}
diff --git a/tools/eslint/node_modules/remark-parse/lib/tokenize/text.js b/tools/eslint/node_modules/remark-parse/lib/tokenize/text.js
new file mode 100644
index 0000000000..ef6d3f2879
--- /dev/null
+++ b/tools/eslint/node_modules/remark-parse/lib/tokenize/text.js
@@ -0,0 +1,67 @@
+/**
+ * @author Titus Wormer
+ * @copyright 2015 Titus Wormer
+ * @license MIT
+ * @module remark:parse:tokenize:text
+ * @fileoverview Tokenise text.
+ */
+
+'use strict';
+
+module.exports = text;
+
+/* Tokenise text. */
+function text(eat, value, silent) {
+ var self = this;
+ var methods;
+ var tokenizers;
+ var index;
+ var length;
+ var subvalue;
+ var position;
+ var tokenizer;
+ var name;
+ var min;
+ var now;
+
+ /* istanbul ignore if - never used (yet) */
+ if (silent) {
+ return true;
+ }
+
+ methods = self.inlineMethods;
+ length = methods.length;
+ tokenizers = self.inlineTokenizers;
+ index = -1;
+ min = value.length;
+
+ while (++index < length) {
+ name = methods[index];
+
+ if (name === 'text' || !tokenizers[name]) {
+ continue;
+ }
+
+ tokenizer = tokenizers[name].locator;
+
+ if (!tokenizer) {
+ eat.file.fail('Missing locator: `' + name + '`');
+ }
+
+ position = tokenizer.call(self, value, 1);
+
+ if (position !== -1 && position < min) {
+ min = position;
+ }
+ }
+
+ subvalue = value.slice(0, min);
+ now = eat.now();
+
+ self.decode(subvalue, now, function (content, position, source) {
+ eat(source || content)({
+ type: 'text',
+ value: content
+ });
+ });
+}
diff --git a/tools/eslint/node_modules/remark-parse/lib/tokenize/thematic-break.js b/tools/eslint/node_modules/remark-parse/lib/tokenize/thematic-break.js
new file mode 100644
index 0000000000..a580d09fe0
--- /dev/null
+++ b/tools/eslint/node_modules/remark-parse/lib/tokenize/thematic-break.js
@@ -0,0 +1,79 @@
+/**
+ * @author Titus Wormer
+ * @copyright 2015 Titus Wormer
+ * @license MIT
+ * @module remark:parse:tokenize:thematic-break
+ * @fileoverview Tokenise a thematic break.
+ */
+
+'use strict';
+
+module.exports = thematicBreak;
+
+var C_NEWLINE = '\n';
+var C_TAB = '\t';
+var C_SPACE = ' ';
+var C_ASTERISK = '*';
+var C_UNDERSCORE = '_';
+var C_DASH = '-';
+
+var THEMATIC_BREAK_MARKER_COUNT = 3;
+
+/* Tokenise a thematic break. */
+function thematicBreak(eat, value, silent) {
+ var index = -1;
+ var length = value.length + 1;
+ var subvalue = '';
+ var character;
+ var marker;
+ var markerCount;
+ var queue;
+
+ while (++index < length) {
+ character = value.charAt(index);
+
+ if (character !== C_TAB && character !== C_SPACE) {
+ break;
+ }
+
+ subvalue += character;
+ }
+
+ if (
+ character !== C_ASTERISK &&
+ character !== C_DASH &&
+ character !== C_UNDERSCORE
+ ) {
+ return;
+ }
+
+ marker = character;
+ subvalue += character;
+ markerCount = 1;
+ queue = '';
+
+ while (++index < length) {
+ character = value.charAt(index);
+
+ if (character === marker) {
+ markerCount++;
+ subvalue += queue + marker;
+ queue = '';
+ } else if (character === C_SPACE) {
+ queue += character;
+ } else if (
+ markerCount >= THEMATIC_BREAK_MARKER_COUNT &&
+ (!character || character === C_NEWLINE)
+ ) {
+ subvalue += queue;
+
+ if (silent) {
+ return true;
+ }
+
+ return eat(subvalue)({type: 'thematicBreak'});
+ } else {
+ return;
+ }
+ }
+}
diff --git a/tools/eslint/node_modules/remark-parse/lib/tokenize/url.js b/tools/eslint/node_modules/remark-parse/lib/tokenize/url.js
new file mode 100644
index 0000000000..fd2debd32f
--- /dev/null
+++ b/tools/eslint/node_modules/remark-parse/lib/tokenize/url.js
@@ -0,0 +1,153 @@
+/**
+ * @author Titus Wormer
+ * @copyright 2015 Titus Wormer
+ * @license MIT
+ * @module remark:parse:tokenize:url
+ * @fileoverview Tokenise a URL.
+ */
+
+'use strict';
+
+var decode = require('parse-entities');
+var whitespace = require('is-whitespace-character');
+var locate = require('../locate/url');
+
+module.exports = url;
+url.locator = locate;
+url.notInLink = true;
+
+var C_BRACKET_OPEN = '[';
+var C_BRACKET_CLOSE = ']';
+var C_PAREN_OPEN = '(';
+var C_PAREN_CLOSE = ')';
+var C_LT = '<';
+var C_AT_SIGN = '@';
+
+var HTTP_PROTOCOL = 'http://';
+var HTTPS_PROTOCOL = 'https://';
+var MAILTO_PROTOCOL = 'mailto:';
+
+var PROTOCOLS = [
+ HTTP_PROTOCOL,
+ HTTPS_PROTOCOL,
+ MAILTO_PROTOCOL
+];
+
+var PROTOCOLS_LENGTH = PROTOCOLS.length;
+
+/* Tokenise a URL. */
+function url(eat, value, silent) {
+ var self = this;
+ var subvalue;
+ var content;
+ var character;
+ var index;
+ var position;
+ var protocol;
+ var match;
+ var length;
+ var queue;
+ var parenCount;
+ var nextCharacter;
+ var exit;
+
+ if (!self.options.gfm) {
+ return;
+ }
+
+ subvalue = '';
+ index = -1;
+ length = PROTOCOLS_LENGTH;
+
+ while (++index < length) {
+ protocol = PROTOCOLS[index];
+ match = value.slice(0, protocol.length);
+
+ if (match.toLowerCase() === protocol) {
+ subvalue = match;
+ break;
+ }
+ }
+
+ if (!subvalue) {
+ return;
+ }
+
+ index = subvalue.length;
+ length = value.length;
+ queue = '';
+ parenCount = 0;
+
+ while (index < length) {
+ character = value.charAt(index);
+
+ if (whitespace(character) || character === C_LT) {
+ break;
+ }
+
+ if (
+ character === '.' ||
+ character === ',' ||
+ character === ':' ||
+ character === ';' ||
+ character === '"' ||
+ character === '\'' ||
+ character === ')' ||
+ character === ']'
+ ) {
+ nextCharacter = value.charAt(index + 1);
+
+ if (!nextCharacter || whitespace(nextCharacter)) {
+ break;
+ }
+ }
+
+ if (character === C_PAREN_OPEN || character === C_BRACKET_OPEN) {
+ parenCount++;
+ }
+
+ if (character === C_PAREN_CLOSE || character === C_BRACKET_CLOSE) {
+ parenCount--;
+
+ if (parenCount < 0) {
+ break;
+ }
+ }
+
+ queue += character;
+ index++;
+ }
+
+ if (!queue) {
+ return;
+ }
+
+ subvalue += queue;
+ content = subvalue;
+
+ if (protocol === MAILTO_PROTOCOL) {
+ position = queue.indexOf(C_AT_SIGN);
+
+ if (position === -1 || position === length - 1) {
+ return;
+ }
+
+ content = content.substr(MAILTO_PROTOCOL.length);
+ }
+
+ /* istanbul ignore if - never used (yet) */
+ if (silent) {
+ return true;
+ }
+
+ exit = self.enterLink();
+ content = self.tokenizeInline(content, eat.now());
+ exit();
+
+ return eat(subvalue)({
+ type: 'link',
+ title: null,
+ url: decode(subvalue),
+ children: content
+ });
+}
diff --git a/tools/eslint/node_modules/remark-parse/lib/tokenize/yaml.js b/tools/eslint/node_modules/remark-parse/lib/tokenize/yaml.js
new file mode 100644
index 0000000000..78dec31a0f
--- /dev/null
+++ b/tools/eslint/node_modules/remark-parse/lib/tokenize/yaml.js
@@ -0,0 +1,74 @@
+/**
+ * @author Titus Wormer
+ * @copyright 2015 Titus Wormer
+ * @license MIT
+ * @module remark:parse:tokenize:yaml
+ * @fileoverview Tokenise YAML.
+ */
+
+'use strict';
+
+module.exports = yaml;
+yaml.onlyAtStart = true;
+
+var FENCE = '---';
+var C_DASH = '-';
+var C_NEWLINE = '\n';
+
+/* Tokenise YAML. */
+function yaml(eat, value, silent) {
+ var self = this;
+ var subvalue;
+ var content;
+ var index;
+ var length;
+ var character;
+ var queue;
+
+ if (
+ !self.options.yaml ||
+ value.charAt(0) !== C_DASH ||
+ value.charAt(1) !== C_DASH ||
+ value.charAt(2) !== C_DASH ||
+ value.charAt(3) !== C_NEWLINE
+ ) {
+ return;
+ }
+
+ subvalue = FENCE + C_NEWLINE;
+ content = '';
+ queue = '';
+ index = 3;
+ length = value.length;
+
+ while (++index < length) {
+ character = value.charAt(index);
+
+ if (
+ character === C_DASH &&
+ (queue || !content) &&
+ value.charAt(index + 1) === C_DASH &&
+ value.charAt(index + 2) === C_DASH
+ ) {
+ /* istanbul ignore if - never used (yet) */
+ if (silent) {
+ return true;
+ }
+
+ subvalue += queue + FENCE;
+
+ return eat(subvalue)({
+ type: 'yaml',
+ value: content
+ });
+ }
+
+ if (character === C_NEWLINE) {
+ queue += character;
+ } else {
+ subvalue += queue + character;
+ content += queue + character;
+ queue = '';
+ }
+ }
+}
diff --git a/tools/eslint/node_modules/remark-parse/lib/tokenizer.js b/tools/eslint/node_modules/remark-parse/lib/tokenizer.js
new file mode 100644
index 0000000000..aefe551fc3
--- /dev/null
+++ b/tools/eslint/node_modules/remark-parse/lib/tokenizer.js
@@ -0,0 +1,451 @@
+/**
+ * @author Titus Wormer
+ * @copyright 2015 Titus Wormer
+ * @license MIT
+ * @module remark:parse:tokenizer
+ * @fileoverview Markdown tokenizer.
+ */
+
+'use strict';
+
+module.exports = factory;
+
+var MERGEABLE_NODES = {
+ text: mergeText,
+ blockquote: mergeBlockquote
+};
+
+/* Check whether a node is mergeable with adjacent nodes. */
+function mergeable(node) {
+ var start;
+ var end;
+
+ if (node.type !== 'text' || !node.position) {
+ return true;
+ }
+
+ start = node.position.start;
+ end = node.position.end;
+
+ /* Only merge nodes which occupy the same size as their
+ * `value`. */
+ return start.line !== end.line ||
+ end.column - start.column === node.value.length;
+}
+
+/* Merge two text nodes: `node` into `prev`. */
+function mergeText(prev, node) {
+ prev.value += node.value;
+
+ return prev;
+}
+
+/* Merge two blockquotes: `node` into `prev`, unless in
+ * CommonMark mode. */
+function mergeBlockquote(prev, node) {
+ if (this.options.commonmark) {
+ return node;
+ }
+
+ prev.children = prev.children.concat(node.children);
+
+ return prev;
+}
+
+/* Construct a tokenizer. This creates both
+ * `tokenizeInline` and `tokenizeBlock`. */
+function factory(type) {
+ return tokenize;
+
+ /* Tokenizer for a bound `type`. */
+ function tokenize(value, location) {
+ var self = this;
+ var offset = self.offset;
+ var tokens = [];
+ var methods = self[type + 'Methods'];
+ var tokenizers = self[type + 'Tokenizers'];
+ var line = location.line;
+ var column = location.column;
+ var index;
+ var length;
+ var method;
+ var name;
+ var matched;
+ var valueLength;
+
+ /* Trim white space only lines. */
+ if (!value) {
+ return tokens;
+ }
+
+ /* Expose on `eat`. */
+ eat.now = now;
+ eat.file = self.file;
+
+ /* Sync initial offset. */
+ updatePosition('');
+
+ /* Iterate over `value`, and iterate over all
+ * tokenizers. When one eats something, re-iterate
+ * with the remaining value. If no tokenizer eats,
+ * something failed (should not happen) and an
+ * exception is thrown. */
+ while (value) {
+ index = -1;
+ length = methods.length;
+ matched = false;
+
+ while (++index < length) {
+ name = methods[index];
+ method = tokenizers[name];
+
+ if (
+ method &&
+ (!method.onlyAtStart || self.atStart) &&
+ (!method.notInList || !self.inList) &&
+ (!method.notInBlock || !self.inBlock) &&
+ (!method.notInLink || !self.inLink)
+ ) {
+ valueLength = value.length;
+
+ method.apply(self, [eat, value]);
+
+ matched = valueLength !== value.length;
+
+ if (matched) {
+ break;
+ }
+ }
+ }
+
+ /* istanbul ignore if */
+ if (!matched) {
+ self.file.fail(new Error('Infinite loop'), eat.now());
+ }
+ }
+
+ self.eof = now();
+
+ return tokens;
+
+ /**
+ * Update line, column, and offset based on
+ * `value`.
+ *
+ * @example
+ * updatePosition('foo');
+ *
+ * @param {string} subvalue - Subvalue to eat.
+ */
+ function updatePosition(subvalue) {
+ var lastIndex = -1;
+ var index = subvalue.indexOf('\n');
+
+ while (index !== -1) {
+ line++;
+ lastIndex = index;
+ index = subvalue.indexOf('\n', index + 1);
+ }
+
+ if (lastIndex === -1) {
+ column += subvalue.length;
+ } else {
+ column = subvalue.length - lastIndex;
+ }
+
+ if (line in offset) {
+ if (lastIndex !== -1) {
+ column += offset[line];
+ } else if (column <= offset[line]) {
+ column = offset[line] + 1;
+ }
+ }
+ }
+
+ /**
+ * Get offset. Called before the first character is
+ * eaten to retrieve the range's offsets.
+ *
+ * @return {Function} - `done`, to be called when
+ * the last character is eaten.
+ */
+ function getOffset() {
+ var indentation = [];
+ var pos = line + 1;
+
+ /**
+ * Done. Called when the last character is
+ * eaten to retrieve the range’s offsets.
+ *
+ * @return {Array.<number>} - Offset.
+ */
+ return function () {
+ var last = line + 1;
+
+ while (pos < last) {
+ indentation.push((offset[pos] || 0) + 1);
+
+ pos++;
+ }
+
+ return indentation;
+ };
+ }
+
+ /**
+ * Get the current position.
+ *
+ * @example
+ * position = now(); // {line: 1, column: 1, offset: 0}
+ *
+ * @return {Object} - Current Position.
+ */
+ function now() {
+ var pos = {line: line, column: column};
+
+ pos.offset = self.toOffset(pos);
+
+ return pos;
+ }
+
+ /**
+ * Store position information for a node.
+ *
+ * @example
+ * start = now();
+ * updatePosition('foo');
+ * location = new Position(start);
+ * // {
+ * // start: {line: 1, column: 1, offset: 0},
+ * // end: {line: 1, column: 3, offset: 2}
+ * // }
+ *
+ * @param {Object} start - Starting position.
+ */
+ function Position(start) {
+ this.start = start;
+ this.end = now();
+ }
+
+ /**
+ * Throw when a value is incorrectly eaten.
+ * This shouldn’t happen but will throw on new,
+ * incorrect rules.
+ *
+ * @example
+ * // When the current value is set to `foo bar`.
+ * validateEat('foo');
+ * eat('foo');
+ *
+ * validateEat('bar');
+ * // throws, because the space is not eaten.
+ *
+ * @param {string} subvalue - Value to be eaten.
+ * @throws {Error} - When `subvalue` cannot be eaten.
+ */
+ function validateEat(subvalue) {
+ /* istanbul ignore if */
+ if (value.substring(0, subvalue.length) !== subvalue) {
+ /* Capture stack-trace. */
+ self.file.fail(
+ new Error(
+ 'Incorrectly eaten value: please report this ' +
+ 'warning on http://git.io/vg5Ft'
+ ),
+ now()
+ );
+ }
+ }
+
+ /**
+ * Mark position and patch `node.position`.
+ *
+ * @example
+ * var update = position();
+ * updatePosition('foo');
+ * update({});
+ * // {
+ * // position: {
+ * // start: {line: 1, column: 1, offset: 0},
+ * // end: {line: 1, column: 3, offset: 2}
+ * // }
+ * // }
+ *
+ * @returns {Function} - Updater.
+ */
+ function position() {
+ var before = now();
+
+ return update;
+
+ /**
+ * Add the position to a node.
+ *
+ * @example
+ * update({type: 'text', value: 'foo'});
+ *
+ * @param {Node} node - Node to attach position
+ * on.
+ * @param {Array} [indent] - Indentation for
+ * `node`.
+ * @return {Node} - `node`.
+ */
+ function update(node, indent) {
+ var prev = node.position;
+ var start = prev ? prev.start : before;
+ var combined = [];
+ var n = prev && prev.end.line;
+ var l = before.line;
+
+ node.position = new Position(start);
+
+ /* If there was already a `position`, this
+ * node was merged. Fixing `start` wasn’t
+ * hard, but the indent is different.
+ * Especially because some information, the
+ * indent between `n` and `l` wasn’t
+ * tracked. Luckily, that space is
+ * (should be?) empty, so we can safely
+ * check for it now. */
+ if (prev && indent && prev.indent) {
+ combined = prev.indent;
+
+ if (n < l) {
+ while (++n < l) {
+ combined.push((offset[n] || 0) + 1);
+ }
+
+ combined.push(before.column);
+ }
+
+ indent = combined.concat(indent);
+ }
+
+ node.position.indent = indent || [];
+
+ return node;
+ }
+ }
+
+ /**
+ * Add `node` to `parent`s children or to `tokens`.
+ * Performs merges where possible.
+ *
+ * @example
+ * add({});
+ *
+ * add({}, {children: []});
+ *
+ * @param {Object} node - Node to add.
+ * @param {Object} [parent] - Parent to insert into.
+ * @return {Object} - Added or merged into node.
+ */
+ function add(node, parent) {
+ var children = parent ? parent.children : tokens;
+ var prev = children[children.length - 1];
+
+ if (
+ prev &&
+ node.type === prev.type &&
+ node.type in MERGEABLE_NODES &&
+ mergeable(prev) &&
+ mergeable(node)
+ ) {
+ node = MERGEABLE_NODES[node.type].call(self, prev, node);
+ }
+
+ if (node !== prev) {
+ children.push(node);
+ }
+
+ if (self.atStart && tokens.length !== 0) {
+ self.exitStart();
+ }
+
+ return node;
+ }
+
+ /**
+ * Remove `subvalue` from `value`.
+ * `subvalue` must be at the start of `value`.
+ *
+ * @example
+ * eat('foo')({type: 'text', value: 'foo'});
+ *
+ * @param {string} subvalue - Removed from `value`,
+ * and passed to `updatePosition`.
+ * @return {Function} - Wrapper around `add`, which
+ * also adds `position` to node.
+ */
+ function eat(subvalue) {
+ var indent = getOffset();
+ var pos = position();
+ var current = now();
+
+ validateEat(subvalue);
+
+ apply.reset = reset;
+ reset.test = test;
+ apply.test = test;
+
+ value = value.substring(subvalue.length);
+
+ updatePosition(subvalue);
+
+ indent = indent();
+
+ return apply;
+
+ /**
+ * Add the given arguments, add `position` to
+ * the returned node, and return the node.
+ *
+ * @param {Object} node - Node to add.
+ * @param {Object} [parent] - Node to insert into.
+ * @return {Node} - Added node.
+ */
+ function apply(node, parent) {
+ return pos(add(pos(node), parent), indent);
+ }
+
+ /**
+ * Functions just like apply, but resets the
+ * content: the line and column are reversed,
+ * and the eaten value is re-added.
+ *
+ * This is useful for nodes with a single
+ * type of content, such as lists and tables.
+ *
+ * See `apply` above for what parameters are
+ * expected.
+ *
+ * @return {Node} - Added node.
+ */
+ function reset() {
+ var node = apply.apply(null, arguments);
+
+ line = current.line;
+ column = current.column;
+ value = subvalue + value;
+
+ return node;
+ }
+
+ /**
+ * Test the position, after eating, and reverse
+ * to a not-eaten state.
+ *
+ * @return {Position} - Position after eating `subvalue`.
+ */
+ function test() {
+ var result = pos({});
+
+ line = current.line;
+ column = current.column;
+ value = subvalue + value;
+
+ return result.position;
+ }
+ }
+ }
+}
diff --git a/tools/eslint/node_modules/remark-parse/lib/unescape.js b/tools/eslint/node_modules/remark-parse/lib/unescape.js
new file mode 100644
index 0000000000..dc83486126
--- /dev/null
+++ b/tools/eslint/node_modules/remark-parse/lib/unescape.js
@@ -0,0 +1,46 @@
+/**
+ * @author Titus Wormer
+ * @copyright 2015 Titus Wormer
+ * @license MIT
+ * @module remark:parse:unescape
+ * @fileoverview Unescape escapes.
+ */
+
+'use strict';
+
+/* Expose. */
+module.exports = factory;
+
+/* Factory to de-escape a value, based on a list at `key`
+ * in `ctx`. */
+function factory(ctx, key) {
+ return unescape;
+
+ /* De-escape a string using the expression at `key`
+ * in `ctx`. */
+ function unescape(value) {
+ var prev = 0;
+ var index = value.indexOf('\\');
+ var escape = ctx[key];
+ var queue = [];
+ var character;
+
+ while (index !== -1) {
+ queue.push(value.slice(prev, index));
+ prev = index + 1;
+ character = value.charAt(prev);
+
+ /* If the following character is not a valid escape,
+ * add the slash. */
+ if (!character || escape.indexOf(character) === -1) {
+ queue.push('\\');
+ }
+
+ index = value.indexOf('\\', prev);
+ }
+
+ queue.push(value.slice(prev));
+
+ return queue.join('');
+ }
+}
diff --git a/tools/eslint/node_modules/remark-parse/lib/util/get-indentation.js b/tools/eslint/node_modules/remark-parse/lib/util/get-indentation.js
new file mode 100644
index 0000000000..eebd40c94a
--- /dev/null
+++ b/tools/eslint/node_modules/remark-parse/lib/util/get-indentation.js
@@ -0,0 +1,46 @@
+/**
+ * @author Titus Wormer
+ * @copyright 2015 Titus Wormer
+ * @license MIT
+ * @module remark:parse:util:get-indentation
+ * @fileoverview Get indentation.
+ */
+
+'use strict';
+
+/* Expose. */
+module.exports = indentation;
+
+/* Map of characters, and their column length,
+ * which can be used as indentation. */
+var characters = {' ': 1, '\t': 4};
+
+/**
+ * Gets indentation information for a line.
+ *
+ * @param {string} value - Indented line.
+ * @return {Object} - Indetation information.
+ */
+function indentation(value) {
+ var index = 0;
+ var indent = 0;
+ var character = value.charAt(index);
+ var stops = {};
+ var size;
+
+ while (character in characters) {
+ size = characters[character];
+
+ indent += size;
+
+ if (size > 1) {
+ indent = Math.floor(indent / size) * size;
+ }
+
+ stops[indent] = index;
+
+ character = value.charAt(++index);
+ }
+
+ return {indent: indent, stops: stops};
+}
diff --git a/tools/eslint/node_modules/remark-parse/lib/util/html.js b/tools/eslint/node_modules/remark-parse/lib/util/html.js
new file mode 100644
index 0000000000..234ba342e1
--- /dev/null
+++ b/tools/eslint/node_modules/remark-parse/lib/util/html.js
@@ -0,0 +1,33 @@
+/**
+ * @author Titus Wormer
+ * @copyright 2015 Titus Wormer
+ * @license MIT
+ * @module remark:parse:util:html
+ * @fileoverview HTML regexes.
+ */
+
+'use strict';
+
+var attributeName = '[a-zA-Z_:][a-zA-Z0-9:._-]*';
+var unquoted = '[^"\'=<>`\\u0000-\\u0020]+';
+var singleQuoted = '\'[^\']*\'';
+var doubleQuoted = '"[^"]*"';
+var attributeValue = '(?:' + unquoted + '|' + singleQuoted + '|' + doubleQuoted + ')';
+var attribute = '(?:\\s+' + attributeName + '(?:\\s*=\\s*' + attributeValue + ')?)';
+var openTag = '<[A-Za-z][A-Za-z0-9\\-]*' + attribute + '*\\s*\\/?>';
+var closeTag = '<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>';
+var comment = '<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->';
+var processing = '<[?].*?[?]>';
+var declaration = '<![A-Za-z]+\\s+[^>]*>';
+var cdata = '<!\\[CDATA\\[[\\s\\S]*?\\]\\]>';
+
+exports.openCloseTag = new RegExp('^(?:' + openTag + '|' + closeTag + ')');
+
+exports.tag = new RegExp('^(?:' +
+ openTag + '|' +
+ closeTag + '|' +
+ comment + '|' +
+ processing + '|' +
+ declaration + '|' +
+ cdata +
+')');
diff --git a/tools/eslint/node_modules/remark-parse/lib/util/interrupt.js b/tools/eslint/node_modules/remark-parse/lib/util/interrupt.js
new file mode 100644
index 0000000000..b8dc230550
--- /dev/null
+++ b/tools/eslint/node_modules/remark-parse/lib/util/interrupt.js
@@ -0,0 +1,51 @@
+/**
+ * @author Titus Wormer
+ * @copyright 2015 Titus Wormer
+ * @license MIT
+ * @module remark:parse:util:get-indentation
+ * @fileoverview Get indentation.
+ */
+
+'use strict';
+
+module.exports = interrupt;
+
+function interrupt(interruptors, tokenizers, ctx, params) {
+ var bools = ['pedantic', 'commonmark'];
+ var count = bools.length;
+ var length = interruptors.length;
+ var index = -1;
+ var interruptor;
+ var config;
+ var fn;
+ var offset;
+ var bool;
+ var ignore;
+
+ while (++index < length) {
+ interruptor = interruptors[index];
+ config = interruptor[1] || {};
+ fn = interruptor[0];
+ offset = -1;
+ ignore = false;
+
+ while (++offset < count) {
+ bool = bools[offset];
+
+ if (config[bool] !== undefined && config[bool] !== ctx.options[bool]) {
+ ignore = true;
+ break;
+ }
+ }
+
+ if (ignore) {
+ continue;
+ }
+
+ if (tokenizers[fn].apply(ctx, params)) {
+ return true;
+ }
+ }
+
+ return false;
+}
diff --git a/tools/eslint/node_modules/remark-parse/lib/util/normalize.js b/tools/eslint/node_modules/remark-parse/lib/util/normalize.js
new file mode 100644
index 0000000000..3602a18f78
--- /dev/null
+++ b/tools/eslint/node_modules/remark-parse/lib/util/normalize.js
@@ -0,0 +1,29 @@
+/**
+ * @author Titus Wormer
+ * @copyright 2015 Titus Wormer
+ * @license MIT
+ * @module remark:parse:util:normalize
+ * @fileoverview Normalize an identifier.
+ */
+
+'use strict';
+
+/* Dependencies. */
+var collapseWhiteSpace = require('collapse-white-space');
+
+/* Expose. */
+module.exports = normalize;
+
+/**
+ * Normalize an identifier. Collapses multiple white space
+ * characters into a single space, and removes casing.
+ *
+ * @example
+ * normalizeIdentifier('FOO\t bar'); // 'foo bar'
+ *
+ * @param {string} value - Content to normalize.
+ * @return {string} - Normalized content.
+ */
+function normalize(value) {
+ return collapseWhiteSpace(value).toLowerCase();
+}
diff --git a/tools/eslint/node_modules/remark-parse/lib/util/remove-indentation.js b/tools/eslint/node_modules/remark-parse/lib/util/remove-indentation.js
new file mode 100644
index 0000000000..d56db0bad4
--- /dev/null
+++ b/tools/eslint/node_modules/remark-parse/lib/util/remove-indentation.js
@@ -0,0 +1,102 @@
+/**
+ * @author Titus Wormer
+ * @copyright 2015 Titus Wormer
+ * @license MIT
+ * @module remark:parse:util:remove-indentation
+ * @fileoverview Remove indentation.
+ */
+
+'use strict';
+
+/* Dependencies. */
+var trim = require('trim');
+var repeat = require('repeat-string');
+var getIndent = require('./get-indentation');
+
+/* Expose. */
+module.exports = indentation;
+
+/* Characters. */
+var C_SPACE = ' ';
+var C_NEWLINE = '\n';
+var C_TAB = '\t';
+
+/**
+ * Remove the minimum indent from every line in `value`.
+ * Supports both tab, spaced, and mixed indentation (as
+ * well as possible).
+ *
+ * @example
+ * removeIndentation(' foo'); // 'foo'
+ * removeIndentation(' foo', 2); // ' foo'
+ * removeIndentation('\tfoo', 2); // ' foo'
+ * removeIndentation(' foo\n bar'); // ' foo\n bar'
+ *
+ * @param {string} value - Value to trim.
+ * @param {number?} [maximum] - Maximum indentation
+ * to remove.
+ * @return {string} - Unindented `value`.
+ */
+function indentation(value, maximum) {
+ var values = value.split(C_NEWLINE);
+ var position = values.length + 1;
+ var minIndent = Infinity;
+ var matrix = [];
+ var index;
+ var indentation;
+ var stops;
+ var padding;
+
+ values.unshift(repeat(C_SPACE, maximum) + '!');
+
+ while (position--) {
+ indentation = getIndent(values[position]);
+
+ matrix[position] = indentation.stops;
+
+ if (trim(values[position]).length === 0) {
+ continue;
+ }
+
+ if (indentation.indent) {
+ if (indentation.indent > 0 && indentation.indent < minIndent) {
+ minIndent = indentation.indent;
+ }
+ } else {
+ minIndent = Infinity;
+
+ break;
+ }
+ }
+
+ if (minIndent !== Infinity) {
+ position = values.length;
+
+ while (position--) {
+ stops = matrix[position];
+ index = minIndent;
+
+ while (index && !(index in stops)) {
+ index--;
+ }
+
+ if (
+ trim(values[position]).length !== 0 &&
+ minIndent &&
+ index !== minIndent
+ ) {
+ padding = C_TAB;
+ } else {
+ padding = '';
+ }
+
+ values[position] = padding + values[position].slice(
+ index in stops ? stops[index] + 1 : 0
+ );
+ }
+ }
+
+ values.shift();
+
+ return values.join(C_NEWLINE);
+}
diff --git a/tools/eslint/node_modules/remark-parse/package.json b/tools/eslint/node_modules/remark-parse/package.json
index a39fd06ac8..c5a56ddae5 100644
--- a/tools/eslint/node_modules/remark-parse/package.json
+++ b/tools/eslint/node_modules/remark-parse/package.json
@@ -1,81 +1,54 @@
{
- "_from": "remark-parse@^1.1.0",
- "_id": "remark-parse@1.1.0",
+ "_from": "remark-parse@^3.0.0",
+ "_id": "remark-parse@3.0.1",
"_inBundle": false,
- "_integrity": "sha1-w8oQ+ajaBGFcKPCapOMEUQUm7CE=",
+ "_integrity": "sha1-G5+EGkTY9PvyJGhQJlRZpOs1TIA=",
"_location": "/remark-parse",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
- "raw": "remark-parse@^1.1.0",
+ "raw": "remark-parse@^3.0.0",
"name": "remark-parse",
"escapedName": "remark-parse",
- "rawSpec": "^1.1.0",
+ "rawSpec": "^3.0.0",
"saveSpec": null,
- "fetchSpec": "^1.1.0"
+ "fetchSpec": "^3.0.0"
},
"_requiredBy": [
- "/remark"
+ "/eslint-plugin-markdown"
],
- "_resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-1.1.0.tgz",
- "_shasum": "c3ca10f9a8da04615c28f09aa4e304510526ec21",
- "_spec": "remark-parse@^1.1.0",
- "_where": "/Users/trott/io.js/tools/eslint-tmp/node_modules/eslint/node_modules/remark",
- "author": {
- "name": "Titus Wormer",
- "email": "tituswormer@gmail.com",
- "url": "http://wooorm.com"
- },
- "bugs": {
- "url": "https://github.com/wooorm/remark/issues"
- },
+ "_resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-3.0.1.tgz",
+ "_shasum": "1b9f841a44d8f4fbf2246850265459a4eb354c80",
+ "_shrinkwrap": null,
+ "_spec": "remark-parse@^3.0.0",
+ "_where": "j:\\temp\\_git\\node-fork\\tools\\eslint\\node_modules\\eslint-plugin-markdown",
+ "bin": null,
"bundleDependencies": false,
- "contributors": [
- {
- "name": "Titus Wormer",
- "email": "tituswormer@gmail.com",
- "url": "http://wooorm.com"
- },
- {
- "name": "Eugene Sharygin",
- "email": "eush77@gmail.com"
- }
- ],
"dependencies": {
- "collapse-white-space": "^1.0.0",
- "extend": "^3.0.0",
+ "collapse-white-space": "^1.0.2",
+ "has": "^1.0.1",
+ "is-alphabetical": "^1.0.0",
+ "is-decimal": "^1.0.0",
+ "is-whitespace-character": "^1.0.0",
+ "is-word-character": "^1.0.0",
+ "markdown-escapes": "^1.0.0",
"parse-entities": "^1.0.2",
"repeat-string": "^1.5.4",
+ "state-toggle": "^1.0.0",
"trim": "0.0.1",
"trim-trailing-lines": "^1.0.0",
"unherit": "^1.0.4",
"unist-util-remove-position": "^1.0.0",
- "vfile-location": "^2.0.0"
+ "vfile-location": "^2.0.0",
+ "xtend": "^4.0.1"
},
"deprecated": false,
- "description": "Markdown parser for remark",
- "engines": {
- "node": ">=0.11.0"
- },
- "files": [
- "index.js",
- "lib"
- ],
- "homepage": "http://remark.js.org",
- "keywords": [
- "markdown",
- "abstract",
- "syntax",
- "tree",
- "ast",
- "parse"
- ],
- "license": "MIT",
+ "description": "[Parser][] for [**unified**][unified]. Parses markdown to an [**MDAST**][mdast] syntax tree. Used in the [**remark** processor][processor]. Can be [extended][extend] to change how markdown is parsed.",
+ "devDependencies": {},
"name": "remark-parse",
- "repository": {
- "type": "git",
- "url": "https://github.com/wooorm/remark/tree/master/packages/remark-parse"
- },
- "version": "1.1.0"
+ "optionalDependencies": {},
+ "peerDependencies": {},
+ "scripts": {},
+ "version": "3.0.1"
}
diff --git a/tools/eslint/node_modules/remark-parse/readme.md b/tools/eslint/node_modules/remark-parse/readme.md
index 360e53b076..53426f41ee 100644
--- a/tools/eslint/node_modules/remark-parse/readme.md
+++ b/tools/eslint/node_modules/remark-parse/readme.md
@@ -1,7 +1,7 @@
# remark-parse [![Build Status][build-badge]][build-status] [![Coverage Status][coverage-badge]][coverage-status] [![Chat][chat-badge]][chat]
[Parser][] for [**unified**][unified]. Parses markdown to an
-[**mdast**][mdast] syntax tree. Used in the [**remark**
+[**MDAST**][mdast] syntax tree. Used in the [**remark**
processor][processor]. Can be [extended][extend] to change how
markdown is parsed.
@@ -9,7 +9,7 @@ markdown is parsed.
[npm][]:
-```bash
+```sh
npm install remark-parse
```
@@ -17,16 +17,17 @@ npm install remark-parse
```js
var unified = require('unified');
+var createStream = require('unified-stream');
var markdown = require('remark-parse');
var html = require('remark-html');
+var processor = unified()
+ .use(markdown, {commonmark: true})
+ .use(html)
+
process.stdin
- .pipe(unified())
- .use(markdown)
- .use(html)
- .pipe(process.stdout, {
- 'commonmark': true
- });
+ .pipe(createStream(processor))
+ .pipe(process.stdout);
```
## Table of Contents
@@ -52,7 +53,7 @@ process.stdin
### `processor.use(parse)`
Configure the `processor` to read markdown as input and process an
-[**mdast**][mdast] syntax tree.
+[**MDAST**][mdast] syntax tree.
#### `options`
@@ -60,12 +61,14 @@ Options are passed later through [`processor.parse()`][parse],
[`processor.process()`][process], or [`processor.pipe()`][pipe].
The following settings are supported:
-* [`gfm`][options-gfm] (`boolean`, default: `true`);
-* [`yaml`][options-yaml] (`boolean`, default: `true`);
-* [`commonmark`][options-commonmark] (`boolean`, default: `false`);
-* [`footnotes`][options-footnotes] (`boolean`, default: `false`);
-* [`pedantic`][options-pedantic] (`boolean`, default: `false`);
-* [`breaks`][options-breaks] (`boolean`, default: `false`).
+* [`gfm`][options-gfm] (`boolean`, default: `true`)
+* [`yaml`][options-yaml] (`boolean`, default: `true`)
+* [`commonmark`][options-commonmark] (`boolean`, default: `false`)
+* [`footnotes`][options-footnotes] (`boolean`, default: `false`)
+* [`pedantic`][options-pedantic] (`boolean`, default: `false`)
+* [`breaks`][options-breaks] (`boolean`, default: `false`)
+* [`blocks`][options-blocks] (`Array.<string>`, default: list of block HTML
+ elements)
##### `options.gfm`
@@ -75,11 +78,11 @@ hello ~~hi~~ world
GFM mode (default: `true`) turns on:
-* [Fenced code blocks](https://help.github.com/articles/github-flavored-markdown/#fenced-code-blocks);
-* [Autolinking of URLs](https://help.github.com/articles/github-flavored-markdown/#url-autolinking);
-* [Deletions (strikethrough)](https://help.github.com/articles/github-flavored-markdown/#strikethrough);
-* [Task lists](https://help.github.com/articles/writing-on-github/#task-lists);
-* [Tables](https://help.github.com/articles/github-flavored-markdown/#tables).
+* [Fenced code blocks](https://help.github.com/articles/github-flavored-markdown/#fenced-code-blocks)
+* [Autolinking of URLs](https://help.github.com/articles/github-flavored-markdown/#url-autolinking)
+* [Deletions (strikethrough)](https://help.github.com/articles/github-flavored-markdown/#strikethrough)
+* [Task lists](https://help.github.com/articles/writing-on-github/#task-lists)
+* [Tables](https://help.github.com/articles/github-flavored-markdown/#tables)
##### `options.yaml`
@@ -103,23 +106,23 @@ This is a paragraph
CommonMark mode (default: `false`) allows:
-* Empty lines to split blockquotes;
-* Parentheses (`(` and `)`) around for link and image titles;
-* Any escaped [ASCII-punctuation][escapes] character;
-* Closing parenthesis (`)`) as an ordered list marker;
-* URL definitions (and footnotes, when enabled) in blockquotes.
+* Empty lines to split blockquotes
+* Parentheses (`(` and `)`) around for link and image titles
+* Any escaped [ASCII-punctuation][escapes] character
+* Closing parenthesis (`)`) as an ordered list marker
+* URL definitions (and footnotes, when enabled) in blockquotes
CommonMark mode disallows:
-* Code directly following a paragraph;
+* Code directly following a paragraph
* ATX-headings (`# Hash headings`) without spacing after opening hashes
- or and before closing hashes;
-* Setext headings (`Underline headings\n---`) when following a paragraph;
-* Newlines in link and image titles;
+ or and before closing hashes
+* Setext headings (`Underline headings\n---`) when following a paragraph
+* Newlines in link and image titles
* White space in link and image URLs in auto-links (links in brackets,
- `<` and `>`);
+ `<` and `>`)
* Lazy blockquote continuation, lines not preceded by a closing angle
- bracket (`>`), for lists, code, and thematicBreak.
+ bracket (`>`), for lists, code, and thematicBreak
##### `options.footnotes`
@@ -147,6 +150,16 @@ paragraph.
Breaks mode (default: `false`) exposes newline characters inside
paragraphs as breaks.
+##### `options.blocks`
+
+```md
+<block>foo
+</block>
+```
+
+Blocks (default: a list of HTML block elements) exposes
+let’s users define block-level HTML elements.
+
##### `options.pedantic`
```md
@@ -156,12 +169,12 @@ Check out some_file_name.txt
Pedantic mode (default: `false`) turns on:
* Emphasis (`_alpha_`) and importance (`__bravo__`) with underscores
- in words;
-* Unordered lists with different markers (`*`, `-`, `+`);
+ in words
+* Unordered lists with different markers (`*`, `-`, `+`)
* If `commonmark` is also turned on, ordered lists with different
- markers (`.`, `)`);
+ markers (`.`, `)`)
* And pedantic mode removes less spaces in list-items (at most four,
- instead of the whole indent).
+ instead of the whole indent)
### `parse.Parser`
@@ -181,19 +194,19 @@ prototype to change how markdown is parsed.
The below plug-in adds a [tokenizer][] for at-mentions.
```js
-function mentions(processor) {
- var Parser = processor.Parser;
- var tokenizers = Parser.prototype.inlineTokenizers;
- var methods = Parser.prototype.inlineMethods;
+module.exports = mentions;
- /* Add an inline tokenizer (defined in the following example). */
- tokenizers.mention = tokenizeMention;
+function mentions() {
+ var Parser = this.Parser;
+ var tokenizers = Parser.prototype.inlineTokenizers;
+ var methods = Parser.prototype.inlineMethods;
- /* Run it just before `text`. */
- methods.splice(methods.indexOf('text'), 0, 'mention');
-}
+ /* Add an inline tokenizer (defined in the following example). */
+ tokenizers.mention = tokenizeMention;
-module.exports = mentions;
+ /* Run it just before `text`. */
+ methods.splice(methods.indexOf('text'), 0, 'mention');
+}
```
### `Parser#blockTokenizers`
@@ -221,27 +234,24 @@ which they run.
### `function tokenizer(eat, value, silent)`
```js
+tokenizeMention.notInLink = true;
+tokenizeMention.locator = locateMention;
+
function tokenizeMention(eat, value, silent) {
- var match = /^@(\w+)/.exec(value);
-
- if (match) {
- if (silent) {
- return true;
- }
-
- return eat(match[0])({
- 'type': 'link',
- 'url': 'https://social-network/' + match[1],
- 'children': [{
- 'type': 'text',
- 'value': match[0]
- }]
- });
+ var match = /^@(\w+)/.exec(value);
+
+ if (match) {
+ if (silent) {
+ return true;
}
-}
-tokenizeMention.notInLink = true;
-tokenizeMention.locator = locateMention;
+ return eat(match[0])({
+ type: 'link',
+ url: 'https://social-network/' + match[1],
+ children: [{type: 'text', value: match[0]}]
+ });
+ }
+}
```
The parser knows two types of tokenizers: block level and inline level.
@@ -256,39 +266,39 @@ information on where the next entity may occur.
###### Signatures
-* `Node? = tokenizer(eat, value)`;
-* `boolean? = tokenizer(eat, value, silent)`.
+* `Node? = tokenizer(eat, value)`
+* `boolean? = tokenizer(eat, value, silent)`
###### Parameters
-* `eat` ([`Function`][eat]) — Eat, when applicable, an entity;
-* `value` (`string`) — Value which may start an entity;
-* `silent` (`boolean`, optional) — Whether to detect or consume.
+* `eat` ([`Function`][eat]) — Eat, when applicable, an entity
+* `value` (`string`) — Value which may start an entity
+* `silent` (`boolean`, optional) — Whether to detect or consume
###### Properties
* `locator` ([`Function`][locator])
- — Required for inline tokenizers;
+ — Required for inline tokenizers
* `onlyAtStart` (`boolean`)
- — Whether nodes can only be found at the beginning of the document;
+ — Whether nodes can only be found at the beginning of the document
* `notInBlock` (`boolean`)
— Whether nodes cannot be in blockquotes, lists, or footnote
- definitions;
+ definitions
+* `notInList` (`boolean`)
+ — Whether nodes cannot be in lists
* `notInLink` (`boolean`)
- — Whether nodes cannot be in lists.
-* `notInLink` (`boolean`)
- — Whether nodes cannot be in links.
+ — Whether nodes cannot be in links
###### Returns
-* In _silent_ mode, whether a node can be found at the start of `value`;
-* In _normal_ mode, a node if it can be found at the start of `value`.
+* In _silent_ mode, whether a node can be found at the start of `value`
+* In _normal_ mode, a node if it can be found at the start of `value`
### `tokenizer.locator(value, fromIndex)`
```js
function locateMention(value, fromIndex) {
- return value.indexOf('@', fromIndex);
+ return value.indexOf('@', fromIndex);
}
```
@@ -300,8 +310,8 @@ the index they return, but they must skip any nodes.
###### Parameters
-* `value` (`string`) — Value which may contain an entity;
-* `fromIndex` (`number`) — Position to start searching at.
+* `value` (`string`) — Value which may contain an entity
+* `fromIndex` (`number`) — Position to start searching at
###### Returns
@@ -336,9 +346,9 @@ Add [positional information][location] to `node` and add it to `parent`.
###### Parameters
-* `node` ([`Node`][node]) - Node to patch position on and insert;
+* `node` ([`Node`][node]) - Node to patch position on and insert
* `parent` ([`Node`][node], optional) - Place to add `node` to in
- the syntax tree. Defaults to the currently processed node.
+ the syntax tree. Defaults to the currently processed node
###### Returns
@@ -361,9 +371,9 @@ for list items
###### Parameters
-* `node` ([`Node`][node]) - Node to patch position on and insert;
+* `node` ([`Node`][node]) - Node to patch position on and insert
* `parent` ([`Node`][node], optional) - Place to add `node` to in
- the syntax tree. Defaults to the currently processed node.
+ the syntax tree. Defaults to the currently processed node
###### Returns
@@ -423,6 +433,8 @@ The given `node`.
[options-breaks]: #optionsbreaks
+[options-blocks]: #optionsblocks
+
[parser]: https://github.com/wooorm/unified#processorparser
[extend]: #extending-the-parser
diff --git a/tools/eslint/node_modules/remark-stringify/index.js b/tools/eslint/node_modules/remark-stringify/index.js
deleted file mode 100644
index 44b01bb09f..0000000000
--- a/tools/eslint/node_modules/remark-stringify/index.js
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * @author Titus Wormer
- * @copyright 2015-2016 Titus Wormer
- * @license MIT
- * @module remark:stringify
- * @fileoverview Markdown Compiler.
- */
-
-'use strict';
-
-/* eslint-env commonjs */
-
-/* Dependencies. */
-var unherit = require('unherit');
-var Compiler = require('./lib/compiler.js');
-
-/**
- * Attacher.
- *
- * @param {unified} processor - Unified processor.
- */
-function stringify(processor) {
- processor.Compiler = unherit(Compiler);
-}
-
-/* Patch `Compiler`. */
-stringify.Compiler = Compiler;
-
-/* Expose. */
-module.exports = stringify;
diff --git a/tools/eslint/node_modules/remark-stringify/lib/compiler.js b/tools/eslint/node_modules/remark-stringify/lib/compiler.js
deleted file mode 100644
index 85194a51e3..0000000000
--- a/tools/eslint/node_modules/remark-stringify/lib/compiler.js
+++ /dev/null
@@ -1,2629 +0,0 @@
-/**
- * @author Titus Wormer
- * @copyright 2015-2016 Titus Wormer
- * @license MIT
- * @module remark:compiler
- * @fileoverview Markdown compiler
- */
-
-'use strict';
-
-/* eslint-env commonjs */
-
-/*
- * Dependencies.
- */
-
-var decode = require('parse-entities');
-var encode = require('stringify-entities');
-var table = require('markdown-table');
-var repeat = require('repeat-string');
-var extend = require('extend');
-var ccount = require('ccount');
-var longestStreak = require('longest-streak');
-var defaultOptions = require('./defaults.js');
-
-/*
- * Constants.
- */
-
-var INDENT = 4;
-var MINIMUM_CODE_FENCE_LENGTH = 3;
-var YAML_FENCE_LENGTH = 3;
-var MINIMUM_RULE_LENGTH = 3;
-var MAILTO = 'mailto:';
-var ERROR_LIST_ITEM_INDENT = 'Cannot indent code properly. See ' +
- 'http://git.io/vgFvT';
-
-/*
- * Expressions.
- */
-
-var EXPRESSIONS_WHITE_SPACE = /\s/;
-
-/*
- * Naive fence expression.
- */
-
-var FENCE = /([`~])\1{2}/;
-
-/*
- * Expression for a protocol.
- *
- * @see http://en.wikipedia.org/wiki/URI_scheme#Generic_syntax
- */
-
-var PROTOCOL = /^[a-z][a-z+.-]+:\/?/i;
-
-/*
- * Punctuation characters.
- */
-
-var PUNCTUATION = /[-!"#$%&'()*+,.\/:;<=>?@\[\\\]^`{|}~_]/;
-
-/*
- * Characters.
- */
-
-var ANGLE_BRACKET_CLOSE = '>';
-var ANGLE_BRACKET_OPEN = '<';
-var ASTERISK = '*';
-var BACKSLASH = '\\';
-var CARET = '^';
-var COLON = ':';
-var SEMICOLON = ';';
-var DASH = '-';
-var DOT = '.';
-var EMPTY = '';
-var EQUALS = '=';
-var EXCLAMATION_MARK = '!';
-var HASH = '#';
-var AMPERSAND = '&';
-var LINE = '\n';
-var CARRIAGE = '\r';
-var FORM_FEED = '\f';
-var PARENTHESIS_OPEN = '(';
-var PARENTHESIS_CLOSE = ')';
-var PIPE = '|';
-var PLUS = '+';
-var QUOTE_DOUBLE = '"';
-var QUOTE_SINGLE = '\'';
-var SPACE = ' ';
-var TAB = '\t';
-var VERTICAL_TAB = '\u000B';
-var SQUARE_BRACKET_OPEN = '[';
-var SQUARE_BRACKET_CLOSE = ']';
-var TICK = '`';
-var TILDE = '~';
-var UNDERSCORE = '_';
-
-/**
- * Check whether `character` is numeric.
- *
- * @param {string} character - Single character to check.
- * @return {boolean} - Whether `character` is numeric.
- */
-function isNumeric(character) {
- return /[0-9]/.test(character);
-}
-
-/**
- * Check whether `character` is alphanumeric.
- *
- * @param {string} character - Single character to check.
- * @return {boolean} - Whether `character` is alphanumeric.
- */
-function isAlphanumeric(character) {
- return /\w/.test(character) && character !== UNDERSCORE;
-}
-
-/*
- * Entities.
- */
-
-var ENTITY_AMPERSAND = AMPERSAND + 'amp' + SEMICOLON;
-var ENTITY_ANGLE_BRACKET_OPEN = AMPERSAND + 'lt' + SEMICOLON;
-var ENTITY_COLON = AMPERSAND + '#x3A' + SEMICOLON;
-
-/*
- * Character combinations.
- */
-
-var BREAK = LINE + LINE;
-var GAP = BREAK + LINE;
-var DOUBLE_TILDE = TILDE + TILDE;
-
-/*
- * Allowed entity options.
- */
-
-var ENTITY_OPTIONS = {};
-
-ENTITY_OPTIONS.true = true;
-ENTITY_OPTIONS.false = true;
-ENTITY_OPTIONS.numbers = true;
-ENTITY_OPTIONS.escape = true;
-
-/*
- * Allowed list-bullet characters.
- */
-
-var LIST_BULLETS = {};
-
-LIST_BULLETS[ASTERISK] = true;
-LIST_BULLETS[DASH] = true;
-LIST_BULLETS[PLUS] = true;
-
-/*
- * Allowed horizontal-rule bullet characters.
- */
-
-var THEMATIC_BREAK_BULLETS = {};
-
-THEMATIC_BREAK_BULLETS[ASTERISK] = true;
-THEMATIC_BREAK_BULLETS[DASH] = true;
-THEMATIC_BREAK_BULLETS[UNDERSCORE] = true;
-
-/*
- * Allowed emphasis characters.
- */
-
-var EMPHASIS_MARKERS = {};
-
-EMPHASIS_MARKERS[UNDERSCORE] = true;
-EMPHASIS_MARKERS[ASTERISK] = true;
-
-/*
- * Allowed fence markers.
- */
-
-var FENCE_MARKERS = {};
-
-FENCE_MARKERS[TICK] = true;
-FENCE_MARKERS[TILDE] = true;
-
-/*
- * Which method to use based on `list.ordered`.
- */
-
-var ORDERED_MAP = {};
-
-ORDERED_MAP.true = 'visitOrderedItems';
-ORDERED_MAP.false = 'visitUnorderedItems';
-
-/*
- * Allowed list-item-indent's.
- */
-
-var LIST_ITEM_INDENTS = {};
-
-var LIST_ITEM_TAB = 'tab';
-var LIST_ITEM_ONE = '1';
-var LIST_ITEM_MIXED = 'mixed';
-
-LIST_ITEM_INDENTS[LIST_ITEM_ONE] = true;
-LIST_ITEM_INDENTS[LIST_ITEM_TAB] = true;
-LIST_ITEM_INDENTS[LIST_ITEM_MIXED] = true;
-
-/*
- * Which checkbox to use.
- */
-
-var CHECKBOX_MAP = {};
-
-CHECKBOX_MAP.null = EMPTY;
-CHECKBOX_MAP.undefined = EMPTY;
-CHECKBOX_MAP.true = SQUARE_BRACKET_OPEN + 'x' + SQUARE_BRACKET_CLOSE + SPACE;
-CHECKBOX_MAP.false = SQUARE_BRACKET_OPEN + SPACE + SQUARE_BRACKET_CLOSE +
- SPACE;
-
-/**
- * Throw an exception with in its `message` `value`
- * and `name`.
- *
- * @param {*} value - Invalid value.
- * @param {string} name - Setting name.
- */
-function raise(value, name) {
- throw new Error(
- 'Invalid value `' + value + '` ' +
- 'for setting `' + name + '`'
- );
-}
-
-/**
- * Validate a value to be boolean. Defaults to `def`.
- * Raises an exception with `context[name]` when not
- * a boolean.
- *
- * @example
- * validateBoolean({foo: null}, 'foo', true) // true
- * validateBoolean({foo: false}, 'foo', true) // false
- * validateBoolean({foo: 'bar'}, 'foo', true) // Throws
- *
- * @throws {Error} - When a setting is neither omitted nor
- * a boolean.
- * @param {Object} context - Settings.
- * @param {string} name - Setting name.
- * @param {boolean} def - Default value.
- */
-function validateBoolean(context, name, def) {
- var value = context[name];
-
- if (value === null || value === undefined) {
- value = def;
- }
-
- if (typeof value !== 'boolean') {
- raise(value, 'options.' + name);
- }
-
- context[name] = value;
-}
-
-/**
- * Validate a value to be boolean. Defaults to `def`.
- * Raises an exception with `context[name]` when not
- * a boolean.
- *
- * @example
- * validateNumber({foo: null}, 'foo', 1) // 1
- * validateNumber({foo: 2}, 'foo', 1) // 2
- * validateNumber({foo: 'bar'}, 'foo', 1) // Throws
- *
- * @throws {Error} - When a setting is neither omitted nor
- * a number.
- * @param {Object} context - Settings.
- * @param {string} name - Setting name.
- * @param {number} def - Default value.
- */
-function validateNumber(context, name, def) {
- var value = context[name];
-
- if (value === null || value === undefined) {
- value = def;
- }
-
- if (typeof value !== 'number' || value !== value) {
- raise(value, 'options.' + name);
- }
-
- context[name] = value;
-}
-
-/**
- * Validate a value to be in `map`. Defaults to `def`.
- * Raises an exception with `context[name]` when not
- * in `map`.
- *
- * @example
- * var map = {bar: true, baz: true};
- * validateString({foo: null}, 'foo', 'bar', map) // 'bar'
- * validateString({foo: 'baz'}, 'foo', 'bar', map) // 'baz'
- * validateString({foo: true}, 'foo', 'bar', map) // Throws
- *
- * @throws {Error} - When a setting is neither omitted nor
- * in `map`.
- * @param {Object} context - Settings.
- * @param {string} name - Setting name.
- * @param {string} def - Default value.
- * @param {Object} map - Enum.
- */
-function validateString(context, name, def, map) {
- var value = context[name];
-
- if (value === null || value === undefined) {
- value = def;
- }
-
- if (!(value in map)) {
- raise(value, 'options.' + name);
- }
-
- context[name] = value;
-}
-
-/*
- * Expose `validate`.
- */
-
-var validate = {
- 'boolean': validateBoolean,
- 'string': validateString,
- 'number': validateNumber
-};
-
-/**
- * Construct a state `toggler`: a function which inverses
- * `property` in context based on its current value.
- * The by `toggler` returned function restores that value.
- *
- * @example
- * var context = {};
- * var key = 'foo';
- * var val = true;
- * context[key] = val;
- * context.enter = toggler(key, val);
- * context[key]; // true
- * var exit = context.enter();
- * context[key]; // false
- * var nested = context.enter();
- * context[key]; // false
- * nested();
- * context[key]; // false
- * exit();
- * context[key]; // true
- *
- * @param {string} key - Property to toggle.
- * @param {boolean} state - It's default state.
- * @return {function(): function()} - Enter.
- */
-function toggler(key, state) {
- /**
- * Construct a toggler for the bound `key`.
- *
- * @return {Function} - Exit state.
- */
- function enter() {
- var self = this;
- var current = self[key];
-
- self[key] = !state;
-
- /**
- * State canceler, cancels the state, if allowed.
- */
- function exit() {
- self[key] = current;
- }
-
- return exit;
- }
-
- return enter;
-}
-
-/**
- * Check whether a node is mergeable with adjacent nodes.
- *
- * @param {Object} node - Node to check.
- * @return {boolean} - Whether `node` is mergable.
- */
-function mergeable(node) {
- var start;
- var end;
-
- if (node.type !== 'text' || !node.position) {
- return true;
- }
-
- start = node.position.start;
- end = node.position.end;
-
- /*
- * Only merge nodes which occupy the same size as their
- * `value`.
- */
-
- return start.line !== end.line ||
- end.column - start.column === node.value.length;
-}
-
-/**
- * Encode noop.
- * Simply returns the given value.
- *
- * @example
- * var encode = encodeNoop();
- * encode('AT&T') // 'AT&T'
- *
- * @param {string} value - Content.
- * @return {string} - Content, without any modifications.
- */
-function encodeNoop(value) {
- return value;
-}
-
-/**
- * Factory to encode HTML entities.
- * Creates a no-operation function when `type` is
- * `'false'`, a function which encodes using named
- * references when `type` is `'true'`, and a function
- * which encodes using numbered references when `type` is
- * `'numbers'`.
- *
- * @example
- * encodeFactory('false')('AT&T') // 'AT&T'
- * encodeFactory('true')('AT&T') // 'AT&amp;T'
- * encodeFactory('numbers')('AT&T') // 'ATT&#x26;T'
- *
- * @param {string} type - Either `'true'`, `'false'`, or
- * `'numbers'`.
- * @return {function(string): string} - Function which
- * takes a value and returns its encoded version.
- */
-function encodeFactory(type) {
- var options = {};
-
- if (type === 'false') {
- return encodeNoop;
- }
-
- if (type === 'true') {
- options.useNamedReferences = true;
- }
-
- if (type === 'escape') {
- options.escapeOnly = options.useNamedReferences = true;
- }
-
- /**
- * Encode HTML entities using the bound options.
- *
- * @example
- * // When `type` is `'true'`.
- * encode('AT&T'); // 'AT&amp;T'
- *
- * // When `type` is `'numbers'`.
- * encode('AT&T'); // 'ATT&#x26;T'
- *
- * @param {string} value - Content.
- * @param {Object} [node] - Node which is compiled.
- * @return {string} - Encoded content.
- */
- function encoder(value) {
- return encode(value, options);
- }
-
- return encoder;
-}
-
-/**
- * Returns the length of HTML entity that is a prefix of
- * the given string (excluding the ampersand), 0 if it
- * does not start with an entity.
- *
- * @example
- * entityPrefixLength('&copycat') // 4
- * entityPrefixLength('&foo &amp &bar') // 0
- *
- * @param {string} value - Input string.
- * @return {number} - Length of an entity.
- */
-function entityPrefixLength(value) {
- var prefix;
-
- /* istanbul ignore if - Currently also tested for at
- * implemention, but we keep it here because that’s
- * proper. */
- if (value.charAt(0) !== AMPERSAND) {
- return 0;
- }
-
- prefix = value.split(AMPERSAND, 2).join(AMPERSAND);
-
- return prefix.length - decode(prefix).length;
-}
-
-/**
- * Checks if a string starts with HTML entity.
- *
- * @example
- * startsWithEntity('&copycat') // true
- * startsWithEntity('&foo &amp &bar') // false
- *
- * @param {string} value - Value to check.
- * @return {number} - Whether `value` starts an entity.
- */
-function startsWithEntity(value) {
- return entityPrefixLength(value) > 0;
-}
-
-/**
- * Check if `character` is a valid alignment row character.
- *
- * @example
- * isAlignmentRowCharacter(':') // true
- * isAlignmentRowCharacter('=') // false
- *
- * @param {string} character - Character to check.
- * @return {boolean} - Whether `character` is a valid
- * alignment row character.
- */
-function isAlignmentRowCharacter(character) {
- return character === COLON ||
- character === DASH ||
- character === SPACE ||
- character === PIPE;
-}
-
-/**
- * Check if `index` in `value` is inside an alignment row.
- *
- * @example
- * isInAlignmentRow(':--:', 2) // true
- * isInAlignmentRow(':--:\n:-*-:', 9) // false
- *
- * @param {string} value - Value to check.
- * @param {number} index - Position in `value` to check.
- * @return {boolean} - Whether `index` in `value` is in
- * an alignment row.
- */
-function isInAlignmentRow(value, index) {
- var length = value.length;
- var start = index;
- var character;
-
- while (++index < length) {
- character = value.charAt(index);
-
- if (character === LINE) {
- break;
- }
-
- if (!isAlignmentRowCharacter(character)) {
- return false;
- }
- }
-
- index = start;
-
- while (--index > -1) {
- character = value.charAt(index);
-
- if (character === LINE) {
- break;
- }
-
- if (!isAlignmentRowCharacter(character)) {
- return false;
- }
- }
-
- return true;
-}
-
-/**
- * Factory to escape characters.
- *
- * @example
- * var escape = escapeFactory({ commonmark: true });
- * escape('x*x', { type: 'text', value: 'x*x' }) // 'x\\*x'
- *
- * @param {Object} options - Compiler options.
- * @return {function(value, node, parent): string} - Function which
- * takes a value and a node and (optionally) its parent and returns
- * its escaped value.
- */
-function escapeFactory(options) {
- /**
- * Escape punctuation characters in a node's value.
- *
- * @param {string} value - Value to escape.
- * @param {Object} node - Node in which `value` exists.
- * @param {Object} [parent] - Parent of `node`.
- * @return {string} - Escaped `value`.
- */
- return function escape(value, node, parent) {
- var self = this;
- var gfm = options.gfm;
- var commonmark = options.commonmark;
- var pedantic = options.pedantic;
- var siblings = parent && parent.children;
- var index = siblings && siblings.indexOf(node);
- var prev = siblings && siblings[index - 1];
- var next = siblings && siblings[index + 1];
- var length = value.length;
- var position = -1;
- var queue = [];
- var escaped = queue;
- var afterNewLine;
- var character;
- var wordCharBefore;
- var wordCharAfter;
- var offset;
-
- if (prev) {
- afterNewLine = prev.type === 'text' && /\n\s*$/.test(prev.value);
- } else if (parent) {
- afterNewLine = parent.type === 'paragraph';
- }
-
- while (++position < length) {
- character = value.charAt(position);
-
- if (
- character === BACKSLASH ||
- character === TICK ||
- character === ASTERISK ||
- character === SQUARE_BRACKET_OPEN ||
- (
- character === UNDERSCORE &&
- /*
- * Delegate leading/trailing underscores
- * to the multinode version below.
- */
- 0 < position &&
- position < length - 1 &&
- (
- pedantic ||
- !isAlphanumeric(value.charAt(position - 1)) ||
- !isAlphanumeric(value.charAt(position + 1))
- )
- ) ||
- (self.inLink && character === SQUARE_BRACKET_CLOSE) ||
- (
- gfm &&
- character === PIPE &&
- (
- self.inTable ||
- isInAlignmentRow(value, position)
- )
- )
- ) {
- afterNewLine = false;
- queue.push(BACKSLASH);
- } else if (character === ANGLE_BRACKET_OPEN) {
- afterNewLine = false;
-
- if (commonmark) {
- queue.push(BACKSLASH);
- } else {
- queue.push(ENTITY_ANGLE_BRACKET_OPEN);
- continue;
- }
- } else if (
- gfm &&
- !self.inLink &&
- character === COLON &&
- (
- queue.slice(-6).join(EMPTY) === 'mailto' ||
- queue.slice(-5).join(EMPTY) === 'https' ||
- queue.slice(-4).join(EMPTY) === 'http'
- )
- ) {
- afterNewLine = false;
-
- if (commonmark) {
- queue.push(BACKSLASH);
- } else {
- queue.push(ENTITY_COLON);
- continue;
- }
- /* istanbul ignore if - Impossible to test with
- * the current set-up. We need tests which try
- * to force markdown content into the tree. */
- } else if (
- character === AMPERSAND &&
- startsWithEntity(value.slice(position))
- ) {
- afterNewLine = false;
-
- if (commonmark) {
- queue.push(BACKSLASH);
- } else {
- queue.push(ENTITY_AMPERSAND);
- continue;
- }
- } else if (
- gfm &&
- character === TILDE &&
- value.charAt(position + 1) === TILDE
- ) {
- queue.push(BACKSLASH, TILDE);
- afterNewLine = false;
- position += 1;
- } else if (character === LINE) {
- afterNewLine = true;
- } else if (afterNewLine) {
- if (
- character === ANGLE_BRACKET_CLOSE ||
- character === HASH ||
- LIST_BULLETS[character]
- ) {
- queue.push(BACKSLASH);
- afterNewLine = false;
- } else if (isNumeric(character)) {
- offset = position + 1;
-
- while (offset < length) {
- if (!isNumeric(value.charAt(offset))) {
- break;
- }
-
- offset++;
- }
-
- if (
- value.charAt(offset) === DOT ||
- (
- commonmark &&
- /* istanbul ignore next - hard to test :( */
- value.charAt(offset) === PARENTHESIS_CLOSE
- )
- ) {
- queue.push(value.slice(position, offset), BACKSLASH);
- position = offset;
- character = value.charAt(position);
- }
-
- afterNewLine = false;
- } else if (
- character !== SPACE &&
- character !== TAB &&
- character !== CARRIAGE &&
- character !== VERTICAL_TAB &&
- character !== FORM_FEED
- ) {
- afterNewLine = false;
- }
- }
-
- queue.push(character);
- }
-
- /*
- * Multi-node versions.
- */
-
- if (siblings && node.type === 'text') {
- /*
- * Check for an opening parentheses after a
- * link-reference (which can be joined by
- * white-space).
- */
-
- if (
- prev &&
- prev.referenceType === 'shortcut'
- ) {
- position = -1;
- length = escaped.length;
-
- while (++position < length) {
- character = escaped[position];
-
- if (character === SPACE || character === TAB) {
- continue;
- }
-
- if (character === PARENTHESIS_OPEN) {
- escaped[position] = BACKSLASH + character;
- }
-
- if (character === COLON) {
- if (commonmark) {
- escaped[position] = BACKSLASH + character;
- } else {
- escaped[position] = ENTITY_COLON;
- }
- }
-
- break;
- }
-
- /*
- * If the current node is all spaces / tabs,
- * preceded by a shortcut, and followed by
- * a text starting with `(`, escape it.
- */
-
- if (
- next &&
- position === length &&
- next.type === 'text' &&
- next.value.charAt(0) === PARENTHESIS_OPEN
- ) {
- escaped.push(BACKSLASH);
- }
- }
-
- /*
- * Ensure non-auto-links are not seen as links.
- * This pattern needs to check the preceding
- * nodes too.
- */
-
- if (
- gfm &&
- !self.inLink &&
- prev &&
- prev.type === 'text' &&
- value.charAt(0) === COLON
- ) {
- queue = prev.value.slice(-6);
-
- if (
- queue === 'mailto' ||
- queue.slice(-5) === 'https' ||
- queue.slice(-4) === 'http'
- ) {
- if (commonmark) {
- escaped.unshift(BACKSLASH);
- } else {
- escaped.splice(0, 1, ENTITY_COLON);
- }
- }
- }
-
- /*
- * Escape ampersand if it would otherwise
- * start an entity.
- */
-
- if (
- next &&
- next.type === 'text' &&
- value.slice(-1) === AMPERSAND &&
- startsWithEntity(AMPERSAND + next.value)
- ) {
- if (commonmark) {
- escaped.splice(escaped.length - 1, 0, BACKSLASH);
- } else {
- escaped.push('amp', SEMICOLON);
- }
- }
-
- /*
- * Escape double tildes in GFM.
- */
-
- if (
- gfm &&
- next &&
- next.type === 'text' &&
- value.slice(-1) === TILDE &&
- next.value.charAt(0) === TILDE
- ) {
- escaped.splice(escaped.length - 1, 0, BACKSLASH);
- }
-
- /*
- * Escape underscores, but not mid-word (unless
- * in pedantic mode).
- */
-
- wordCharBefore = prev &&
- prev.type === 'text' &&
- isAlphanumeric(prev.value.slice(-1))
-
- wordCharAfter = next &&
- next.type === 'text' &&
- isAlphanumeric(next.value.charAt(0))
-
- if (length <= 1) {
- if (
- value === UNDERSCORE &&
- (
- pedantic ||
- !wordCharBefore ||
- !wordCharAfter
- )
- ) {
- escaped.unshift(BACKSLASH);
- }
- } else {
- if (
- value.charAt(0) === UNDERSCORE &&
- (
- pedantic ||
- !wordCharBefore ||
- /* istanbul ignore next - only for trees */
- !isAlphanumeric(value.charAt(1))
- )
- ) {
- escaped.unshift(BACKSLASH);
- }
-
- if (
- value.slice(-1) === UNDERSCORE &&
- (
- pedantic ||
- !wordCharAfter ||
- /* istanbul ignore next - only for trees */
- !isAlphanumeric(value.slice(-2).charAt(0))
- )
- ) {
- escaped.splice(escaped.length - 1, 0, BACKSLASH);
- }
- }
- }
-
- return escaped.join(EMPTY);
- };
-}
-
-/**
- * Wrap `url` in angle brackets when needed, or when
- * forced.
- *
- * In links, images, and definitions, the URL part needs
- * to be enclosed when it:
- *
- * - has a length of `0`;
- * - contains white-space;
- * - has more or less opening than closing parentheses.
- *
- * @example
- * encloseURI('foo bar') // '<foo bar>'
- * encloseURI('foo(bar(baz)') // '<foo(bar(baz)>'
- * encloseURI('') // '<>'
- * encloseURI('example.com') // 'example.com'
- * encloseURI('example.com', true) // '<example.com>'
- *
- * @param {string} uri - URI to enclose.
- * @param {boolean?} [always] - Force enclosing.
- * @return {boolean} - Properly enclosed `uri`.
- */
-function encloseURI(uri, always) {
- if (
- always ||
- !uri.length ||
- EXPRESSIONS_WHITE_SPACE.test(uri) ||
- ccount(uri, PARENTHESIS_OPEN) !== ccount(uri, PARENTHESIS_CLOSE)
- ) {
- return ANGLE_BRACKET_OPEN + uri + ANGLE_BRACKET_CLOSE;
- }
-
- return uri;
-}
-
-/**
- * There is currently no way to support nested delimiters
- * across Markdown.pl, CommonMark, and GitHub (RedCarpet).
- * The following code supports Markdown.pl and GitHub.
- * CommonMark is not supported when mixing double- and
- * single quotes inside a title.
- *
- * @see https://github.com/vmg/redcarpet/issues/473
- * @see https://github.com/jgm/CommonMark/issues/308
- *
- * @example
- * encloseTitle('foo') // '"foo"'
- * encloseTitle('foo \'bar\' baz') // '"foo \'bar\' baz"'
- * encloseTitle('foo "bar" baz') // '\'foo "bar" baz\''
- * encloseTitle('foo "bar" \'baz\'') // '"foo "bar" \'baz\'"'
- *
- * @param {string} title - Content.
- * @return {string} - Properly enclosed title.
- */
-function encloseTitle(title) {
- var delimiter = QUOTE_DOUBLE;
-
- if (title.indexOf(delimiter) !== -1) {
- delimiter = QUOTE_SINGLE;
- }
-
- return delimiter + title + delimiter;
-}
-
-/**
- * Pad `value` with `level * INDENT` spaces. Respects
- * lines. Ignores empty lines.
- *
- * @example
- * pad('foo', 1) // ' foo'
- *
- * @param {string} value - Content.
- * @param {number} level - Indentation level.
- * @return {string} - Padded `value`.
- */
-function pad(value, level) {
- var index;
- var padding;
-
- value = value.split(LINE);
-
- index = value.length;
- padding = repeat(SPACE, level * INDENT);
-
- while (index--) {
- if (value[index].length !== 0) {
- value[index] = padding + value[index];
- }
- }
-
- return value.join(LINE);
-}
-
-/**
- * Construct a new compiler.
- *
- * @example
- * var compiler = new Compiler(new File('> foo.'));
- *
- * @constructor
- * @class {Compiler}
- * @param {File} file - Virtual file.
- * @param {Object?} [options] - Passed to
- * `Compiler#setOptions()`.
- */
-function Compiler(file, options) {
- var self = this;
-
- self.file = file;
-
- self.options = extend({}, self.options);
-
- self.setOptions(options);
-}
-
-/*
- * Cache prototype.
- */
-
-var compilerPrototype = Compiler.prototype;
-
-/*
- * Expose defaults.
- */
-
-compilerPrototype.options = defaultOptions;
-
-/*
- * Expose visitors.
- */
-
-var visitors = compilerPrototype.visitors = {};
-
-/*
- * Map of applicable enum's.
- */
-
-var maps = {
- 'entities': ENTITY_OPTIONS,
- 'bullet': LIST_BULLETS,
- 'rule': THEMATIC_BREAK_BULLETS,
- 'listItemIndent': LIST_ITEM_INDENTS,
- 'emphasis': EMPHASIS_MARKERS,
- 'strong': EMPHASIS_MARKERS,
- 'fence': FENCE_MARKERS
-};
-
-/**
- * Set options. Does not overwrite previously set
- * options.
- *
- * @example
- * var compiler = new Compiler();
- * compiler.setOptions({bullet: '*'});
- *
- * @this {Compiler}
- * @throws {Error} - When an option is invalid.
- * @param {Object?} [options] - Stringify settings.
- * @return {Compiler} - `self`.
- */
-compilerPrototype.setOptions = function (options) {
- var self = this;
- var current = self.options;
- var ruleRepetition;
- var key;
-
- if (options === null || options === undefined) {
- options = {};
- } else if (typeof options === 'object') {
- options = extend({}, options);
- } else {
- throw new Error(
- 'Invalid value `' + options + '` ' +
- 'for setting `options`'
- );
- }
-
- for (key in defaultOptions) {
- validate[typeof current[key]](
- options, key, current[key], maps[key]
- );
- }
-
- ruleRepetition = options.ruleRepetition;
-
- if (ruleRepetition && ruleRepetition < MINIMUM_RULE_LENGTH) {
- raise(ruleRepetition, 'options.ruleRepetition');
- }
-
- self.encode = encodeFactory(String(options.entities));
- self.escape = escapeFactory(options);
-
- self.options = options;
-
- return self;
-};
-
-/*
- * Enter and exit helpers.
- */
-
-compilerPrototype.enterLink = toggler('inLink', false);
-compilerPrototype.enterTable = toggler('inTable', false);
-
-/**
- * Shortcut and collapsed link references need no escaping
- * and encoding during the processing of child nodes (it
- * must be implied from identifier).
- *
- * This toggler turns encoding and escaping off for shortcut
- * and collapsed references.
- *
- * Implies `enterLink`.
- *
- * @param {Compiler} compiler - Compiler instance.
- * @param {LinkReference} node - LinkReference node.
- * @return {Function} - Exit state.
- */
-compilerPrototype.enterLinkReference = function (compiler, node) {
- var encode = compiler.encode;
- var escape = compiler.escape;
- var exitLink = compiler.enterLink();
-
- if (
- node.referenceType === 'shortcut' ||
- node.referenceType === 'collapsed'
- ) {
- compiler.encode = compiler.escape = encodeNoop;
- return function () {
- compiler.encode = encode;
- compiler.escape = escape;
- exitLink();
- };
- } else {
- return exitLink;
- }
-};
-
-/**
- * Visit a node.
- *
- * @example
- * var compiler = new Compiler();
- *
- * compiler.visit({
- * type: 'strong',
- * children: [{
- * type: 'text',
- * value: 'Foo'
- * }]
- * });
- * // '**Foo**'
- *
- * @param {Object} node - Node.
- * @param {Object?} [parent] - `node`s parent.
- * @return {string} - Compiled `node`.
- */
-compilerPrototype.visit = function (node, parent) {
- var self = this;
-
- /*
- * Fail on unknown nodes.
- */
-
- if (typeof self.visitors[node.type] !== 'function') {
- self.file.fail(
- 'Missing compiler for node of type `' +
- node.type + '`: `' + node + '`',
- node
- );
- }
-
- return self.visitors[node.type].call(self, node, parent);
-};
-
-/**
- * Visit all children of `parent`.
- *
- * @example
- * var compiler = new Compiler();
- *
- * compiler.all({
- * type: 'strong',
- * children: [{
- * type: 'text',
- * value: 'Foo'
- * },
- * {
- * type: 'text',
- * value: 'Bar'
- * }]
- * });
- * // ['Foo', 'Bar']
- *
- * @param {Object} parent - Parent node of children.
- * @return {Array.<string>} - List of compiled children.
- */
-compilerPrototype.all = function (parent) {
- var self = this;
- var children = parent.children;
- var values = [];
- var results = [];
- var length = children.length;
- var index = 0;
- var node = children[0];
- var next;
-
- if (!length) {
- return values;
- }
-
- length++;
-
- while (++index < length) {
- next = children[index];
-
- if (
- next &&
- node.type === 'text' &&
- node.type === next.type &&
- mergeable(node) &&
- mergeable(next)
- ) {
- node.value += next.value;
- } else {
- values.push(node);
- node = next;
- }
- }
-
- index = -1;
- length = values.length;
- parent.children = values;
-
- while (++index < length) {
- results[index] = self.visit(values[index], parent);
- }
-
- return results;
-};
-
-/**
- * Visit ordered list items.
- *
- * Starts the list with
- * `node.start` and increments each following list item
- * bullet by one:
- *
- * 2. foo
- * 3. bar
- *
- * In `incrementListMarker: false` mode, does not increment
- * each marker and stays on `node.start`:
- *
- * 1. foo
- * 1. bar
- *
- * Adds an extra line after an item if it has
- * `loose: true`.
- *
- * @example
- * var compiler = new Compiler();
- *
- * compiler.visitOrderedItems({
- * type: 'list',
- * ordered: true,
- * children: [{
- * type: 'listItem',
- * children: [{
- * type: 'text',
- * value: 'bar'
- * }]
- * }]
- * });
- * // '1. bar'
- *
- * @param {Object} node - `list` node with
- * `ordered: true`.
- * @return {string} - Markdown list.
- */
-compilerPrototype.visitOrderedItems = function (node) {
- var self = this;
- var increment = self.options.incrementListMarker;
- var values = [];
- var start = node.start;
- var children = node.children;
- var length = children.length;
- var index = -1;
- var bullet;
- var fn = self.visitors.listItem;
-
- while (++index < length) {
- bullet = (increment ? start + index : start) + DOT;
- values[index] = fn.call(self, children[index], node, index, bullet);
- }
-
- return values.join(LINE);
-};
-
-/**
- * Visit unordered list items.
- *
- * Uses `options.bullet` as each item's bullet.
- *
- * Adds an extra line after an item if it has
- * `loose: true`.
- *
- * @example
- * var compiler = new Compiler();
- *
- * compiler.visitUnorderedItems({
- * type: 'list',
- * ordered: false,
- * children: [{
- * type: 'listItem',
- * children: [{
- * type: 'text',
- * value: 'bar'
- * }]
- * }]
- * });
- * // '- bar'
- *
- * @param {Object} node - `list` node with
- * `ordered: false`.
- * @return {string} - Markdown list.
- */
-compilerPrototype.visitUnorderedItems = function (node) {
- var self = this;
- var values = [];
- var children = node.children;
- var length = children.length;
- var index = -1;
- var bullet = self.options.bullet;
- var fn = self.visitors.listItem;
-
- while (++index < length) {
- values[index] = fn.call(self, children[index], node, index, bullet);
- }
-
- return values.join(LINE);
-};
-
-/**
- * Stringify a block node with block children (e.g., `root`
- * or `blockquote`).
- *
- * Knows about code following a list, or adjacent lists
- * with similar bullets, and places an extra newline
- * between them.
- *
- * @example
- * var compiler = new Compiler();
- *
- * compiler.block({
- * type: 'root',
- * children: [{
- * type: 'paragraph',
- * children: [{
- * type: 'text',
- * value: 'bar'
- * }]
- * }]
- * });
- * // 'bar'
- *
- * @param {Object} node - `root` node.
- * @return {string} - Markdown block content.
- */
-compilerPrototype.block = function (node) {
- var self = this;
- var values = [];
- var children = node.children;
- var length = children.length;
- var index = -1;
- var child;
- var prev;
-
- while (++index < length) {
- child = children[index];
-
- if (prev) {
- /*
- * Duplicate nodes, such as a list
- * directly following another list,
- * often need multiple new lines.
- *
- * Additionally, code blocks following a list
- * might easily be mistaken for a paragraph
- * in the list itself.
- */
-
- if (child.type === prev.type && prev.type === 'list') {
- values.push(prev.ordered === child.ordered ? GAP : BREAK);
- } else if (
- prev.type === 'list' &&
- child.type === 'code' &&
- !child.lang
- ) {
- values.push(GAP);
- } else {
- values.push(BREAK);
- }
- }
-
- values.push(self.visit(child, node));
-
- prev = child;
- }
-
- return values.join(EMPTY);
-};
-
-/**
- * Stringify a root.
- *
- * Adds a final newline to ensure valid POSIX files.
- *
- * @example
- * var compiler = new Compiler();
- *
- * compiler.root({
- * type: 'root',
- * children: [{
- * type: 'paragraph',
- * children: [{
- * type: 'text',
- * value: 'bar'
- * }]
- * }]
- * });
- * // 'bar'
- *
- * @param {Object} node - `root` node.
- * @return {string} - Markdown document.
- */
-visitors.root = function (node) {
- return this.block(node) + LINE;
-};
-
-/**
- * Stringify a heading.
- *
- * In `setext: true` mode and when `depth` is smaller than
- * three, creates a setext header:
- *
- * Foo
- * ===
- *
- * Otherwise, an ATX header is generated:
- *
- * ### Foo
- *
- * In `closeAtx: true` mode, the header is closed with
- * hashes:
- *
- * ### Foo ###
- *
- * @example
- * var compiler = new Compiler();
- *
- * compiler.heading({
- * type: 'heading',
- * depth: 2,
- * children: [{
- * type: 'strong',
- * children: [{
- * type: 'text',
- * value: 'bar'
- * }]
- * }]
- * });
- * // '## **bar**'
- *
- * @param {Object} node - `heading` node.
- * @return {string} - Markdown heading.
- */
-visitors.heading = function (node) {
- var self = this;
- var setext = self.options.setext;
- var closeAtx = self.options.closeAtx;
- var depth = node.depth;
- var content = self.all(node).join(EMPTY);
- var prefix;
-
- if (setext && depth < 3) {
- return content + LINE +
- repeat(depth === 1 ? EQUALS : DASH, content.length);
- }
-
- prefix = repeat(HASH, node.depth);
- content = prefix + SPACE + content;
-
- if (closeAtx) {
- content += SPACE + prefix;
- }
-
- return content;
-};
-
-/**
- * Stringify text.
- *
- * Supports named entities in `settings.encode: true` mode:
- *
- * AT&amp;T
- *
- * Supports numbered entities in `settings.encode: numbers`
- * mode:
- *
- * AT&#x26;T
- *
- * @example
- * var compiler = new Compiler();
- *
- * compiler.text({
- * type: 'text',
- * value: 'foo'
- * });
- * // 'foo'
- *
- * @param {Object} node - `text` node.
- * @param {Object} parent - Parent of `node`.
- * @return {string} - Raw markdown text.
- */
-visitors.text = function (node, parent) {
- return this.encode(this.escape(node.value, node, parent), node);
-};
-
-/**
- * Stringify a paragraph.
- *
- * @example
- * var compiler = new Compiler();
- *
- * compiler.paragraph({
- * type: 'paragraph',
- * children: [{
- * type: 'strong',
- * children: [{
- * type: 'text',
- * value: 'bar'
- * }]
- * }]
- * });
- * // '**bar**'
- *
- * @param {Object} node - `paragraph` node.
- * @return {string} - Markdown paragraph.
- */
-visitors.paragraph = function (node) {
- return this.all(node).join(EMPTY);
-};
-
-/**
- * Stringify a block quote.
- *
- * @example
- * var compiler = new Compiler();
- *
- * compiler.paragraph({
- * type: 'blockquote',
- * children: [{
- * type: 'paragraph',
- * children: [{
- * type: 'strong',
- * children: [{
- * type: 'text',
- * value: 'bar'
- * }]
- * }]
- * }]
- * });
- * // '> **bar**'
- *
- * @param {Object} node - `blockquote` node.
- * @return {string} - Markdown block quote.
- */
-visitors.blockquote = function (node) {
- var values = this.block(node).split(LINE);
- var result = [];
- var length = values.length;
- var index = -1;
- var value;
-
- while (++index < length) {
- value = values[index];
- result[index] = (value ? SPACE : EMPTY) + value;
- }
-
- return ANGLE_BRACKET_CLOSE + result.join(LINE + ANGLE_BRACKET_CLOSE);
-};
-
-/**
- * Stringify a list. See `Compiler#visitOrderedList()` and
- * `Compiler#visitUnorderedList()` for internal working.
- *
- * @example
- * var compiler = new Compiler();
- *
- * compiler.visitUnorderedItems({
- * type: 'list',
- * ordered: false,
- * children: [{
- * type: 'listItem',
- * children: [{
- * type: 'text',
- * value: 'bar'
- * }]
- * }]
- * });
- * // '- bar'
- *
- * @param {Object} node - `list` node.
- * @return {string} - Markdown list.
- */
-visitors.list = function (node) {
- return this[ORDERED_MAP[node.ordered]](node);
-};
-
-/**
- * Stringify a list item.
- *
- * Prefixes the content with a checked checkbox when
- * `checked: true`:
- *
- * [x] foo
- *
- * Prefixes the content with an unchecked checkbox when
- * `checked: false`:
- *
- * [ ] foo
- *
- * @example
- * var compiler = new Compiler();
- *
- * compiler.listItem({
- * type: 'listItem',
- * checked: true,
- * children: [{
- * type: 'text',
- * value: 'bar'
- * }]
- * }, {
- * type: 'list',
- * ordered: false,
- * children: [{
- * type: 'listItem',
- * checked: true,
- * children: [{
- * type: 'text',
- * value: 'bar'
- * }]
- * }]
- * }, 0, '*');
- * '- [x] bar'
- *
- * @param {Object} node - `listItem` node.
- * @param {Object} parent - `list` node.
- * @param {number} position - Index of `node` in `parent`.
- * @param {string} bullet - Bullet to use. This, and the
- * `listItemIndent` setting define the used indent.
- * @return {string} - Markdown list item.
- */
-visitors.listItem = function (node, parent, position, bullet) {
- var self = this;
- var style = self.options.listItemIndent;
- var children = node.children;
- var values = [];
- var index = -1;
- var length = children.length;
- var loose = node.loose;
- var value;
- var indent;
- var spacing;
-
- while (++index < length) {
- values[index] = self.visit(children[index], node);
- }
-
- value = CHECKBOX_MAP[node.checked] + values.join(loose ? BREAK : LINE);
-
- if (
- style === LIST_ITEM_ONE ||
- (style === LIST_ITEM_MIXED && value.indexOf(LINE) === -1)
- ) {
- indent = bullet.length + 1;
- spacing = SPACE;
- } else {
- indent = Math.ceil((bullet.length + 1) / INDENT) * INDENT;
- spacing = repeat(SPACE, indent - bullet.length);
- }
-
- value = bullet + spacing + pad(value, indent / INDENT).slice(indent);
-
- if (loose && parent.children.length - 1 !== position) {
- value += LINE;
- }
-
- return value;
-};
-
-/**
- * Stringify inline code.
- *
- * Knows about internal ticks (`\``), and ensures one more
- * tick is used to enclose the inline code:
- *
- * ```foo ``bar`` baz```
- *
- * Even knows about inital and final ticks:
- *
- * `` `foo ``
- * `` foo` ``
- *
- * @example
- * var compiler = new Compiler();
- *
- * compiler.inlineCode({
- * type: 'inlineCode',
- * value: 'foo(); `bar`; baz()'
- * });
- * // '``foo(); `bar`; baz()``'
- *
- * @param {Object} node - `inlineCode` node.
- * @return {string} - Markdown inline code.
- */
-visitors.inlineCode = function (node) {
- var value = node.value;
- var ticks = repeat(TICK, longestStreak(value, TICK) + 1);
- var start = ticks;
- var end = ticks;
-
- if (value.charAt(0) === TICK) {
- start += SPACE;
- }
-
- if (value.charAt(value.length - 1) === TICK) {
- end = SPACE + end;
- }
-
- return start + node.value + end;
-};
-
-/**
- * Stringify YAML front matter.
- *
- * @example
- * var compiler = new Compiler();
- *
- * compiler.yaml({
- * type: 'yaml',
- * value: 'foo: bar'
- * });
- * // '---\nfoo: bar\n---'
- *
- * @param {Object} node - `yaml` node.
- * @return {string} - Markdown YAML document.
- */
-visitors.yaml = function (node) {
- var delimiter = repeat(DASH, YAML_FENCE_LENGTH);
- var value = node.value ? LINE + node.value : EMPTY;
-
- return delimiter + value + LINE + delimiter;
-};
-
-/**
- * Stringify a code block.
- *
- * Creates indented code when:
- *
- * - No language tag exists;
- * - Not in `fences: true` mode;
- * - A non-empty value exists.
- *
- * Otherwise, GFM fenced code is created:
- *
- * ```js
- * foo();
- * ```
- *
- * When in ``fence: `~` `` mode, uses tildes as fences:
- *
- * ~~~js
- * foo();
- * ~~~
- *
- * Knows about internal fences (Note: GitHub/Kramdown does
- * not support this):
- *
- * ````javascript
- * ```markdown
- * foo
- * ```
- * ````
- *
- * Supports named entities in the language flag with
- * `settings.encode` mode.
- *
- * @example
- * var compiler = new Compiler();
- *
- * compiler.code({
- * type: 'code',
- * lang: 'js',
- * value: 'fooo();'
- * });
- * // '```js\nfooo();\n```'
- *
- * @param {Object} node - `code` node.
- * @param {Object} parent - Parent of `node`.
- * @return {string} - Markdown code block.
- */
-visitors.code = function (node, parent) {
- var self = this;
- var value = node.value;
- var options = self.options;
- var marker = options.fence;
- var language = self.encode(node.lang || EMPTY, node);
- var fence;
-
- /*
- * Without (needed) fences.
- */
-
- if (!language && !options.fences && value) {
- /*
- * Throw when pedantic, in a list item which
- * isn’t compiled using a tab.
- */
-
- if (
- parent &&
- parent.type === 'listItem' &&
- options.listItemIndent !== LIST_ITEM_TAB &&
- options.pedantic
- ) {
- self.file.fail(ERROR_LIST_ITEM_INDENT, node.position);
- }
-
- return pad(value, 1);
- }
-
- fence = longestStreak(value, marker) + 1;
-
- /*
- * Fix GFM / RedCarpet bug, where fence-like characters
- * inside fenced code can exit a code-block.
- * Yes, even when the outer fence uses different
- * characters, or is longer.
- * Thus, we can only pad the code to make it work.
- */
-
- if (FENCE.test(value)) {
- value = pad(value, 1);
- }
-
- fence = repeat(marker, Math.max(fence, MINIMUM_CODE_FENCE_LENGTH));
-
- return fence + language + LINE + value + LINE + fence;
-};
-
-/**
- * Stringify HTML.
- *
- * @example
- * var compiler = new Compiler();
- *
- * compiler.html({
- * type: 'html',
- * value: '<div>bar</div>'
- * });
- * // '<div>bar</div>'
- *
- * @param {Object} node - `html` node.
- * @return {string} - Markdown HTML.
- */
-visitors.html = function (node) {
- return node.value;
-};
-
-/**
- * Stringify a horizontal rule.
- *
- * The character used is configurable by `rule`: (`'_'`)
- *
- * ___
- *
- * The number of repititions is defined through
- * `ruleRepetition`: (`6`)
- *
- * ******
- *
- * Whether spaces delimit each character, is configured
- * through `ruleSpaces`: (`true`)
- *
- * * * *
- *
- * @example
- * var compiler = new Compiler();
- *
- * compiler.thematicBreak({
- * type: 'thematicBreak'
- * });
- * // '***'
- *
- * @return {string} - Markdown rule.
- */
-visitors.thematicBreak = function () {
- var options = this.options;
- var rule = repeat(options.rule, options.ruleRepetition);
-
- if (options.ruleSpaces) {
- rule = rule.split(EMPTY).join(SPACE);
- }
-
- return rule;
-};
-
-/**
- * Stringify a strong.
- *
- * The marker used is configurable by `strong`, which
- * defaults to an asterisk (`'*'`) but also accepts an
- * underscore (`'_'`):
- *
- * _foo_
- *
- * @example
- * var compiler = new Compiler();
- *
- * compiler.strong({
- * type: 'strong',
- * children: [{
- * type: 'text',
- * value: 'Foo'
- * }]
- * });
- * // '**Foo**'
- *
- * @param {Object} node - `strong` node.
- * @return {string} - Markdown strong-emphasised text.
- */
-visitors.strong = function (node) {
- var marker = this.options.strong;
-
- marker = marker + marker;
-
- return marker + this.all(node).join(EMPTY) + marker;
-};
-
-/**
- * Stringify an emphasis.
- *
- * The marker used is configurable by `emphasis`, which
- * defaults to an underscore (`'_'`) but also accepts an
- * asterisk (`'*'`):
- *
- * *foo*
- *
- * @example
- * var compiler = new Compiler();
- *
- * compiler.emphasis({
- * type: 'emphasis',
- * children: [{
- * type: 'text',
- * value: 'Foo'
- * }]
- * });
- * // '_Foo_'
- *
- * @param {Object} node - `emphasis` node.
- * @return {string} - Markdown emphasised text.
- */
-visitors.emphasis = function (node) {
- var marker = this.options.emphasis;
-
- return marker + this.all(node).join(EMPTY) + marker;
-};
-
-/**
- * Stringify a hard break.
- *
- * In Commonmark mode, trailing backslash form is used in order
- * to preserve trailing whitespace that the line may end with,
- * and also for better visibility.
- *
- * @example
- * var compiler = new Compiler();
- *
- * compiler.break({
- * type: 'break'
- * });
- * // ' \n'
- *
- * @return {string} - Hard markdown break.
- */
-visitors.break = function () {
- return this.options.commonmark ? BACKSLASH + LINE : SPACE + SPACE + LINE;
-};
-
-/**
- * Stringify a delete.
- *
- * @example
- * var compiler = new Compiler();
- *
- * compiler.delete({
- * type: 'delete',
- * children: [{
- * type: 'text',
- * value: 'Foo'
- * }]
- * });
- * // '~~Foo~~'
- *
- * @param {Object} node - `delete` node.
- * @return {string} - Markdown strike-through.
- */
-visitors.delete = function (node) {
- return DOUBLE_TILDE + this.all(node).join(EMPTY) + DOUBLE_TILDE;
-};
-
-/**
- * Stringify a link.
- *
- * When no title exists, the compiled `children` equal
- * `url`, and `url` starts with a protocol, an auto
- * link is created:
- *
- * <http://example.com>
- *
- * Otherwise, is smart about enclosing `url` (see
- * `encloseURI()`) and `title` (see `encloseTitle()`).
- *
- * [foo](<foo at bar dot com> 'An "example" e-mail')
- *
- * Supports named entities in the `url` and `title` when
- * in `settings.encode` mode.
- *
- * @example
- * var compiler = new Compiler();
- *
- * compiler.link({
- * type: 'link',
- * url: 'http://example.com',
- * title: 'Example Domain',
- * children: [{
- * type: 'text',
- * value: 'Foo'
- * }]
- * });
- * // '[Foo](http://example.com "Example Domain")'
- *
- * @param {Object} node - `link` node.
- * @return {string} - Markdown link.
- */
-visitors.link = function (node) {
- var self = this;
- var url = self.encode(node.url, node);
- var exit = self.enterLink();
- var escapedURL = self.encode(self.escape(node.url, node));
- var value = self.all(node).join(EMPTY);
-
- exit();
-
- if (
- node.title === null &&
- PROTOCOL.test(url) &&
- (escapedURL === value || escapedURL === MAILTO + value)
- ) {
- /*
- * Backslash escapes do not work in autolinks,
- * so we do not escape.
- */
-
- return encloseURI(self.encode(node.url), true);
- }
-
- url = encloseURI(url);
-
- if (node.title) {
- url += SPACE + encloseTitle(self.encode(self.escape(
- node.title, node
- ), node));
- }
-
- value = SQUARE_BRACKET_OPEN + value + SQUARE_BRACKET_CLOSE;
-
- value += PARENTHESIS_OPEN + url + PARENTHESIS_CLOSE;
-
- return value;
-};
-
-/**
- * Stringify a link label.
- *
- * Because link references are easily, mistakingly,
- * created (for example, `[foo]`), reference nodes have
- * an extra property depicting how it looked in the
- * original document, so stringification can cause minimal
- * changes.
- *
- * @example
- * label({
- * type: 'referenceImage',
- * referenceType: 'full',
- * identifier: 'foo'
- * });
- * // '[foo]'
- *
- * label({
- * type: 'referenceImage',
- * referenceType: 'collapsed',
- * identifier: 'foo'
- * });
- * // '[]'
- *
- * label({
- * type: 'referenceImage',
- * referenceType: 'shortcut',
- * identifier: 'foo'
- * });
- * // ''
- *
- * @param {Object} node - `linkReference` or
- * `imageReference` node.
- * @return {string} - Markdown label reference.
- */
-function label(node) {
- var value = EMPTY;
- var type = node.referenceType;
-
- if (type === 'full') {
- value = node.identifier;
- }
-
- if (type !== 'shortcut') {
- value = SQUARE_BRACKET_OPEN + value + SQUARE_BRACKET_CLOSE;
- }
-
- return value;
-}
-
-/**
- * For shortcut and collapsed reference links, the contents
- * is also an identifier, so we need to restore the original
- * encoding and escaping that were present in the source
- * string.
- *
- * This function takes the unescaped & unencoded value from
- * shortcut's child nodes and the identifier and encodes
- * the former according to the latter.
- *
- * @example
- * copyIdentifierEncoding('a*b', 'a\\*b*c')
- * // 'a\\*b*c'
- *
- * @param {string} value - Unescaped and unencoded stringified
- * link value.
- * @param {string} identifier - Link identifier.
- * @return {string} - Encoded link value.
- */
-function copyIdentifierEncoding(value, identifier) {
- var index = 0;
- var position = 0;
- var length = value.length;
- var count = identifier.length;
- var result = [];
- var start;
-
- while (index < length) {
- /*
- * Take next non-punctuation characters from `value`.
- */
-
- start = index;
-
- while (
- index < length &&
- !PUNCTUATION.test(value.charAt(index))
- ) {
- index += 1;
- }
-
- result.push(value.slice(start, index));
-
- /*
- * Advance `position` to the next punctuation character.
- */
- while (
- position < count &&
- !PUNCTUATION.test(identifier.charAt(position))
- ) {
- position += 1;
- }
-
- /*
- * Take next punctuation characters from `identifier`.
- */
- start = position;
-
- while (
- position < count &&
- PUNCTUATION.test(identifier.charAt(position))
- ) {
- if (identifier.charAt(position) === AMPERSAND) {
- position += entityPrefixLength(identifier.slice(position));
- }
- position += 1;
- }
-
- result.push(identifier.slice(start, position));
-
- /*
- * Advance `index` to the next non-punctuation character.
- */
- while (index < length && PUNCTUATION.test(value.charAt(index))) {
- index += 1;
- }
- }
-
- return result.join(EMPTY);
-}
-
-/**
- * Stringify a link reference.
- *
- * See `label()` on how reference labels are created.
- *
- * @example
- * var compiler = new Compiler();
- *
- * compiler.linkReference({
- * type: 'linkReference',
- * referenceType: 'collapsed',
- * identifier: 'foo',
- * children: [{
- * type: 'text',
- * value: 'Foo'
- * }]
- * });
- * // '[Foo][]'
- *
- * @param {Object} node - `linkReference` node.
- * @return {string} - Markdown link reference.
- */
-visitors.linkReference = function (node) {
- var self = this;
- var exitLinkReference = self.enterLinkReference(self, node);
- var value = self.all(node).join(EMPTY);
-
- exitLinkReference();
-
- if (
- node.referenceType === 'shortcut' ||
- node.referenceType === 'collapsed'
- ) {
- value = copyIdentifierEncoding(value, node.identifier);
- }
-
- return SQUARE_BRACKET_OPEN + value + SQUARE_BRACKET_CLOSE + label(node);
-};
-
-/**
- * Stringify an image reference.
- *
- * See `label()` on how reference labels are created.
- *
- * Supports named entities in the `alt` when
- * in `settings.encode` mode.
- *
- * @example
- * var compiler = new Compiler();
- *
- * compiler.imageReference({
- * type: 'imageReference',
- * referenceType: 'full',
- * identifier: 'foo',
- * alt: 'Foo'
- * });
- * // '![Foo][foo]'
- *
- * @param {Object} node - `imageReference` node.
- * @return {string} - Markdown image reference.
- */
-visitors.imageReference = function (node) {
- var alt = this.encode(node.alt, node) || EMPTY;
-
- return EXCLAMATION_MARK +
- SQUARE_BRACKET_OPEN + alt + SQUARE_BRACKET_CLOSE +
- label(node);
-};
-
-/**
- * Stringify a footnote reference.
- *
- * @example
- * var compiler = new Compiler();
- *
- * compiler.footnoteReference({
- * type: 'footnoteReference',
- * identifier: 'foo'
- * });
- * // '[^foo]'
- *
- * @param {Object} node - `footnoteReference` node.
- * @return {string} - Markdown footnote reference.
- */
-visitors.footnoteReference = function (node) {
- return SQUARE_BRACKET_OPEN + CARET + node.identifier +
- SQUARE_BRACKET_CLOSE;
-};
-
-/**
- * Stringify a link- or image definition.
- *
- * Is smart about enclosing `url` (see `encloseURI()`) and
- * `title` (see `encloseTitle()`).
- *
- * [foo]: <foo at bar dot com> 'An "example" e-mail'
- *
- * @example
- * var compiler = new Compiler();
- *
- * compiler.definition({
- * type: 'definition',
- * url: 'http://example.com',
- * title: 'Example Domain',
- * identifier: 'foo'
- * });
- * // '[foo]: http://example.com "Example Domain"'
- *
- * @param {Object} node - `definition` node.
- * @return {string} - Markdown link- or image definition.
- */
-visitors.definition = function (node) {
- var value = SQUARE_BRACKET_OPEN + node.identifier + SQUARE_BRACKET_CLOSE;
- var url = encloseURI(node.url);
-
- if (node.title) {
- url += SPACE + encloseTitle(node.title);
- }
-
- return value + COLON + SPACE + url;
-};
-
-/**
- * Stringify an image.
- *
- * Is smart about enclosing `url` (see `encloseURI()`) and
- * `title` (see `encloseTitle()`).
- *
- * ![foo](</fav icon.png> 'My "favourite" icon')
- *
- * Supports named entities in `url`, `alt`, and `title`
- * when in `settings.encode` mode.
- *
- * @example
- * var compiler = new Compiler();
- *
- * compiler.image({
- * type: 'image',
- * url: 'http://example.png/favicon.png',
- * title: 'Example Icon',
- * alt: 'Foo'
- * });
- * // '![Foo](http://example.png/favicon.png "Example Icon")'
- *
- * @param {Object} node - `image` node.
- * @return {string} - Markdown image.
- */
-visitors.image = function (node) {
- var url = encloseURI(this.encode(node.url, node));
- var value;
-
- if (node.title) {
- url += SPACE + encloseTitle(this.encode(node.title, node));
- }
-
- value = EXCLAMATION_MARK +
- SQUARE_BRACKET_OPEN + this.encode(node.alt || EMPTY, node) +
- SQUARE_BRACKET_CLOSE;
-
- value += PARENTHESIS_OPEN + url + PARENTHESIS_CLOSE;
-
- return value;
-};
-
-/**
- * Stringify a footnote.
- *
- * @example
- * var compiler = new Compiler();
- *
- * compiler.footnote({
- * type: 'footnote',
- * children: [{
- * type: 'text',
- * value: 'Foo'
- * }]
- * });
- * // '[^Foo]'
- *
- * @param {Object} node - `footnote` node.
- * @return {string} - Markdown footnote.
- */
-visitors.footnote = function (node) {
- return SQUARE_BRACKET_OPEN + CARET + this.all(node).join(EMPTY) +
- SQUARE_BRACKET_CLOSE;
-};
-
-/**
- * Stringify a footnote definition.
- *
- * @example
- * var compiler = new Compiler();
- *
- * compiler.footnoteDefinition({
- * type: 'footnoteDefinition',
- * identifier: 'foo',
- * children: [{
- * type: 'paragraph',
- * children: [{
- * type: 'text',
- * value: 'bar'
- * }]
- * }]
- * });
- * // '[^foo]: bar'
- *
- * @param {Object} node - `footnoteDefinition` node.
- * @return {string} - Markdown footnote definition.
- */
-visitors.footnoteDefinition = function (node) {
- var id = node.identifier.toLowerCase();
-
- return SQUARE_BRACKET_OPEN + CARET + id +
- SQUARE_BRACKET_CLOSE + COLON + SPACE +
- this.all(node).join(BREAK + repeat(SPACE, INDENT));
-};
-
-/**
- * Stringify table.
- *
- * Creates a fenced table by default, but not in
- * `looseTable: true` mode:
- *
- * Foo | Bar
- * :-: | ---
- * Baz | Qux
- *
- * NOTE: Be careful with `looseTable: true` mode, as a
- * loose table inside an indented code block on GitHub
- * renders as an actual table!
- *
- * Creates a spaces table by default, but not in
- * `spacedTable: false`:
- *
- * |Foo|Bar|
- * |:-:|---|
- * |Baz|Qux|
- *
- * @example
- * var compiler = new Compiler();
- *
- * compiler.table({
- * type: 'table',
- * align: ['center', null],
- * children: [
- * {
- * type: 'tableRow',
- * children: [
- * {
- * type: 'tableCell'
- * children: [{
- * type: 'text'
- * value: 'Foo'
- * }]
- * },
- * {
- * type: 'tableCell'
- * children: [{
- * type: 'text'
- * value: 'Bar'
- * }]
- * }
- * ]
- * },
- * {
- * type: 'tableRow',
- * children: [
- * {
- * type: 'tableCell'
- * children: [{
- * type: 'text'
- * value: 'Baz'
- * }]
- * },
- * {
- * type: 'tableCell'
- * children: [{
- * type: 'text'
- * value: 'Qux'
- * }]
- * }
- * ]
- * }
- * ]
- * });
- * // '| Foo | Bar |\n| :-: | --- |\n| Baz | Qux |'
- *
- * @param {Object} node - `table` node.
- * @return {string} - Markdown table.
- */
-visitors.table = function (node) {
- var self = this;
- var loose = self.options.looseTable;
- var spaced = self.options.spacedTable;
- var rows = node.children;
- var index = rows.length;
- var exit = self.enterTable();
- var result = [];
- var start;
-
- while (index--) {
- result[index] = self.all(rows[index]);
- }
-
- exit();
-
- start = loose ? EMPTY : spaced ? PIPE + SPACE : PIPE;
-
- return table(result, {
- 'align': node.align,
- 'start': start,
- 'end': start.split(EMPTY).reverse().join(EMPTY),
- 'delimiter': spaced ? SPACE + PIPE + SPACE : PIPE
- });
-};
-
-/**
- * Stringify a table cell.
- *
- * @example
- * var compiler = new Compiler();
- *
- * compiler.tableCell({
- * type: 'tableCell',
- * children: [{
- * type: 'text'
- * value: 'Qux'
- * }]
- * });
- * // 'Qux'
- *
- * @param {Object} node - `tableCell` node.
- * @return {string} - Markdown table cell.
- */
-visitors.tableCell = function (node) {
- return this.all(node).join(EMPTY);
-};
-
-/**
- * Stringify the bound file.
- *
- * @example
- * var file = new VFile('__Foo__');
- *
- * file.namespace('mdast').tree = {
- * type: 'strong',
- * children: [{
- * type: 'text',
- * value: 'Foo'
- * }]
- * });
- *
- * new Compiler(file).compile();
- * // '**Foo**'
- *
- * @this {Compiler}
- * @param {Node} node - Syntax tree.
- * @return {string} - Markdown document.
- */
-compilerPrototype.compile = function (node) {
- return this.visit(node);
-};
-
-/*
- * Expose `stringify` on `module.exports`.
- */
-
-module.exports = Compiler;
diff --git a/tools/eslint/node_modules/remark-stringify/lib/defaults.js b/tools/eslint/node_modules/remark-stringify/lib/defaults.js
deleted file mode 100644
index 32d4d27c90..0000000000
--- a/tools/eslint/node_modules/remark-stringify/lib/defaults.js
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- * @author Titus Wormer
- * @copyright 2015-2016 Titus Wormer
- * @license MIT
- * @module remark:stringify:defaults
- * @fileoverview Default options for `stringify`.
- */
-
-'use strict';
-
-/* eslint-env commonjs */
-
-module.exports = {
- 'gfm': true,
- 'commonmark': false,
- 'pedantic': false,
- 'entities': 'false',
- 'setext': false,
- 'closeAtx': false,
- 'looseTable': false,
- 'spacedTable': true,
- 'incrementListMarker': true,
- 'fences': false,
- 'fence': '`',
- 'bullet': '-',
- 'listItemIndent': 'tab',
- 'rule': '*',
- 'ruleSpaces': true,
- 'ruleRepetition': 3,
- 'strong': '*',
- 'emphasis': '_'
-};
diff --git a/tools/eslint/node_modules/remark-stringify/package.json b/tools/eslint/node_modules/remark-stringify/package.json
deleted file mode 100644
index 873b3cb61a..0000000000
--- a/tools/eslint/node_modules/remark-stringify/package.json
+++ /dev/null
@@ -1,80 +0,0 @@
-{
- "_from": "remark-stringify@^1.1.0",
- "_id": "remark-stringify@1.1.0",
- "_inBundle": false,
- "_integrity": "sha1-pxBeJbnuK/mkm3XSxCPxGwauIJI=",
- "_location": "/remark-stringify",
- "_phantomChildren": {},
- "_requested": {
- "type": "range",
- "registry": true,
- "raw": "remark-stringify@^1.1.0",
- "name": "remark-stringify",
- "escapedName": "remark-stringify",
- "rawSpec": "^1.1.0",
- "saveSpec": null,
- "fetchSpec": "^1.1.0"
- },
- "_requiredBy": [
- "/remark"
- ],
- "_resolved": "https://registry.npmjs.org/remark-stringify/-/remark-stringify-1.1.0.tgz",
- "_shasum": "a7105e25b9ee2bf9a49b75d2c423f11b06ae2092",
- "_spec": "remark-stringify@^1.1.0",
- "_where": "/Users/trott/io.js/tools/eslint-tmp/node_modules/eslint/node_modules/remark",
- "author": {
- "name": "Titus Wormer",
- "email": "tituswormer@gmail.com",
- "url": "http://wooorm.com"
- },
- "bugs": {
- "url": "https://github.com/wooorm/remark/issues"
- },
- "bundleDependencies": false,
- "contributors": [
- {
- "name": "Titus Wormer",
- "email": "tituswormer@gmail.com",
- "url": "http://wooorm.com"
- },
- {
- "name": "Eugene Sharygin",
- "email": "eush77@gmail.com"
- }
- ],
- "dependencies": {
- "ccount": "^1.0.0",
- "extend": "^3.0.0",
- "longest-streak": "^1.0.0",
- "markdown-table": "^0.4.0",
- "parse-entities": "^1.0.2",
- "repeat-string": "^1.5.4",
- "stringify-entities": "^1.0.1",
- "unherit": "^1.0.4"
- },
- "deprecated": false,
- "description": "Markdown compiler for remark",
- "engines": {
- "node": ">=0.11.0"
- },
- "files": [
- "index.js",
- "lib"
- ],
- "homepage": "http://remark.js.org",
- "keywords": [
- "markdown",
- "abstract",
- "syntax",
- "tree",
- "ast",
- "stringify"
- ],
- "license": "MIT",
- "name": "remark-stringify",
- "repository": {
- "type": "git",
- "url": "https://github.com/wooorm/remark/tree/master/packages/remark-stringify"
- },
- "version": "1.1.0"
-}
diff --git a/tools/eslint/node_modules/remark-stringify/readme.md b/tools/eslint/node_modules/remark-stringify/readme.md
deleted file mode 100644
index 33a2bd4ae4..0000000000
--- a/tools/eslint/node_modules/remark-stringify/readme.md
+++ /dev/null
@@ -1,209 +0,0 @@
-# remark-stringify [![Build Status][build-badge]][build-status] [![Coverage Status][coverage-badge]][coverage-status] [![Chat][chat-badge]][chat]
-
-[Compiler][] for [**unified**][unified]. Stringifies an
-[**mdast**][mdast] syntax tree to markdown. Used in the [**remark**
-processor][processor]. Can be [extended][extend] to change how
-markdown is compiled.
-
-## Installation
-
-[npm][]:
-
-```bash
-npm install remark-stringify
-```
-
-## Usage
-
-```js
-var unified = require('unified');
-var parse = require('remark-parse');
-var toc = require('remark-toc');
-var stringify = require('remark-stringify');
-
-process.stdin
- .pipe(unified())
- .use(markdown)
- .use(toc)
- .use(html)
- .pipe(process.stdout, {
- 'bullet': '*',
- 'fence': '~',
- 'fences': true,
- 'incrementListMarker': false
- });
-```
-
-## Table of Contents
-
-* [API](#api)
- * [processor.use(stringify)](#processorusestringify)
- * [stringify.Compiler](#stringifycompiler)
-* [Extending the Compiler](#extending-the-compiler)
- * [Compiler#visitors](#compilervisitors)
- * [function visitor(node\[, parent\])](#function-visitornode-parent)
-* [License](#license)
-
-## API
-
-### `processor.use(stringify)`
-
-Configure the `processor` to stringify [**mdast**][mdast] syntax trees
-to markdown.
-
-###### `options`
-
-Options are passed later through [`processor.stringify()`][stringify],
-[`processor.process()`][process], or [`processor.pipe()`][pipe].
-The following settings are supported:
-
-* `gfm` (`boolean`, default: `true`):
- * Escape pipes (`|`, for tables);
- * Escape colons (`:`, for literal URLs)
- * Escape tildes (`~`, for strike-through).
-* `commonmark` (`boolean`, default: `false`):
- * Compile adjacent blockquotes separately;
- * Escape more characters using slashes, instead of as entities.
-* `pedantic` (`boolean`, default: `false`):
- * Escape underscores in words.
-* `entities` (`string` or `boolean`, default: `false`):
-
- * `true` — Entities are generated for special HTML characters
- (`&` > `&amp;`) and non-ASCII characters (`©` > `&copy;`).
- If named entities are not (widely) supported, numbered character
- references are used (`’` > `&#x2019;`);
-
- * `'numbers'` — Numbered entities are generated (`&` > `&#x26;`)
- for special HTML characters and non-ASCII characters.
-
- * `'escape'` — Special HTML characters are encoded (`&` >
- `&amp;`, `’` > `&#x2019;`), non-ASCII characters not (ö persists).
-
-* `setext` (`boolean`, default: `false`)
- — Compile headings, when possible, in Setext-style: using `=` for
- level one headings and `-` for level two headings. Other heading
- levels are compiled as ATX (respecting `closeAtx`).
-* `closeAtx` (`boolean`, default: `false`)
- — Compile ATX headings with the same amount of closing hashes as
- opening hashes.
-* `looseTable` (`boolean`, default: `false`)
- — Create tables without fences (initial and final pipes).
-* `spacedTable` (`boolean`, default: `true`)
- — Create tables without spacing between pipes and content.
-* `fence` (`'~'` or ``'`'``, default: ``'`'``)
- — Fence marker to use for code blocks.
-* `fences` (`boolean`, default: `false`)
- — Stringify code blocks without language with fences.
-* `bullet` (`'-'`, `'*'`, or `'+'`, default: `'-'`)
- — Bullet marker to use for unordered list items.
-* `listItemIndent` (`'tab'`, `'mixed'` or `'1'`, default: `'tab'`)
-
- How to indent the content from list items:
-
- * `'tab'`: use tab stops (4 spaces);
- * `'1'`: use one space;
- * `'mixed'`: use `1` for tight and `tab` for loose list items.
-
-* `incrementListMarker` (`boolean`, default: `true`)
- — Whether to increment ordered list item bullets.
-* `rule` (`'-'`, `'*'`, or `'_'`, default: `'*'`)
- — Marker to use for thematic breaks (horizontal rules).
-* `ruleRepetition` (`number`, default: `3`)
- — Number of markers to use for thematic breaks (horizontal rules).
- Should be `3` or more.
-* `ruleSpaces` (`boolean`, default `true`)
- — Whether to pad thematic break (horizontal rule) markers with
- spaces.
-* `strong` (`'_'` or `'*'`, default `'*'`)
- — Marker to use for importance.
-* `emphasis` (`'_'` or `'*'`, default `'_'`)
- — Marker to use for emphasis.
-
-### `stringify.Compiler`
-
-Access to the raw [compiler][], if you need it.
-
-## Extending the Compiler
-
-If this plug-in is used, it adds a [`Compiler`][compiler] constructor
-to the `processor`. Other plug-ins can change and add visitors on
-the compiler’s prototype to change how markdown is stringified.
-
-The below plug-in modifies a [visitor][] to add an extra blank line
-before level two headings.
-
-```js
-function gap(processor) {
- var Compiler = processor.Compiler;
- var visitors = Compiler.prototype.visitors;
- var heading = visitors.heading;
-
- /* Add a visitor for `heading`s. */
- visitors.heading = function (node) {
- return (node.depth === 2 ? '\n' : '') + heading.apply(this, arguments);
- };
-}
-
-module.exports = gap;
-```
-
-### `Compiler#visitors`
-
-An object mapping [node][] types to [`visitor`][visitor]s.
-
-### `function visitor(node[, parent])`
-
-Stringify `node`.
-
-###### Parameters
-
-* `node` ([`Node`][node]) — Node to compile;
-* `parent` ([`Node`][node], optional) — Parent of `node`.
-
-###### Returns
-
-`string`, the compiled given `node`.
-
-## License
-
-[MIT][license] © [Titus Wormer][author]
-
-<!-- Definitions -->
-
-[build-badge]: https://img.shields.io/travis/wooorm/remark.svg
-
-[build-status]: https://travis-ci.org/wooorm/remark
-
-[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/remark.svg
-
-[coverage-status]: https://codecov.io/github/wooorm/remark
-
-[chat-badge]: https://img.shields.io/gitter/room/wooorm/remark.svg
-
-[chat]: https://gitter.im/wooorm/remark
-
-[license]: https://github.com/wooorm/remark/blob/master/LICENSE
-
-[author]: http://wooorm.com
-
-[npm]: https://docs.npmjs.com/cli/install
-
-[unified]: https://github.com/wooorm/unified
-
-[processor]: https://github.com/wooorm/remark
-
-[stringify]: https://github.com/wooorm/unified#processorstringifynode-filevalue-options
-
-[process]: https://github.com/wooorm/unified#processorprocessfilevalue-options-done
-
-[pipe]: https://github.com/wooorm/unified#processorpipestream-options
-
-[compiler]: https://github.com/wooorm/unified#processorcompiler
-
-[mdast]: https://github.com/wooorm/mdast
-
-[node]: https://github.com/wooorm/unist#node
-
-[extend]: #extending-the-compiler
-
-[visitor]: #function-visitornode-parent
diff --git a/tools/eslint/node_modules/remark/cli.js b/tools/eslint/node_modules/remark/cli.js
deleted file mode 100644
index e128e1b5a5..0000000000
--- a/tools/eslint/node_modules/remark/cli.js
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/usr/bin/env node
-console.error([
- 'Whoops, `remark` is mistakenly installed instead of `remark-cli`',
- '',
- ' npm uninstall remark',
- ' npm install remark-cli',
- '',
- 'See https://git.io/vonyG for more information.'
-].join('\n'));
-
-process.exit(1);
diff --git a/tools/eslint/node_modules/remark/index.js b/tools/eslint/node_modules/remark/index.js
deleted file mode 100644
index 23d6f5706a..0000000000
--- a/tools/eslint/node_modules/remark/index.js
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * @author Titus Wormer
- * @copyright 2015-2016 Titus Wormer
- * @license MIT
- * @module remark
- * @fileoverview Markdown processor powered by plugins.
- */
-
-'use strict';
-
-/* eslint-env commonjs */
-
-/* Dependencies. */
-var unified = require('unified');
-var parse = require('remark-parse');
-var stringify = require('remark-stringify');
-
-/* Expose. */
-module.exports = unified().use(parse).use(stringify).abstract();
diff --git a/tools/eslint/node_modules/remark/package.json b/tools/eslint/node_modules/remark/package.json
deleted file mode 100644
index 1794d04473..0000000000
--- a/tools/eslint/node_modules/remark/package.json
+++ /dev/null
@@ -1,77 +0,0 @@
-{
- "_from": "remark@^5.0.0",
- "_id": "remark@5.1.0",
- "_inBundle": false,
- "_integrity": "sha1-y0Y709vLS5l5STXu4c9x16jjBow=",
- "_location": "/remark",
- "_phantomChildren": {},
- "_requested": {
- "type": "range",
- "registry": true,
- "raw": "remark@^5.0.0",
- "name": "remark",
- "escapedName": "remark",
- "rawSpec": "^5.0.0",
- "saveSpec": null,
- "fetchSpec": "^5.0.0"
- },
- "_requiredBy": [
- "/eslint-plugin-markdown"
- ],
- "_resolved": "https://registry.npmjs.org/remark/-/remark-5.1.0.tgz",
- "_shasum": "cb463bd3dbcb4b99794935eee1cf71d7a8e3068c",
- "_spec": "remark@^5.0.0",
- "_where": "/Users/trott/io.js/tools/eslint-tmp/node_modules/eslint/node_modules/eslint-plugin-markdown",
- "author": {
- "name": "Titus Wormer",
- "email": "tituswormer@gmail.com",
- "url": "http://wooorm.com"
- },
- "bin": {
- "remark": "cli.js"
- },
- "bugs": {
- "url": "https://github.com/wooorm/remark/issues"
- },
- "bundleDependencies": false,
- "contributors": [
- {
- "name": "Titus Wormer",
- "email": "tituswormer@gmail.com",
- "url": "http://wooorm.com"
- }
- ],
- "dependencies": {
- "remark-parse": "^1.1.0",
- "remark-stringify": "^1.1.0",
- "unified": "^4.1.1"
- },
- "deprecated": false,
- "description": "Markdown processor powered by plugins",
- "engines": {
- "node": ">=0.11.0"
- },
- "files": [
- "index.js",
- "cli.js"
- ],
- "homepage": "http://remark.js.org",
- "keywords": [
- "markdown",
- "abstract",
- "syntax",
- "tree",
- "ast",
- "parse",
- "stringify",
- "process"
- ],
- "license": "MIT",
- "name": "remark",
- "repository": {
- "type": "git",
- "url": "https://github.com/wooorm/remark/tree/master/packages/remark"
- },
- "scripts": {},
- "version": "5.1.0"
-}
diff --git a/tools/eslint/node_modules/remark/readme.md b/tools/eslint/node_modules/remark/readme.md
deleted file mode 100644
index 6dd0d5dd13..0000000000
--- a/tools/eslint/node_modules/remark/readme.md
+++ /dev/null
@@ -1,84 +0,0 @@
-# remark [![Build Status][build-badge]][build-status] [![Coverage Status][coverage-badge]][coverage-status] [![Chat][chat-badge]][chat]
-
-The [**remark**][remark] processor is a markdown processor powered by
-[plug-ins][plugins].
-
-* Interface by [**unified**][unified];
-* [**mdast**][mdast] syntax tree;
-* Parses markdown to the tree with [**remark-parse**][parse];
-* [Plug-ins][plugins] transform the tree;
-* Compiles the tree to markdown using [**remark-stringify**][stringify].
-
-Don’t need the parser? Or the compiler? [That’s OK][unified-usage].
-
-## Installation
-
-[npm][]:
-
-```bash
-npm install remark
-```
-
-## Usage
-
-```js
-var remark = require('remark');
-var lint = require('remark-lint');
-var html = require('remark-html');
-var report = require('vfile-reporter');
-
-remark().use(lint).use(html).process('## Hello world!', function (err, file) {
- console.error(report(file));
- console.log(file.toString());
-});
-```
-
-Yields:
-
-```txt
-<stdin>
- 1:1 warning Missing newline character at end of file final-newline
- 1:1-1:16 warning First heading level should be `1` first-heading-level
- 1:1-1:16 warning Don’t add a trailing `!` to headings no-heading-punctuation
-
-⚠ 3 warnings
-<h2>Hello world!</h2>
-```
-
-## License
-
-[MIT][license] © [Titus Wormer][author]
-
-<!-- Definitions -->
-
-[build-badge]: https://img.shields.io/travis/wooorm/remark.svg
-
-[build-status]: https://travis-ci.org/wooorm/remark
-
-[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/remark.svg
-
-[coverage-status]: https://codecov.io/github/wooorm/remark
-
-[chat-badge]: https://img.shields.io/gitter/room/wooorm/remark.svg
-
-[chat]: https://gitter.im/wooorm/remark
-
-[license]: https://github.com/wooorm/remark/blob/master/LICENSE
-
-[author]: http://wooorm.com
-
-[npm]: https://docs.npmjs.com/cli/install
-
-[remark]: https://github.com/wooorm/remark
-
-[unified]: https://github.com/wooorm/unified
-
-[mdast]: https://github.com/wooorm/mdast
-
-[parse]: https://github.com/wooorm/remark/blob/master/packages/remark-parse
-
-[stringify]: https://github.com/wooorm/remark/blob/master/packages/remark-stringify
-
-[plugins]: https://github.com/wooorm/remark/blob/master/doc/plugins.md
-
-[unified-usage]: https://github.com/wooorm/unified#usage
diff --git a/tools/eslint/node_modules/replace-ext/LICENSE b/tools/eslint/node_modules/replace-ext/LICENSE
new file mode 100644
index 0000000000..fd38d69351
--- /dev/null
+++ b/tools/eslint/node_modules/replace-ext/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 Blaine Bublitz <blaine.bublitz@gmail.com>, Eric Schoffstall <yo@contra.io> and other contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/tools/eslint/node_modules/replace-ext/README.md b/tools/eslint/node_modules/replace-ext/README.md
new file mode 100644
index 0000000000..8775983b78
--- /dev/null
+++ b/tools/eslint/node_modules/replace-ext/README.md
@@ -0,0 +1,50 @@
+<p align="center">
+ <a href="http://gulpjs.com">
+ <img height="257" width="114" src="https://raw.githubusercontent.com/gulpjs/artwork/master/gulp-2x.png">
+ </a>
+</p>
+
+# replace-ext
+
+[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Gitter chat][gitter-image]][gitter-url]
+
+Replaces a file extension with another one.
+
+## Usage
+
+```js
+var replaceExt = require('replace-ext');
+
+var path = '/some/dir/file.js';
+var newPath = replaceExt(path, '.coffee');
+
+console.log(newPath); // /some/dir/file.coffee
+```
+
+## API
+
+### `replaceExt(path, extension)`
+
+Replaces the extension from `path` with `extension` and returns the updated path string.
+
+Does not replace the extension if `path` is not a string or is empty.
+
+## License
+
+MIT
+
+[downloads-image]: http://img.shields.io/npm/dm/replace-ext.svg
+[npm-url]: https://www.npmjs.com/package/replace-ext
+[npm-image]: http://img.shields.io/npm/v/replace-ext.svg
+
+[travis-url]: https://travis-ci.org/gulpjs/replace-ext
+[travis-image]: http://img.shields.io/travis/gulpjs/replace-ext.svg?label=travis-ci
+
+[appveyor-url]: https://ci.appveyor.com/project/gulpjs/replace-ext
+[appveyor-image]: https://img.shields.io/appveyor/ci/gulpjs/replace-ext.svg?label=appveyor
+
+[coveralls-url]: https://coveralls.io/r/gulpjs/replace-ext
+[coveralls-image]: http://img.shields.io/coveralls/gulpjs/replace-ext/master.svg
+
+[gitter-url]: https://gitter.im/gulpjs/gulp
+[gitter-image]: https://badges.gitter.im/gulpjs/gulp.svg
diff --git a/tools/eslint/node_modules/replace-ext/index.js b/tools/eslint/node_modules/replace-ext/index.js
new file mode 100644
index 0000000000..7cb7789e28
--- /dev/null
+++ b/tools/eslint/node_modules/replace-ext/index.js
@@ -0,0 +1,18 @@
+'use strict';
+
+var path = require('path');
+
+function replaceExt(npath, ext) {
+ if (typeof npath !== 'string') {
+ return npath;
+ }
+
+ if (npath.length === 0) {
+ return npath;
+ }
+
+ var nFileName = path.basename(npath, path.extname(npath)) + ext;
+ return path.join(path.dirname(npath), nFileName);
+}
+
+module.exports = replaceExt;
diff --git a/tools/eslint/node_modules/replace-ext/package.json b/tools/eslint/node_modules/replace-ext/package.json
new file mode 100644
index 0000000000..5c8f578f88
--- /dev/null
+++ b/tools/eslint/node_modules/replace-ext/package.json
@@ -0,0 +1,86 @@
+{
+ "_from": "replace-ext@1.0.0",
+ "_id": "replace-ext@1.0.0",
+ "_inBundle": false,
+ "_integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=",
+ "_location": "/replace-ext",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "version",
+ "registry": true,
+ "raw": "replace-ext@1.0.0",
+ "name": "replace-ext",
+ "escapedName": "replace-ext",
+ "rawSpec": "1.0.0",
+ "saveSpec": null,
+ "fetchSpec": "1.0.0"
+ },
+ "_requiredBy": [
+ "/eslint-plugin-markdown/vfile"
+ ],
+ "_resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz",
+ "_shasum": "de63128373fcbf7c3ccfa4de5a480c45a67958eb",
+ "_spec": "replace-ext@1.0.0",
+ "_where": "j:\\temp\\_git\\node-fork\\tools\\eslint\\node_modules\\eslint-plugin-markdown\\node_modules\\vfile",
+ "author": {
+ "name": "Gulp Team",
+ "email": "team@gulpjs.com",
+ "url": "http://gulpjs.com/"
+ },
+ "bugs": {
+ "url": "https://github.com/gulpjs/replace-ext/issues"
+ },
+ "bundleDependencies": false,
+ "contributors": [
+ {
+ "name": "Eric Schoffstall",
+ "email": "yo@contra.io"
+ },
+ {
+ "name": "Blaine Bublitz",
+ "email": "blaine.bublitz@gmail.com"
+ }
+ ],
+ "dependencies": {},
+ "deprecated": false,
+ "description": "Replaces a file extension with another one",
+ "devDependencies": {
+ "eslint": "^1.10.3",
+ "eslint-config-gulp": "^2.0.0",
+ "expect": "^1.16.0",
+ "istanbul": "^0.4.3",
+ "istanbul-coveralls": "^1.0.3",
+ "jscs": "^2.3.5",
+ "jscs-preset-gulp": "^1.0.0",
+ "mocha": "^2.4.5"
+ },
+ "engines": {
+ "node": ">= 0.10"
+ },
+ "files": [
+ "LICENSE",
+ "index.js"
+ ],
+ "homepage": "https://github.com/gulpjs/replace-ext#readme",
+ "keywords": [
+ "gulp",
+ "extensions",
+ "filepath",
+ "basename"
+ ],
+ "license": "MIT",
+ "main": "index.js",
+ "name": "replace-ext",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/gulpjs/replace-ext.git"
+ },
+ "scripts": {
+ "cover": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly",
+ "coveralls": "npm run cover && istanbul-coveralls",
+ "lint": "eslint . && jscs index.js test/",
+ "pretest": "npm run lint",
+ "test": "mocha --async-only"
+ },
+ "version": "1.0.0"
+}
diff --git a/tools/eslint/node_modules/longest-streak/LICENSE b/tools/eslint/node_modules/state-toggle/LICENSE
index 611b67581b..8d8660d36e 100644
--- a/tools/eslint/node_modules/longest-streak/LICENSE
+++ b/tools/eslint/node_modules/state-toggle/LICENSE
@@ -1,6 +1,6 @@
(The MIT License)
-Copyright (c) 2015 Titus Wormer <mailto:tituswormer@gmail.com>
+Copyright (c) 2016 Titus Wormer <tituswormer@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
diff --git a/tools/eslint/node_modules/state-toggle/history.md b/tools/eslint/node_modules/state-toggle/history.md
new file mode 100644
index 0000000000..f20d503569
--- /dev/null
+++ b/tools/eslint/node_modules/state-toggle/history.md
@@ -0,0 +1,6 @@
+<!--remark setext-->
+
+<!--lint disable no-multiple-toplevel-headings -->
+
+1.0.0 / 2016-07-16
+==================
diff --git a/tools/eslint/node_modules/state-toggle/index.js b/tools/eslint/node_modules/state-toggle/index.js
new file mode 100644
index 0000000000..d5aff1857f
--- /dev/null
+++ b/tools/eslint/node_modules/state-toggle/index.js
@@ -0,0 +1,45 @@
+/**
+ * @author Titus Wormer
+ * @copyright 2016 Titus Wormer
+ * @license MIT
+ * @module state-toggle
+ * @fileoverview Enter/exit a state.
+ */
+
+'use strict';
+
+/* eslint-env commonjs */
+
+/* Expose. */
+module.exports = factory;
+
+/**
+ * Construct a state `toggler`: a function which inverses
+ * `property` in context based on its current value.
+ * The by `toggler` returned function restores that value.
+ *
+ * @param {string} key - Property to toggle.
+ * @param {boolean} state - Default state.
+ * @param {Object?} [ctx] - Context object.
+ * @return {Function} - Enter.
+ */
+function factory(key, state, ctx) {
+ /**
+ * Enter a state.
+ *
+ * @return {Function} - Exit state.
+ */
+ return function () {
+ var context = ctx || this;
+ var current = context[key];
+
+ context[key] = !state;
+
+ /**
+ * Cancel state to its value before entering.
+ */
+ return function () {
+ context[key] = current;
+ };
+ };
+}
diff --git a/tools/eslint/node_modules/ccount/package.json b/tools/eslint/node_modules/state-toggle/package.json
index 805f82a2ea..4b22e7f8c9 100644
--- a/tools/eslint/node_modules/ccount/package.json
+++ b/tools/eslint/node_modules/state-toggle/package.json
@@ -1,34 +1,34 @@
{
- "_from": "ccount@^1.0.0",
- "_id": "ccount@1.0.1",
+ "_from": "state-toggle@^1.0.0",
+ "_id": "state-toggle@1.0.0",
"_inBundle": false,
- "_integrity": "sha1-ZlaHlFFowhjsd/9hpBVa4AInqWw=",
- "_location": "/ccount",
+ "_integrity": "sha1-0g+aYWu08MO5i5GSLSW2QKorxCU=",
+ "_location": "/state-toggle",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
- "raw": "ccount@^1.0.0",
- "name": "ccount",
- "escapedName": "ccount",
+ "raw": "state-toggle@^1.0.0",
+ "name": "state-toggle",
+ "escapedName": "state-toggle",
"rawSpec": "^1.0.0",
"saveSpec": null,
"fetchSpec": "^1.0.0"
},
"_requiredBy": [
- "/remark-stringify"
+ "/eslint-plugin-markdown/remark-parse"
],
- "_resolved": "https://registry.npmjs.org/ccount/-/ccount-1.0.1.tgz",
- "_shasum": "665687945168c218ec77ff61a4155ae00227a96c",
- "_spec": "ccount@^1.0.0",
- "_where": "/Users/trott/io.js/tools/eslint-tmp/node_modules/eslint/node_modules/remark-stringify",
+ "_resolved": "https://registry.npmjs.org/state-toggle/-/state-toggle-1.0.0.tgz",
+ "_shasum": "d20f9a616bb4f0c3b98b91922d25b640aa2bc425",
+ "_spec": "state-toggle@^1.0.0",
+ "_where": "j:\\temp\\_git\\node-fork\\tools\\eslint\\node_modules\\eslint-plugin-markdown\\node_modules\\remark-parse",
"author": {
"name": "Titus Wormer",
"email": "tituswormer@gmail.com",
"url": "http://wooorm.com"
},
"bugs": {
- "url": "https://github.com/wooorm/ccount/issues"
+ "url": "https://github.com/wooorm/state-toggle/issues"
},
"bundleDependencies": false,
"contributors": [
@@ -40,7 +40,7 @@
],
"dependencies": {},
"deprecated": false,
- "description": "Count characters",
+ "description": "Enter/exit a state",
"devDependencies": {
"browserify": "^13.0.1",
"esmangle": "^1.0.1",
@@ -56,14 +56,20 @@
"files": [
"index.js"
],
- "homepage": "https://github.com/wooorm/ccount#readme",
+ "homepage": "https://github.com/wooorm/state-toggle#readme",
"keywords": [
- "character",
- "count",
- "char"
+ "enter",
+ "exit",
+ "state"
],
"license": "MIT",
- "name": "ccount",
+ "name": "state-toggle",
+ "nyc": {
+ "check-coverage": true,
+ "lines": 100,
+ "functions": 100,
+ "branches": 100
+ },
"remarkConfig": {
"output": true,
"plugins": [
@@ -78,24 +84,24 @@
},
"repository": {
"type": "git",
- "url": "git+https://github.com/wooorm/ccount.git"
+ "url": "git+https://github.com/wooorm/state-toggle.git"
},
"scripts": {
"build": "npm run build-md && npm run build-bundle && npm run build-mangle",
- "build-bundle": "browserify index.js --bare -s ccount > ccount.js",
- "build-mangle": "esmangle ccount.js > ccount.min.js",
+ "build-bundle": "browserify index.js --bare -s stateToggle > state-toggle.js",
+ "build-mangle": "esmangle < state-toggle.js > state-toggle.min.js",
"build-md": "remark . --quiet --frail",
"lint": "xo",
"test": "npm run build && npm run lint && npm run test-coverage",
"test-api": "node test",
"test-coverage": "nyc --reporter lcov tape test.js"
},
- "version": "1.0.1",
+ "version": "1.0.0",
"xo": {
"space": true,
"ignores": [
- "ccount.js",
- "ccount.min.js"
+ "state-toggle.js",
+ "state-toggle.min.js"
]
}
}
diff --git a/tools/eslint/node_modules/state-toggle/readme.md b/tools/eslint/node_modules/state-toggle/readme.md
new file mode 100644
index 0000000000..e2282d113b
--- /dev/null
+++ b/tools/eslint/node_modules/state-toggle/readme.md
@@ -0,0 +1,83 @@
+# state-toggle [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov]
+
+<!--lint disable heading-increment no-duplicate-headings-->
+
+Enter/exit a state.
+
+## Installation
+
+[npm][npm-install]:
+
+```bash
+npm install state-toggle
+```
+
+## Usage
+
+```javascript
+var toggle = require('state-toggle');
+var ctx = {on: false};
+var enter = toggle('on', ctx.on, ctx);
+var exit;
+
+// Entering:
+exit = enter();
+console.log(ctx.on); // true
+
+// Exiting:
+exit();
+console.log(ctx.on); // false
+```
+
+## API
+
+### `toggle(key, initial[, ctx])`
+
+Create a toggle, which when entering toggles `key` on `ctx` (or `this`,
+if `ctx` is not given) to `!initial`, and when exiting, sets `key` on
+the context back to the value it had before entering.
+
+###### Returns
+
+`Function` — [`enter`][enter].
+
+### `enter()`
+
+Enter the state.
+
+###### Context
+
+If no `ctx` was given to `toggle`, the context object (`this`) of `enter()`
+is used to toggle.
+
+###### Returns
+
+`Function` — [`exit`][exit].
+
+### `exit()`
+
+Exit the state, reverting `key` to the value it had before entering.
+
+## License
+
+[MIT][license] © [Titus Wormer][author]
+
+<!-- Definitions -->
+
+[travis-badge]: https://img.shields.io/travis/wooorm/state-toggle.svg
+
+[travis]: https://travis-ci.org/wooorm/state-toggle
+
+[codecov-badge]: https://img.shields.io/codecov/c/github/wooorm/state-toggle.svg
+
+[codecov]: https://codecov.io/github/wooorm/state-toggle
+
+[npm-install]: https://docs.npmjs.com/cli/install
+
+[license]: LICENSE
+
+[author]: http://wooorm.com
+
+[enter]: #enter
+
+[exit]: #exit
diff --git a/tools/eslint/node_modules/stringify-entities/LICENSE b/tools/eslint/node_modules/stringify-entities/LICENSE
deleted file mode 100644
index 611b67581b..0000000000
--- a/tools/eslint/node_modules/stringify-entities/LICENSE
+++ /dev/null
@@ -1,22 +0,0 @@
-(The MIT License)
-
-Copyright (c) 2015 Titus Wormer <mailto:tituswormer@gmail.com>
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-'Software'), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/tools/eslint/node_modules/stringify-entities/dangerous.json b/tools/eslint/node_modules/stringify-entities/dangerous.json
deleted file mode 100644
index 9147982cd1..0000000000
--- a/tools/eslint/node_modules/stringify-entities/dangerous.json
+++ /dev/null
@@ -1,10 +0,0 @@
-[
- "cent",
- "copy",
- "divide",
- "gt",
- "lt",
- "not",
- "para",
- "times"
-]
diff --git a/tools/eslint/node_modules/stringify-entities/index.js b/tools/eslint/node_modules/stringify-entities/index.js
deleted file mode 100644
index 9ffa29eae9..0000000000
--- a/tools/eslint/node_modules/stringify-entities/index.js
+++ /dev/null
@@ -1,132 +0,0 @@
-'use strict';
-
-var entities = require('character-entities-html4');
-var legacy = require('character-entities-legacy');
-var hexadecimal = require('is-hexadecimal');
-var alphanumerical = require('is-alphanumerical');
-var dangerous = require('./dangerous.json');
-
-/* Expose. */
-module.exports = encode;
-
-encode.escape = escape;
-
-var own = {}.hasOwnProperty;
-
-/* List of enforced escapes. */
-var escapes = ['"', '\'', '<', '>', '&', '`'];
-
-/* Map of characters to names. */
-var characters = construct();
-
-/* Default escapes. */
-var EXPRESSION_ESCAPE = toExpression(escapes);
-
-/* Surrogate pairs. */
-var EXPRESSION_SURROGATE_PAIR = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
-
-/* Non-ASCII characters. */
-// eslint-disable-next-line no-control-regex
-var EXPRESSION_BMP = /[\x01-\t\x0B\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g;
-
-/* Encode special characters in `value`. */
-function encode(value, options) {
- var settings = options || {};
- var subset = settings.subset;
- var set = subset ? toExpression(subset) : EXPRESSION_ESCAPE;
- var escapeOnly = settings.escapeOnly;
- var omit = settings.omitOptionalSemicolons;
-
- value = value.replace(set, function (char, pos, val) {
- return one(char, val.charAt(pos + 1), settings);
- });
-
- if (subset || escapeOnly) {
- return value;
- }
-
- return value
- .replace(EXPRESSION_SURROGATE_PAIR, function (pair, pos, val) {
- return toHexReference(
- ((pair.charCodeAt(0) - 0xD800) * 0x400) +
- pair.charCodeAt(1) - 0xDC00 + 0x10000,
- val.charAt(pos + 2),
- omit
- );
- })
- .replace(EXPRESSION_BMP, function (char, pos, val) {
- return one(char, val.charAt(pos + 1), settings);
- });
-}
-
-/* Shortcut to escape special characters in HTML. */
-function escape(value) {
- return encode(value, {
- escapeOnly: true,
- useNamedReferences: true
- });
-}
-
-/* Encode `char` according to `options`. */
-function one(char, next, options) {
- var shortest = options.useShortestReferences;
- var omit = options.omitOptionalSemicolons;
- var named;
- var numeric;
-
- if (
- (shortest || options.useNamedReferences) &&
- own.call(characters, char)
- ) {
- named = toNamed(characters[char], next, omit, options.attribute);
- }
-
- if (shortest || !named) {
- numeric = toHexReference(char.charCodeAt(0), next, omit);
- }
-
- if (named && (!shortest || named.length < numeric.length)) {
- return named;
- }
-
- return numeric;
-}
-
-/* Transform `code` into an entity. */
-function toNamed(name, next, omit, attribute) {
- var value = '&' + name;
-
- if (
- omit &&
- own.call(legacy, name) &&
- dangerous.indexOf(name) === -1 &&
- (!attribute || (next && next !== '=' && !alphanumerical(next)))
- ) {
- return value;
- }
-
- return value + ';';
-}
-
-/* Transform `code` into a hexadecimal character reference. */
-function toHexReference(code, next, omit) {
- var value = '&#x' + code.toString(16).toUpperCase();
- return omit && next && !hexadecimal(next) ? value : value + ';';
-}
-
-/* Create an expression for `characters`. */
-function toExpression(characters) {
- return new RegExp('[' + characters.join('') + ']', 'g');
-}
-
-/* Construct the map. */
-function construct() {
- var chars = {};
- var name;
-
- for (name in entities) {
- chars[entities[name]] = name;
- }
-
- return chars;
-}
diff --git a/tools/eslint/node_modules/stringify-entities/package.json b/tools/eslint/node_modules/stringify-entities/package.json
deleted file mode 100644
index bfeadfe219..0000000000
--- a/tools/eslint/node_modules/stringify-entities/package.json
+++ /dev/null
@@ -1,113 +0,0 @@
-{
- "_from": "stringify-entities@^1.0.1",
- "_id": "stringify-entities@1.3.1",
- "_inBundle": false,
- "_integrity": "sha1-sVDsLXKsTBtfMktR+2soyc3/BYw=",
- "_location": "/stringify-entities",
- "_phantomChildren": {},
- "_requested": {
- "type": "range",
- "registry": true,
- "raw": "stringify-entities@^1.0.1",
- "name": "stringify-entities",
- "escapedName": "stringify-entities",
- "rawSpec": "^1.0.1",
- "saveSpec": null,
- "fetchSpec": "^1.0.1"
- },
- "_requiredBy": [
- "/remark-stringify"
- ],
- "_resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-1.3.1.tgz",
- "_shasum": "b150ec2d72ac4c1b5f324b51fb6b28c9cdff058c",
- "_spec": "stringify-entities@^1.0.1",
- "_where": "/Users/trott/io.js/tools/eslint-tmp/node_modules/eslint/node_modules/remark-stringify",
- "author": {
- "name": "Titus Wormer",
- "email": "tituswormer@gmail.com",
- "url": "http://wooorm.com"
- },
- "bugs": {
- "url": "https://github.com/wooorm/stringify-entities/issues"
- },
- "bundleDependencies": false,
- "contributors": [
- {
- "name": "Titus Wormer",
- "email": "tituswormer@gmail.com",
- "url": "http://wooorm.com"
- }
- ],
- "dependencies": {
- "character-entities-html4": "^1.0.0",
- "character-entities-legacy": "^1.0.0",
- "is-alphanumerical": "^1.0.0",
- "is-hexadecimal": "^1.0.0"
- },
- "deprecated": false,
- "description": "Encode HTML character references and character entities",
- "devDependencies": {
- "browserify": "^14.0.0",
- "character-entities": "^1.0.0",
- "esmangle": "^1.0.0",
- "nyc": "^11.0.0",
- "remark-cli": "^3.0.0",
- "remark-preset-wooorm": "^3.0.0",
- "tape": "^4.0.0",
- "xo": "^0.18.0"
- },
- "files": [
- "dangerous.json",
- "index.js"
- ],
- "homepage": "https://github.com/wooorm/stringify-entities#readme",
- "keywords": [
- "stringify",
- "encode",
- "escape",
- "html",
- "character",
- "reference",
- "entity",
- "entities"
- ],
- "license": "MIT",
- "name": "stringify-entities",
- "nyc": {
- "check-coverage": true,
- "lines": 100,
- "functions": 100,
- "branches": 100
- },
- "remarkConfig": {
- "plugins": [
- "preset-wooorm"
- ]
- },
- "repository": {
- "type": "git",
- "url": "git+https://github.com/wooorm/stringify-entities.git"
- },
- "scripts": {
- "build": "npm run build-dangerous && npm run build-md && npm run build-bundle && npm run build-mangle",
- "build-bundle": "browserify index.js --bare -s stringifyEntities > stringify-entities.js",
- "build-dangerous": "node build",
- "build-mangle": "esmangle stringify-entities.js > stringify-entities.min.js",
- "build-md": "remark . -qfo",
- "lint": "xo",
- "test": "npm run build && npm run lint && npm run test-coverage",
- "test-api": "node test",
- "test-coverage": "nyc --reporter lcov tape test.js"
- },
- "version": "1.3.1",
- "xo": {
- "space": true,
- "esnext": false,
- "rules": {
- "guard-for-in": "off"
- },
- "ignores": [
- "stringify-entities.js"
- ]
- }
-}
diff --git a/tools/eslint/node_modules/stringify-entities/readme.md b/tools/eslint/node_modules/stringify-entities/readme.md
deleted file mode 100644
index c819969568..0000000000
--- a/tools/eslint/node_modules/stringify-entities/readme.md
+++ /dev/null
@@ -1,118 +0,0 @@
-# stringify-entities [![Build Status][build-badge]][build-status] [![Coverage Status][coverage-badge]][coverage-status]
-
-Encode HTML character references and character entities.
-
-* [x] Very fast
-* [x] Just the encoding part
-* [x] Reliable: ``'`'`` characters are escaped to ensure no scripts
- run in IE6-8. Additionally, only named entities recognised by HTML4
- are encoded, meaning the infamous `&apos;` (which people think is a
- [virus][]) won’t show up
-
-## Algorithm
-
-By default, all dangerous, non-ASCII, or non-printable ASCII characters
-are encoded. A [subset][] of characters can be given to encode just
-those characters. Alternatively, pass [`escapeOnly`][escapeonly] to
-escape just the dangerous characters (`"`, `'`, `<`, `>`, `&`, `` ` ``).
-By default, numeric entities are used. Pass [`useNamedReferences`][named]
-to use named entities when possible, or [`useShortestReferences`][short]
-to use them if that results in less bytes.
-
-## Installation
-
-[npm][]:
-
-```bash
-npm install stringify-entities
-```
-
-## Usage
-
-```js
-var stringify = require('stringify-entities');
-
-stringify('alpha © bravo ≠ charlie 𝌆 delta');
-//=> 'alpha &#xA9; bravo &#x2260; charlie &#x1D306; delta'
-
-stringify('alpha © bravo ≠ charlie 𝌆 delta', {useNamedReferences: true});
-//=> 'alpha &copy; bravo &ne; charlie &#x1D306; delta'
-```
-
-## API
-
-### `stringifyEntities(value[, options])`
-
-Encode special characters in `value`.
-
-##### `options`
-
-###### `options.escapeOnly`
-
-Whether to only escape possibly dangerous characters (`boolean`,
-default: `false`). Those characters are `"`, `'`, `<`, `>` `&`, and
-`` ` ``.
-
-###### `options.subset`
-
-Whether to only escape the given subset of characters (`Array.<string>`).
-
-###### `options.useNamedReferences`
-
-Whether to use named entities where possible (`boolean?`, default:
-`false`).
-
-###### `options.useShortestReferences`
-
-Whether to use named entities, where possible, if that results in less
-bytes (`boolean?`, default: `false`). **Note**: `useNamedReferences`
-can be omitted when using `useShortestReferences`.
-
-###### `options.omitOptionalSemicolons`
-
-Whether to omit semi-colons when possible (`boolean?`, default: `false`).
-**Note**: This creates parse errors: don’t use this except when building
-a minifier.
-
-Omitting semi-colons is possible for [certain][dangerous] [legacy][]
-named references, and numeric entities, in some cases.
-
-###### `options.attribute`
-
-Only needed when operating dangerously with `omitOptionalSemicolons: true`.
-Create entities which don’t fail in attributes (`boolean?`, default:
-`false`).
-
-## License
-
-[MIT][license] © [Titus Wormer][author]
-
-<!-- Definitions -->
-
-[build-badge]: https://img.shields.io/travis/wooorm/stringify-entities.svg
-
-[build-status]: https://travis-ci.org/wooorm/stringify-entities
-
-[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/stringify-entities.svg
-
-[coverage-status]: https://codecov.io/github/wooorm/stringify-entities
-
-[license]: LICENSE
-
-[author]: http://wooorm.com
-
-[npm]: https://docs.npmjs.com/cli/install
-
-[virus]: http://www.telegraph.co.uk/technology/advice/10516839/Why-do-some-apostrophes-get-replaced-with-andapos.html
-
-[dangerous]: dangerous.json
-
-[legacy]: https://github.com/wooorm/character-entities-legacy
-
-[subset]: #optionssubset
-
-[escapeonly]: #optionsescapeonly
-
-[named]: #optionsusenamedreferences
-
-[short]: #optionsuseshortestreferences
diff --git a/tools/eslint/node_modules/unified/history.md b/tools/eslint/node_modules/unified/history.md
deleted file mode 100644
index 36bf1993cd..0000000000
--- a/tools/eslint/node_modules/unified/history.md
+++ /dev/null
@@ -1,85 +0,0 @@
-<!--remark setext-->
-
-<!--lint disable no-multiple-toplevel-headings-->
-
-4.2.1 / 2016-08-02
-==================
-
-* Refactor to simplify completion handling ([`292cc0d`](https://github.com/wooorm/unified/commit/292cc0d))
-
-4.2.0 / 2016-08-01
-==================
-
-* Move `trough` over to its own module ([`81c67fb`](https://github.com/wooorm/unified/commit/81c67fb))
-* Fix bug where exceptions in `done` were swallowed ([`2dfc932`](https://github.com/wooorm/unified/commit/2dfc932))
-* Refactor code-style to use `xo` ([`01543d5`](https://github.com/wooorm/unified/commit/01543d5))
-
-4.1.2 / 2016-06-13
-==================
-
-* Fix bug in chaining when using multiple attachers ([`dda5530`](https://github.com/wooorm/unified/commit/dda5530))
-
-4.1.1 / 2016-06-12
-==================
-
-* Fix swallowed sync parse / compile error ([`f206ad2`](https://github.com/wooorm/unified/commit/f206ad2))
-
-4.1.0 / 2016-06-11
-==================
-
-* Update to inline `pipe`, slimming down bundled size ([`712474f`](https://github.com/wooorm/unified/commit/712474f))
-
-4.0.1 / 2016-05-24
-==================
-
-* Update `package.json` ([`c4a50f9`](https://github.com/wooorm/unified/commit/c4a50f9))
-
-4.0.0 / 2016-05-24
-==================
-
-* Rewrite library ([`a070ad0`](https://github.com/wooorm/unified/commit/a070ad0) and [`b64f512`](https://github.com/wooorm/unified/commit/b64f512))
-* Update dev-dependencies ([`fa9ac36`](https://github.com/wooorm/unified/commit/fa9ac36))
-
-3.0.0 / 2016-02-13
-==================
-
-* Update `use` interface ([`37e4d67`](https://github.com/wooorm/unified/commit/37e4d67))
-* Remove support for cloning processors ([`d672875`](https://github.com/wooorm/unified/commit/d672875))
-
-2.1.4 / 2016-01-24
-==================
-
-2.1.3 / 2016-01-24
-==================
-
-* Add section on `unified-bridges` ([`1adb6ac`](https://github.com/wooorm/unified/commit/1adb6ac))
-* Add list of processors ([`2670ade`](https://github.com/wooorm/unified/commit/2670ade))
-* Remove support for Component ([`85207f4`](https://github.com/wooorm/unified/commit/85207f4))
-* Remove support for Bower ([`3e09ed6`](https://github.com/wooorm/unified/commit/3e09ed6))
-* Remove distribution files from source ([`7acb775`](https://github.com/wooorm/unified/commit/7acb775))
-* Refactor to replace mocha with tape ([`1533d17`](https://github.com/wooorm/unified/commit/1533d17))
-* Refactor `readme.md` ([`f323dfd`](https://github.com/wooorm/unified/commit/f323dfd))
-
-2.1.2 / 2015-10-23
-==================
-
-* Refactor browserify system ([`c95686d`](https://github.com/wooorm/unified/commit/c95686d))
-
-2.1.1 / 2015-10-14
-==================
-
-* Fix component and duo support ([`3eacf6a`](https://github.com/wooorm/unified/commit/3eacf6a))
-
-2.1.0 / 2015-10-10
-==================
-
-* Add support for processor data ([`e9b9f7e`](https://github.com/wooorm/unified/commit/e9b9f7e))
-* Add references to `hast` ([`d1a1c7e`](https://github.com/wooorm/unified/commit/d1a1c7e))
-
-2.0.0 / 2015-09-16
-==================
-
-* Remove `type` support ([`8748cfe`](https://github.com/wooorm/unified/commit/8748cfe))
-
-1.0.0 / 2015-07-31
-==================
diff --git a/tools/eslint/node_modules/unified/index.js b/tools/eslint/node_modules/unified/index.js
index 051383e98a..2bc872ee8d 100644
--- a/tools/eslint/node_modules/unified/index.js
+++ b/tools/eslint/node_modules/unified/index.js
@@ -1,71 +1,76 @@
-/**
- * @author Titus Wormer
- * @copyright 2015 Titus Wormer
- * @license MIT
- * @module unified
- * @fileoverview Pluggable text processing interface.
- */
-
'use strict';
/* Dependencies. */
-var events = require('events');
-var has = require('has');
-var once = require('once');
var extend = require('extend');
var bail = require('bail');
var vfile = require('vfile');
var trough = require('trough');
+var string = require('x-is-string');
+var func = require('x-is-function');
+var plain = require('is-plain-obj');
-/* Expose an abstract processor. */
-module.exports = unified().abstract();
+/* Expose a frozen processor. */
+module.exports = unified().freeze();
-/* Methods. */
var slice = [].slice;
+var own = {}.hasOwnProperty;
/* Process pipeline. */
-var pipeline = trough()
- .use(function (p, ctx) {
- ctx.tree = p.parse(ctx.file, ctx.options);
- })
- .use(function (p, ctx, next) {
- p.run(ctx.tree, ctx.file, function (err, tree, file) {
- if (err) {
- next(err);
- } else {
- ctx.tree = tree;
- ctx.file = file;
- next();
- }
- });
- })
- .use(function (p, ctx) {
- ctx.file.contents = p.stringify(ctx.tree, ctx.file, ctx.options);
- });
-
-/**
- * Function to create the first processor.
- *
- * @return {Function} - First processor.
- */
+var pipeline = trough().use(pipelineParse).use(pipelineRun).use(pipelineStringify);
+
+function pipelineParse(p, ctx) {
+ ctx.tree = p.parse(ctx.file);
+}
+
+function pipelineRun(p, ctx, next) {
+ p.run(ctx.tree, ctx.file, done);
+
+ function done(err, tree, file) {
+ if (err) {
+ next(err);
+ } else {
+ ctx.tree = tree;
+ ctx.file = file;
+ next();
+ }
+ }
+}
+
+function pipelineStringify(p, ctx) {
+ ctx.file.contents = p.stringify(ctx.tree, ctx.file);
+}
+
+/* Function to create the first processor. */
function unified() {
var attachers = [];
var transformers = trough();
var namespace = {};
- var chunks = [];
- var emitter = new events.EventEmitter();
- var ended = false;
- var concrete = true;
- var settings;
- var key;
+ var frozen = false;
+ var freezeIndex = -1;
- /**
- * Create a new processor based on the processor
- * in the current scope.
- *
- * @return {Processor} - New concrete processor based
- * on the descendant processor.
- */
+ /* Data management. */
+ processor.data = data;
+
+ /* Lock. */
+ processor.freeze = freeze;
+
+ /* Plug-ins. */
+ processor.attachers = attachers;
+ processor.use = use;
+
+ /* API. */
+ processor.parse = parse;
+ processor.stringify = stringify;
+ processor.run = run;
+ processor.runSync = runSync;
+ processor.process = process;
+ processor.processSync = processSync;
+
+ /* Expose. */
+ return processor;
+
+ /* Create a new processor based on the processor
+ * in the current scope. */
function processor() {
var destination = unified();
var length = attachers.length;
@@ -80,558 +85,376 @@ function unified() {
return destination;
}
- /* Mix in methods. */
- for (key in emitter) {
- processor[key] = emitter[key];
- }
-
- /* Helpers. */
-
- /**
- * Assert a parser is available.
+ /* Freeze: used to signal a processor that has finished
+ * configuration.
*
- * @param {string} name - Name of callee.
- */
- function assertParser(name) {
- if (!isParser(processor.Parser)) {
- throw new Error('Cannot `' + name + '` without `Parser`');
- }
- }
-
- /**
- * Assert a compiler is available.
+ * For example, take unified itself. It’s frozen.
+ * Plug-ins should not be added to it. Rather, it should
+ * be extended, by invoking it, before modifying it.
*
- * @param {string} name - Name of callee.
- */
- function assertCompiler(name) {
- if (!isCompiler(processor.Compiler)) {
- throw new Error('Cannot `' + name + '` without `Compiler`');
- }
- }
+ * In essence, always invoke this when exporting a
+ * processor. */
+ function freeze() {
+ var values;
+ var plugin;
+ var options;
+ var transformer;
- /**
- * Assert the processor is concrete.
- *
- * @param {string} name - Name of callee.
- */
- function assertConcrete(name) {
- if (!concrete) {
- throw new Error(
- 'Cannot ' +
- (name ? 'invoke `' + name + '` on' : 'pipe into') +
- ' abstract processor.\n' +
- 'To make the processor concrete, invoke it: ' +
- 'use `processor()` instead of `processor`.'
- );
+ if (frozen) {
+ return processor;
}
- }
- /**
- * Assert `node` is a Unist node.
- *
- * @param {*} node - Value to check.
- */
- function assertNode(node) {
- if (!isNode(node)) {
- throw new Error('Expected node, got `' + node + '`');
- }
- }
+ while (++freezeIndex < attachers.length) {
+ values = attachers[freezeIndex];
+ plugin = values[0];
+ options = values[1];
+ transformer = null;
- /**
- * Assert, if no `done` is given, that `complete` is
- * `true`.
- *
- * @param {string} name - Name of callee.
- * @param {boolean} complete - Whether an async process
- * is complete.
- * @param {Function?} done - Optional handler of async
- * results.
- */
- function assertDone(name, complete, done) {
- if (!complete && !done) {
- throw new Error(
- 'Expected `done` to be given to `' + name + '` ' +
- 'as async plug-ins are used'
- );
- }
- }
+ if (options === false) {
+ continue;
+ }
- /* Throw as early as possible.
- * As events are triggered synchroneously, the stack
- * is preserved. */
- processor.on('pipe', function () {
- assertConcrete();
- });
+ if (options === true) {
+ values[1] = undefined;
+ }
- /**
- * Abstract: used to signal an abstract processor which
- * should made concrete before using.
- *
- * For example, take unified itself. It’s abstract.
- * Plug-ins should not be added to it. Rather, it should
- * be made concrete (by invoking it) before modifying it.
- *
- * In essence, always invoke this when exporting a
- * processor.
- *
- * @return {Processor} - The operated on processor.
- */
- function abstract() {
- concrete = false;
+ transformer = plugin.apply(processor, values.slice(1));
+
+ if (func(transformer)) {
+ transformers.use(transformer);
+ }
+ }
+
+ frozen = true;
+ freezeIndex = Infinity;
return processor;
}
- /**
- * Data management.
- *
- * Getter / setter for processor-specific informtion.
- *
- * @param {string} key - Key to get or set.
- * @param {*} value - Value to set.
- * @return {*} - Either the operator on processor in
- * setter mode; or the value stored as `key` in
- * getter mode.
- */
+ /* Data management.
+ * Getter / setter for processor-specific informtion. */
function data(key, value) {
- assertConcrete('data');
-
- if (typeof key === 'string') {
+ if (string(key)) {
/* Set `key`. */
if (arguments.length === 2) {
+ assertUnfrozen('data', frozen);
+
namespace[key] = value;
return processor;
}
/* Get `key`. */
- return (has(namespace, key) && namespace[key]) || null;
- }
-
- /* Get space. */
- if (!key) {
- return namespace;
+ return (own.call(namespace, key) && namespace[key]) || null;
}
/* Set space. */
- namespace = key;
+ if (key) {
+ assertUnfrozen('data', frozen);
+ namespace = key;
+ return processor;
+ }
- return processor;
+ /* Get space. */
+ return namespace;
}
- /**
- * Plug-in management.
+ /* Plug-in management.
*
* Pass it:
* * an attacher and options,
- * * a list of attachers and options for all of them;
- * * a tuple of one attacher and options.
- * * a matrix: list containing any of the above and
- * matrices.
- *
- * @param {...*} value - See description.
- * @return {Processor} - The operated on processor.
- */
+ * * a preset,
+ * * a list of presets, attachers, and arguments (list
+ * of attachers and options). */
function use(value) {
- var args = slice.call(arguments, 0);
- var params = args.slice(1);
- var index;
- var length;
- var transformer;
-
- assertConcrete('use');
+ var settings;
- /* Multiple attachers. */
- if ('length' in value && !isFunction(value)) {
- index = -1;
- length = value.length;
+ assertUnfrozen('use', frozen);
- if (!isFunction(value[0])) {
- /* Matrix of things. */
- while (++index < length) {
- use(value[index]);
- }
- } else if (isFunction(value[1])) {
- /* List of things. */
- while (++index < length) {
- use.apply(null, [value[index]].concat(params));
- }
+ if (value === null || value === undefined) {
+ /* Empty */
+ } else if (func(value)) {
+ addPlugin.apply(null, arguments);
+ } else if (typeof value === 'object') {
+ if ('length' in value) {
+ addList(value);
} else {
- /* Arguments. */
- use.apply(null, value);
+ addPreset(value);
}
-
- return processor;
+ } else {
+ throw new Error('Expected usable value, not `' + value + '`');
}
- /* Store attacher. */
- attachers.push(args);
-
- /* Single attacher. */
- transformer = value.apply(null, [processor].concat(params));
-
- if (isFunction(transformer)) {
- transformers.use(transformer);
+ if (settings) {
+ namespace.settings = extend(namespace.settings || {}, settings);
}
return processor;
- }
- /**
- * Parse a file (in string or VFile representation)
- * into a Unist node using the `Parser` on the
- * processor.
- *
- * @param {(string|VFile)?} [file] - File to process.
- * @param {Object?} [options] - Configuration.
- * @return {Node} - Unist node.
- */
- function parse(file, options) {
- assertConcrete('parse');
- assertParser('parse');
-
- return new processor.Parser(vfile(file), options, processor).parse();
- }
+ function addPreset(result) {
+ addList(result.plugins);
- /**
- * Run transforms on a Unist node representation of a file
- * (in string or VFile representation).
- *
- * @param {Node} node - Unist node.
- * @param {(string|VFile)?} [file] - File representation.
- * @param {Function?} [done] - Callback.
- * @return {Node} - The given or resulting Unist node.
- */
- function run(node, file, done) {
- var complete = false;
- var result;
-
- assertConcrete('run');
- assertNode(node);
-
- result = node;
-
- if (!done && file && !isFile(file)) {
- done = file;
- file = null;
+ if (result.settings) {
+ settings = extend(settings || {}, result.settings);
+ }
}
- transformers.run(node, vfile(file), function (err, tree, file) {
- complete = true;
- result = tree || node;
-
- (done || bail)(err, tree, file);
- });
-
- assertDone('run', complete, done);
-
- return result;
- }
-
- /**
- * Stringify a Unist node representation of a file
- * (in string or VFile representation) into a string
- * using the `Compiler` on the processor.
- *
- * @param {Node} node - Unist node.
- * @param {(string|VFile)?} [file] - File representation.
- * @param {Object?} [options] - Configuration.
- * @return {string} - String representation.
- */
- function stringify(node, file, options) {
- assertConcrete('stringify');
- assertCompiler('stringify');
- assertNode(node);
-
- if (!options && file && !isFile(file)) {
- options = file;
- file = null;
+ function add(value) {
+ if (func(value)) {
+ addPlugin(value);
+ } else if (typeof value === 'object') {
+ if ('length' in value) {
+ addPlugin.apply(null, value);
+ } else {
+ addPreset(value);
+ }
+ } else {
+ throw new Error('Expected usable value, not `' + value + '`');
+ }
}
- return new processor.Compiler(vfile(file), options, processor).compile(node);
- }
-
- /**
- * Parse a file (in string or VFile representation)
- * into a Unist node using the `Parser` on the processor,
- * then run transforms on that node, and compile the
- * resulting node using the `Compiler` on the processor,
- * and store that result on the VFile.
- *
- * @param {(string|VFile)?} file - File representation.
- * @param {Object?} [options] - Configuration.
- * @param {Function?} [done] - Callback.
- * @return {VFile} - The given or resulting VFile.
- */
- function process(file, options, done) {
- var complete = false;
+ function addList(plugins) {
+ var length;
+ var index;
- assertConcrete('process');
- assertParser('process');
- assertCompiler('process');
+ if (plugins === null || plugins === undefined) {
+ /* Empty */
+ } else if (typeof plugins === 'object' && 'length' in plugins) {
+ length = plugins.length;
+ index = -1;
- if (!done && isFunction(options)) {
- done = options;
- options = null;
+ while (++index < length) {
+ add(plugins[index]);
+ }
+ } else {
+ throw new Error('Expected a list of plugins, not `' + plugins + '`');
+ }
}
- file = vfile(file);
+ function addPlugin(plugin, value) {
+ var entry = find(plugin);
- pipeline.run(processor, {
- file: file,
- options: options || {}
- }, function (err) {
- complete = true;
+ if (entry) {
+ if (plain(entry[1]) && plain(value)) {
+ value = extend(entry[1], value);
+ }
- if (done) {
- done(err, file);
+ entry[1] = value;
} else {
- bail(err);
+ attachers.push(slice.call(arguments));
}
- });
-
- assertDone('process', complete, done);
-
- return file;
+ }
}
- /* Streams. */
+ function find(plugin) {
+ var length = attachers.length;
+ var index = -1;
+ var entry;
- /**
- * Write a chunk into memory.
- *
- * @param {(Buffer|string)?} chunk - Value to write.
- * @param {string?} [encoding] - Encoding.
- * @param {Function?} [callback] - Callback.
- * @return {boolean} - Whether the write was succesful.
- */
- function write(chunk, encoding, callback) {
- assertConcrete('write');
-
- if (isFunction(encoding)) {
- callback = encoding;
- encoding = null;
- }
+ while (++index < length) {
+ entry = attachers[index];
- if (ended) {
- throw new Error('Did not expect `write` after `end`');
+ if (entry[0] === plugin) {
+ return entry;
+ }
}
+ }
+
+ /* Parse a file (in string or VFile representation)
+ * into a Unist node using the `Parser` on the
+ * processor. */
+ function parse(doc) {
+ var file = vfile(doc);
+ var Parser;
- chunks.push((chunk || '').toString(encoding || 'utf8'));
+ freeze();
+ Parser = processor.Parser;
+ assertParser('parse', Parser);
- if (callback) {
- callback();
+ if (newable(Parser)) {
+ return new Parser(String(file), file).parse();
}
- /* Signal succesful write. */
- return true;
+ return Parser(String(file), file); // eslint-disable-line new-cap
}
- /**
- * End the writing. Passes all arguments to a final
- * `write`. Starts the process, which will trigger
- * `error`, with a fatal error, if any; `data`, with
- * the generated document in `string` form, if
- * succesful. If messages are triggered during the
- * process, those are triggerd as `warning`s.
- *
- * @return {boolean} - Whether the last write was
- * succesful.
- */
- function end() {
- assertConcrete('end');
- assertParser('end');
- assertCompiler('end');
+ /* Run transforms on a Unist node representation of a file
+ * (in string or VFile representation), async. */
+ function run(node, file, cb) {
+ assertNode(node);
+ freeze();
- write.apply(null, arguments);
+ if (!cb && func(file)) {
+ cb = file;
+ file = null;
+ }
- ended = true;
+ if (!cb) {
+ return new Promise(executor);
+ }
- process(chunks.join(''), settings, function (err, file) {
- var messages = file.messages;
- var length = messages.length;
- var index = -1;
+ executor(null, cb);
- chunks = settings = null;
+ function executor(resolve, reject) {
+ transformers.run(node, vfile(file), done);
- /* Trigger messages as warnings, except for fatal error. */
- while (++index < length) {
- if (messages[index] !== err) {
- processor.emit('warning', messages[index]);
+ function done(err, tree, file) {
+ tree = tree || node;
+ if (err) {
+ reject(err);
+ } else if (resolve) {
+ resolve(tree);
+ } else {
+ cb(null, tree, file);
}
}
-
- if (err) {
- /* Don’t enter an infinite error throwing loop. */
- global.setTimeout(function () {
- processor.emit('error', err);
- }, 4);
- } else {
- processor.emit('data', file.contents);
- processor.emit('end');
- }
- });
-
- return true;
+ }
}
- /**
- * Pipe the processor into a writable stream.
- *
- * Basically `Stream#pipe`, but inlined and
- * simplified to keep the bundled size down.
- *
- * @see https://github.com/nodejs/node/blob/master/lib/stream.js#L26
- *
- * @param {Stream} dest - Writable stream.
- * @param {Object?} [options] - Processing
- * configuration.
- * @return {Stream} - The destination stream.
- */
- function pipe(dest, options) {
- var onend = once(function () {
- if (dest.end) {
- dest.end();
- }
- });
+ /* Run transforms on a Unist node representation of a file
+ * (in string or VFile representation), sync. */
+ function runSync(node, file) {
+ var complete = false;
+ var result;
- assertConcrete('pipe');
+ run(node, file, done);
- settings = options || {};
+ assertDone('runSync', 'run', complete);
- /**
- * Handle data.
- *
- * @param {*} chunk - Data to pass through.
- */
- function ondata(chunk) {
- if (dest.writable) {
- dest.write(chunk);
- }
- }
+ return result;
- /**
- * Clean listeners.
- */
- function cleanup() {
- processor.removeListener('data', ondata);
- processor.removeListener('end', onend);
- processor.removeListener('error', onerror);
- processor.removeListener('end', cleanup);
- processor.removeListener('close', cleanup);
-
- dest.removeListener('error', onerror);
- dest.removeListener('close', cleanup);
+ function done(err, tree) {
+ complete = true;
+ bail(err);
+ result = tree;
}
+ }
- /**
- * Close dangling pipes and handle unheard errors.
- *
- * @param {Error} err - Exception.
- */
- function onerror(err) {
- var handlers = processor._events.error;
-
- cleanup();
+ /* Stringify a Unist node representation of a file
+ * (in string or VFile representation) into a string
+ * using the `Compiler` on the processor. */
+ function stringify(node, doc) {
+ var file = vfile(doc);
+ var Compiler;
+
+ freeze();
+ Compiler = processor.Compiler;
+ assertCompiler('stringify', Compiler);
+ assertNode(node);
- /* Cannot use `listenerCount` in node <= 0.12. */
- if (!handlers || !handlers.length || handlers === onerror) {
- throw err; /* Unhandled stream error in pipe. */
- }
+ if (newable(Compiler)) {
+ return new Compiler(node, file).compile();
}
- processor.on('data', ondata);
- processor.on('error', onerror);
- processor.on('end', cleanup);
- processor.on('close', cleanup);
+ return Compiler(node, file); // eslint-disable-line new-cap
+ }
- /* If the 'end' option is not supplied, dest.end() will be
- * called when the 'end' or 'close' events are received.
- * Only dest.end() once. */
- if (!dest._isStdio && settings.end !== false) {
- processor.on('end', onend);
+ /* Parse a file (in string or VFile representation)
+ * into a Unist node using the `Parser` on the processor,
+ * then run transforms on that node, and compile the
+ * resulting node using the `Compiler` on the processor,
+ * and store that result on the VFile. */
+ function process(doc, cb) {
+ freeze();
+ assertParser('process', processor.Parser);
+ assertCompiler('process', processor.Compiler);
+
+ if (!cb) {
+ return new Promise(executor);
}
- dest.on('error', onerror);
- dest.on('close', cleanup);
+ executor(null, cb);
+
+ function executor(resolve, reject) {
+ var file = vfile(doc);
- dest.emit('pipe', processor);
+ pipeline.run(processor, {file: file}, done);
- return dest;
+ function done(err) {
+ if (err) {
+ reject(err);
+ } else if (resolve) {
+ resolve(file);
+ } else {
+ cb(null, file);
+ }
+ }
+ }
}
- /* Data management. */
- processor.data = data;
+ /* Process the given document (in string or VFile
+ * representation), sync. */
+ function processSync(doc) {
+ var complete = false;
+ var file;
- /* Lock. */
- processor.abstract = abstract;
+ freeze();
+ assertParser('processSync', processor.Parser);
+ assertCompiler('processSync', processor.Compiler);
+ file = vfile(doc);
- /* Plug-ins. */
- processor.use = use;
+ process(file, done);
- /* Streaming. */
- processor.writable = true;
- processor.readable = true;
- processor.write = write;
- processor.end = end;
- processor.pipe = pipe;
+ assertDone('processSync', 'process', complete);
- /* API. */
- processor.parse = parse;
- processor.stringify = stringify;
- processor.run = run;
- processor.process = process;
+ return file;
- /* Expose. */
- return processor;
+ function done(err) {
+ complete = true;
+ bail(err);
+ }
+ }
}
-/**
- * Check if `node` is a Unist node.
- *
- * @param {*} node - Value.
- * @return {boolean} - Whether `node` is a Unist node.
- */
-function isNode(node) {
- return node && typeof node.type === 'string' && node.type.length !== 0;
+/* Check if `func` is a constructor. */
+function newable(value) {
+ return func(value) && keys(value.prototype);
}
-/**
- * Check if `file` is a VFile.
- *
- * @param {*} file - Value.
- * @return {boolean} - Whether `file` is a VFile.
- */
-function isFile(file) {
- return file && typeof file.contents === 'string';
+/* Check if `value` is an object with keys. */
+function keys(value) {
+ var key;
+ for (key in value) {
+ return true;
+ }
+ return false;
+}
+
+/* Assert a parser is available. */
+function assertParser(name, Parser) {
+ if (!func(Parser)) {
+ throw new Error('Cannot `' + name + '` without `Parser`');
+ }
}
-/**
- * Check if `fn` is a function.
- *
- * @param {*} fn - Value.
- * @return {boolean} - Whether `fn` is a function.
- */
-function isFunction(fn) {
- return typeof fn === 'function';
+/* Assert a compiler is available. */
+function assertCompiler(name, Compiler) {
+ if (!func(Compiler)) {
+ throw new Error('Cannot `' + name + '` without `Compiler`');
+ }
+}
+
+/* Assert the processor is not frozen. */
+function assertUnfrozen(name, frozen) {
+ if (frozen) {
+ throw new Error(
+ 'Cannot invoke `' + name + '` on a frozen processor.\n' +
+ 'Create a new processor first, by invoking it: ' +
+ 'use `processor()` instead of `processor`.'
+ );
+ }
}
-/**
- * Check if `compiler` is a Compiler.
- *
- * @param {*} compiler - Value.
- * @return {boolean} - Whether `compiler` is a Compiler.
- */
-function isCompiler(compiler) {
- return isFunction(compiler) && compiler.prototype && isFunction(compiler.prototype.compile);
+/* Assert `node` is a Unist node. */
+function assertNode(node) {
+ if (!node || !string(node.type)) {
+ throw new Error('Expected node, got `' + node + '`');
+ }
}
-/**
- * Check if `parser` is a Parser.
- *
- * @param {*} parser - Value.
- * @return {boolean} - Whether `parser` is a Parser.
- */
-function isParser(parser) {
- return isFunction(parser) && parser.prototype && isFunction(parser.prototype.parse);
+/* Assert that `complete` is `true`. */
+function assertDone(name, asyncName, complete) {
+ if (!complete) {
+ throw new Error('`' + name + '` finished async. Use `' + asyncName + '` instead');
+ }
}
diff --git a/tools/eslint/node_modules/unified/package.json b/tools/eslint/node_modules/unified/package.json
index c8f04f4847..4046284fba 100644
--- a/tools/eslint/node_modules/unified/package.json
+++ b/tools/eslint/node_modules/unified/package.json
@@ -1,138 +1,53 @@
{
- "_from": "unified@^4.1.1",
- "_id": "unified@4.2.1",
+ "_from": "unified@^6.1.2",
+ "_id": "unified@6.1.5",
"_inBundle": false,
- "_integrity": "sha1-dv9Dqo2kMPbn5KVchOusKtLPzS4=",
+ "_integrity": "sha1-cWk3hyYhpjE15iztLzrGoGPG+4c=",
"_location": "/unified",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
- "raw": "unified@^4.1.1",
+ "raw": "unified@^6.1.2",
"name": "unified",
"escapedName": "unified",
- "rawSpec": "^4.1.1",
+ "rawSpec": "^6.1.2",
"saveSpec": null,
- "fetchSpec": "^4.1.1"
+ "fetchSpec": "^6.1.2"
},
"_requiredBy": [
- "/remark"
+ "/eslint-plugin-markdown"
],
- "_resolved": "https://registry.npmjs.org/unified/-/unified-4.2.1.tgz",
- "_shasum": "76ff43aa8da430f6e7e4a55c84ebac2ad2cfcd2e",
- "_spec": "unified@^4.1.1",
- "_where": "/Users/trott/io.js/tools/eslint-tmp/node_modules/eslint/node_modules/remark",
- "author": {
- "name": "Titus Wormer",
- "email": "tituswormer@gmail.com",
- "url": "http://wooorm.com"
- },
- "browser": {
- "node-extend": "extend"
- },
- "bugs": {
- "url": "https://github.com/wooorm/unified/issues"
- },
+ "_resolved": "https://registry.npmjs.org/unified/-/unified-6.1.5.tgz",
+ "_shasum": "716937872621a63135e62ced2f3ac6a063c6fb87",
+ "_shrinkwrap": null,
+ "_spec": "unified@^6.1.2",
+ "_where": "j:\\temp\\_git\\node-fork\\tools\\eslint\\node_modules\\eslint-plugin-markdown",
+ "bin": null,
"bundleDependencies": false,
- "contributors": [
- {
- "name": "Titus Wormer",
- "email": "tituswormer@gmail.com",
- "url": "http://wooorm.com"
- }
- ],
"dependencies": {
"bail": "^1.0.0",
"extend": "^3.0.0",
- "has": "^1.0.1",
- "once": "^1.3.3",
+ "is-plain-obj": "^1.1.0",
"trough": "^1.0.0",
- "vfile": "^1.0.0"
+ "vfile": "^2.0.0",
+ "x-is-function": "^1.0.4",
+ "x-is-string": "^0.1.0"
},
"deprecated": false,
- "description": "Pluggable text processing interface",
+ "description": "[![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov]",
"devDependencies": {
- "browserify": "^13.0.0",
+ "browserify": "^14.0.0",
"esmangle": "^1.0.0",
- "nyc": "^7.1.0",
- "remark-cli": "^1.0.0",
- "remark-comment-config": "^4.0.0",
- "remark-github": "^5.0.0",
- "remark-lint": "^4.0.0",
- "remark-toc": "^3.0.0",
- "remark-validate-links": "^4.0.0",
+ "nyc": "^11.0.0",
+ "remark-cli": "^3.0.0",
+ "remark-preset-wooorm": "^3.0.0",
"tape": "^4.4.0",
- "xo": "^0.16.0"
- },
- "engines": {
- "node": ">=0.11.0"
+ "xo": "^0.18.1"
},
- "files": [
- "index.js",
- "lib"
- ],
- "homepage": "https://github.com/wooorm/unified#readme",
- "keywords": [
- "process",
- "parse",
- "transform",
- "compile",
- "stringify",
- "hast",
- "retext",
- "remark"
- ],
- "license": "MIT",
"name": "unified",
- "nyc": {
- "check-coverage": true,
- "lines": 100,
- "functions": 100,
- "branches": 100
- },
- "remarkConfig": {
- "output": true,
- "plugins": {
- "comment-config": null,
- "lint": {
- "heading-increment": false,
- "no-duplicate-headings": false,
- "list-item-spacing": false
- },
- "github": null,
- "toc": {
- "maxDepth": 3
- },
- "validate-links": null
- },
- "settings": {
- "bullet": "*"
- }
- },
- "repository": {
- "type": "git",
- "url": "git+https://github.com/wooorm/unified.git"
- },
- "scripts": {
- "build": "npm run build-md && npm run build-bundle && npm run build-mangle",
- "build-bundle": "browserify index.js -s unified > unified.js",
- "build-mangle": "esmangle unified.js > unified.min.js",
- "build-md": "remark . --quiet --frail",
- "lint": "xo",
- "test": "npm run build && npm run lint && npm run test-coverage",
- "test-api": "node test",
- "test-coverage": "nyc --reporter lcov tape test"
- },
- "version": "4.2.1",
- "xo": {
- "space": true,
- "rules": {
- "guard-for-in": "off",
- "max-lines": "off"
- },
- "ignores": [
- "unified.js",
- "unified.min.js"
- ]
- }
+ "optionalDependencies": {},
+ "peerDependencies": {},
+ "scripts": {},
+ "version": "6.1.5"
}
diff --git a/tools/eslint/node_modules/unified/readme.md b/tools/eslint/node_modules/unified/readme.md
index ab3b640e0f..431349459a 100644
--- a/tools/eslint/node_modules/unified/readme.md
+++ b/tools/eslint/node_modules/unified/readme.md
@@ -1,59 +1,82 @@
-# unified [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov]
+# ![unified][logo]
+
+[![Build Status][travis-badge]][travis]
+[![Coverage Status][codecov-badge]][codecov]
**unified** is an interface for processing text using syntax trees.
It’s what powers [**remark**][remark], [**retext**][retext], and
[**rehype**][rehype], but it also allows for processing between
multiple syntaxes.
+[`unifiedjs.github.io`][site], the website for **unified** provides a less
+technical, more practical, introduction to unified. Make sure to visit it
+and try its introductionary [Guides][].
+
## Installation
-[npm][npm-install]:
+[npm][]:
```bash
npm install unified
```
-**unified** is also available as an AMD, CommonJS, and globals module,
-[uncompressed and compressed][releases].
-
## Usage
```js
var unified = require('unified');
var markdown = require('remark-parse');
-var toc = require('remark-toc');
var remark2rehype = require('remark-rehype');
-var document = require('rehype-document');
+var doc = require('rehype-document');
+var format = require('rehype-format');
var html = require('rehype-stringify');
+var reporter = require('vfile-reporter');
-process.stdin
- .pipe(unified())
+unified()
.use(markdown)
- .use(toc)
.use(remark2rehype)
- .use(document)
+ .use(doc)
+ .use(format)
.use(html)
- .pipe(process.stdout);
+ .process('# Hello world!', function (err, file) {
+ console.error(reporter(err || file));
+ console.log(String(file));
+ });
+```
+
+Yields:
+
+```html
+no issues found
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ </head>
+ <body>
+ <h1>Hello world!</h1>
+ </body>
+</html>
```
## Table of Contents
* [Description](#description)
-
* [API](#api)
-
* [processor()](#processor)
* [processor.use(plugin\[, options\])](#processoruseplugin-options)
- * [processor.parse(file|value\[, options\])](#processorparsefilevalue-options)
- * [processor.stringify(node\[, file|value\]\[, options\])](#processorstringifynode-filevalue-options)
- * [processor.run(node\[, file|value\]\[, done\])](#processorrunnode-filevalue-done)
- * [processor.process(file|value\[, options\]\[, done\])](#processorprocessfilevalue-options-done)
- * [processor.write(chunk\[, encoding\]\[, callback\])](#processorwritechunk-encoding-callback)
- * [processor.end()](#processorend)
- * [processor.pipe(stream\[, options\])](#processorpipestream-options)
+ * [processor.parse(file|value)](#processorparsefilevalue)
+ * [processor.stringify(node\[, file\])](#processorstringifynode-file)
+ * [processor.run(node\[, file\]\[, done\])](#processorrunnode-file-done)
+ * [processor.runSync(node\[, file\])](#processorrunsyncnode-file)
+ * [processor.process(file|value\[, done\])](#processorprocessfilevalue-done)
+ * [processor.processSync(file|value)](#processorprocesssyncfilevalue)
* [processor.data(key\[, value\])](#processordatakey-value)
- * [processor.abstract()](#processorabstract)
-
+ * [processor.freeze()](#processorfreeze)
+* [Plugin](#plugin)
+ * [function attacher(\[options\])](#function-attacheroptions)
+ * [function transformer(node, file\[, next\])](#function-transformernode-file-next)
+* [Preset](#preset)
* [License](#license)
## Description
@@ -80,15 +103,15 @@ back to text, there’s a [**compiler**][compiler]. This is the
###### Processors
Every processor implements another processor. To create a new
-processor, invoke another processor. This creates a new processor
-which is configured to function the same as its ancestor. But, when
+processor, invoke another processor. This creates a processor that is
+configured to function the same as its ancestor. But, when
the descendant processor is configured in the future, that
configuration does not change the ancestral processor.
Often, when processors are exposed from a library (for example,
-unified itself), they should not be modified directly, as that
+unified itself), they should not be configured directly, as that
would change their behaviour for all users. Those processors are
-[**abstract**][abstract], and they should be made concrete before
+[**frozen**][freeze], and new processors should be made from them before
they are used, by invoking them.
###### Node
@@ -105,18 +128,19 @@ nodes.
The following projects process different syntax trees. They parse
text to their respective syntax tree, and they compile their syntax
trees back to text. These processors can be used as-is, or their
-parser and compilers can be mixed and matched with other plug-ins
-to allow processing between different syntaxes.
+parsers and compilers can be mixed and matched with other plug-ins
+to process between different syntaxes.
-* [**rehype**][rehype] ([**HAST**][hast]) — HTML;
-* [**remark**][remark] ([**MDAST**][mdast]) — Markdown;
-* [**retext**][retext] ([**NLCST**][nlcst]) — Natural language.
+* [**rehype**][rehype] ([**HAST**][hast]) — HTML
+* [**remark**][remark] ([**MDAST**][mdast]) — Markdown
+* [**retext**][retext] ([**NLCST**][nlcst]) — Natural language
###### File
When processing documents, metadata is often gathered about that
document. [**VFile**][vfile] is a virtual file format which stores
-data, and handles metadata for **unified** and its plug-ins.
+data, and handles metadata and messages for **unified** and its
+plug-ins.
There are several [utilities][vfile-utilities] for working with these
files.
@@ -126,107 +150,74 @@ files.
To configure a processor, invoke its [`use`][use] method, supply it a
[**plug-in**][plugin], and optionally settings.
-###### Streaming
-
-**unified** provides a streaming interface which enables it to plug
-into transformations outside of itself. An example, which reads
-markdown as input, adds a table of content, and writes it out, would
-be as follows:
-
-```js
-var unified = require('unified');
-var markdown = require('remark-parse');
-var stringify = require('remark-stringify');
-var toc = require('remark-toc');
-
-process.stdin
- .pipe(unified())
- .use(parse)
- .use(toc)
- .use(stringify)
- .pipe(process.stdout);
-```
-
-Which when given on **stdin**(4):
-
-```md
-# Alpha
-
-## Table of Content
-
-## Bravo
-```
-
-Yields, on **stdout**(4):
-
-```md
-# Alpha
-
-## Table of Content
-
-* [Bravo](#bravo)
+###### Integrations
-## Bravo
-```
+**unified** can integrate with the file-system through
+[**unified-engine**][engine]. On top of that, CLI apps can be created
+with [**unified-args**][args], Gulp plug-ins with
+[**unified-engine-gulp**][gulp], and Atom Linters with
+[**unified-engine-atom**][atom].
###### Programming interface
-Next to streaming, there’s also a programming interface, which gives
-access to processing metadata (such as lint messages), and supports
-multiple passed through files:
+The API gives access to processing metadata (such as lint messages), and
+supports multiple passed through files:
```js
var unified = require('unified');
var markdown = require('remark-parse');
-var lint = require('remark-lint');
+var styleGuide = require('remark-preset-lint-markdown-style-guide');
var remark2retext = require('remark-retext');
var english = require('retext-english');
var equality = require('retext-equality');
var remark2rehype = require('remark-rehype');
var html = require('rehype-stringify');
-var report = require('vfile-reporter');
+var reporter = require('vfile-reporter');
unified()
.use(markdown)
- .use(lint)
+ .use(styleGuide)
.use(remark2retext, unified().use(english).use(equality))
.use(remark2rehype)
.use(html)
- .process('## Hey guys', function (err, file) {
- console.err(report(err || file));
- console.log(file.toString());
+ .process('*Emphasis* and _importance_, you guys!', function (err, file) {
+ console.error(reporter(err || file));
+ console.log(String(file));
});
```
Which yields:
```txt
- 1:1-1:12 warning First heading level should be `1` first-heading-level
- 1:8-1:12 warning `guys` may be insensitive, use `people`, `persons`, `folks` instead gals-men
+ 1:16-1:28 warning Emphasis should use `*` as a marker emphasis-marker remark-lint
+ 1:34-1:38 warning `guys` may be insensitive, use `people`, `persons`, `folks` instead gals-men retext-equality
-⚠ 3 warnings
-<h2>Hey guys</h2>
+⚠ 2 warnings
+<p><em>Emphasis</em> and <em>importance</em>, you guys!</p>
```
###### Processing between syntaxes
The processors can be combined in two modes.
-**Bridge** mode transforms the syntax tree from one flavour to another.
-Then, transformations are applied on that tree. Finally, the origin
-processor continues transforming the original syntax tree.
+**Bridge** mode transforms the syntax tree from one flavour (the origin)
+to another (the destination). Then, transformations are applied on that
+tree. Finally, the origin processor continues transforming the original
+syntax tree.
-**Mutate** mode transforms the syntax tree from one flavour to another.
-Then, the origin processor continues transforming the destination syntax
-tree.
+**Mutate** mode also transforms the syntax tree from one flavour to
+another. But then the origin processor continues transforming the
+destination syntax tree.
In the previous example (“Programming interface”), `remark-retext` is
used in bridge mode: the origin syntax tree is kept after retext is
finished; whereas `remark-rehype` is used in mutate mode: it sets a
new syntax tree and discards the original.
-* [**remark-retext**][remark-retext].
-* [**remark-rehype**][remark-rehype].
+* [**remark-retext**][remark-retext]
+* [**remark-rehype**][remark-rehype]
+* [**rehype-retext**][rehype-retext]
+* [**rehype-remark**][rehype-remark]
## API
@@ -236,7 +227,7 @@ Object describing how to process text.
###### Returns
-`Function` — A new [**concrete**][abstract] processor which is
+`Function` — A new [**unfrozen**][freeze] processor which is
configured to function the same as its ancestor. But, when the
descendant processor is configured in the future, that configuration
does not change the ancestral processor.
@@ -248,8 +239,11 @@ the remark processor) and linked to **stdin**(4) and **stdout**(4).
```js
var remark = require('remark');
+var concat = require('concat-stream');
-process.stdin.pipe(remark()).pipe(process.stdout);
+process.stdin.pipe(concat(function (buf) {
+ process.stdout.write(remark().processSync(buf).toString());
+}));
```
### `processor.use(plugin[, options])`
@@ -259,189 +253,185 @@ that plug-in with optional options.
###### Signatures
-* `processor.use(plugin[, options])`;
-* `processor.use(plugins[, options])`;
-* `processor.use(list)`;
-* `processor.use(matrix)`.
+* `processor.use(plugin[, options])`
+* `processor.use(preset)`
+* `processor.use(list)`
###### Parameters
-* `plugin` ([`Plugin`][plugin]);
-* `options` (`*`, optional) — Configuration for `plugin`.
-* `plugins` (`Array.<Function>`) — List of plugins;
-* `list` (`Array`) — `plugin` and `options` in an array;
-* `matrix` (`Array`) — array where each entry is a `list`;
+* `plugin` ([`Plugin`][plugin])
+* `options` (`*`, optional) — Configuration for `plugin`
+* `preset` (`Object`) — Object with an optional `plugins` (set to `list`),
+ and/or an optional `settings` object
+* `list` (`Array`) — plugins, presets, and arguments (a plugin and options
+ in an array), in an array
###### Returns
`processor` — The processor on which `use` is invoked.
-#### `Plugin`
+###### Note
-A **unified** plugin changes the way the applied-on processor works,
-in the following ways:
+`use` cannot be called on [frozen][freeze] processors. Invoke the processor
+first to create a new unfrozen processor.
-* It modifies the [**processor**][processor]: such as changing the
- parser, the compiler, or linking the processor to other processors;
-* It transforms the [**syntax tree**][node] representation of a file;
-* It modifies metadata of a file.
+###### Example
-Plug-in’s are a concept which materialise as [**attacher**][attacher]s.
+There are many ways to pass plugins to `.use()`. The below example
+gives an overview.
-#### `function attacher(processor[, options])`
+```js
+var unified = require('unified');
-An attacher is the thing passed to [`use`][use]. It configures the
-processor and in turn can receive options.
+unified()
+ // Plugin with options:
+ .use(plugin, {})
+ // Plugins:
+ .use([plugin, pluginB])
+ // Two plugins, the second with options:
+ .use([plugin, [pluginB, {}]])
+ // Preset with plugins and settings:
+ .use({plugins: [plugin, [pluginB, {}]], settings: {position: false}})
+ // Settings only:
+ .use({settings: {position: false}});
+
+function plugin() {}
+function pluginB() {}
+```
-Attachers can configure processors, such as by interacting with parsers
-and compilers, linking it to other processors, or specifying how the
-syntax tree is handled.
+### `processor.parse(file|value)`
+
+Parse text to a syntax tree.
###### Parameters
-* `processor` ([`processor`][processor]) — Context on which it’s used;
-* `options` (`*`, optional) — Configuration.
+* `file` ([**VFile**][file])
+ — Or anything which can be given to `vfile()`
###### Returns
-[`transformer`][transformer] — Optional.
+[**Node**][node] — Syntax tree representation of input.
-#### `function transformer(node, file[, next])`
+###### Note
-Transformers modify the syntax tree or metadata of a file.
-A transformer is a function which is invoked each time a file is
-passed through the transform phase. If an error occurs (either
-because it’s thrown, returned, rejected, or passed to [`next`][next]),
-the process stops.
+`parse` [freezes][freeze] the processor, if not already frozen.
-The transformation process in **unified** is handled by [`trough`][trough],
-see it’s documentation for the exact semantics of transformers.
-
-###### Parameters
+#### `processor.Parser`
-* `node` ([**Node**][node]);
-* `file` ([**VFile**][file]);
-* `next` ([`Function`][next], optional).
+Function handling the parsing of text to a syntax tree. Used in the
+[**parse**][parse] phase in the process and invoked with a `string`
+and [**VFile**][file] representation of the document to parse.
-###### Returns
+If `Parser` is a normal parser, it should return a [`Node`][node]: the syntax
+tree representation of the given file.
-* `Error` — Can be returned to stop the process;
-* [**Node**][node] — Can be returned and results in further
- transformations and `stringify`s to be performed on the new
- tree;
-* `Promise` — If a promise is returned, the function is asynchronous,
- and **must** be resolved (optionally with a [**Node**][node]) or
- rejected (optionally with an `Error`).
+`Parser` can also be a constructor function, in which case it’s invoked with
+`new`. In that case, instances should have a `parse` method, which is invoked
+(without arguments), and should return a [`Node`][node].
-##### `function next(err[, tree[, file]])`
+### `processor.stringify(node[, file])`
-If the signature of a transformer includes `next` (third argument),
-the function **may** finish asynchronous, and **must** invoke `next()`.
+Compile a syntax tree to text.
###### Parameters
-* `err` (`Error`, optional) — Stop the process;
-* `node` ([**Node**][node], optional) — New syntax tree;
-* `file` ([**VFile**][file], optional) — New virtual file.
-
-### `processor.parse(file|value[, options])`
+* `node` ([**Node**][node])
+* `file` ([**VFile**][file], optional);
+ — Or anything which can be given to `vfile()`
-Parse text to a syntax tree.
+###### Returns
-###### Parameters
+`string` — String representation of the syntax tree file.
-* `file` ([**VFile**][file]);
-* `value` (`string`) — String representation of a file.
-* `options` (`Object`, optional) — Configuration given to the parser.
+###### Note
-###### Returns
+`stringify` [freezes][freeze] the processor, if not already frozen.
-[**Node**][node] — Syntax tree representation of input.
+#### `processor.Compiler`
-#### `processor.Parser`
+Function handling the compilation of syntax tree to a text. Used in the
+[**stringify**][stringify] phase in the process and invoked with a
+[`Node`][node] and [**VFile**][file] representation of the document to
+stringify.
-A constructor handling the parsing of text to a syntax tree.
-It’s instantiated by the [**parse**][parse] phase in the process
-with a [**VFile**][file], `settings`, and the processor.
+If `Compiler` is a normal stringifier, it should return a `string`: the text
+representation of the given syntax tree.
-The instance must expose a `parse` method which is invoked without
-arguments, and must return a syntax tree representation of the
-[**VFile**][file].
+`Compiler` can also be a constructor function, in which case it’s invoked with
+`new`. In that case, instances should have a `compile` method, which is invoked
+(without arguments), and should return a `string`.
-### `processor.stringify(node[, file|value][, options])`
+### `processor.run(node[, file][, done])`
-Compile a syntax tree to text.
+Transform a syntax tree by applying [**plug-in**][plugin]s to it.
###### Parameters
-* `node` ([**Node**][node]);
-* `file` ([**VFile**][file], optional);
-* `value` (`string`, optional) — String representation of a file;
-* `options` (`Object`, optional) — Configuration given to the parser.
+* `node` ([**Node**][node])
+* `file` ([**VFile**][file], optional)
+ — Or anything which can be given to `vfile()`
+* `done` ([`Function`][run-done], optional)
###### Returns
-`string` — String representation of the syntax tree file.
+[**Promise**][promise], if `done` is not given. Rejected with an error,
+or resolved with the resulting syntax tree.
-#### `processor.Compiler`
+###### Note
-A constructor handling the compilation of a syntax tree to text.
-It’s instantiated by the [**stringify**][stringify] phase in the
-process with a [**VFile**][file], `settings`, and the processor.
+`run` [freezes][freeze] the processor, if not already frozen.
-The instance must expose a `compile` method which is invoked with
-the syntax tree, and must return a string representation of that
-syntax tree.
+##### `function done(err[, node, file])`
-### `processor.run(node[, file|value][, done])`
+Invoked when transformation is complete. Either invoked with an
+error, or a syntax tree and a file.
+
+###### Parameters
+
+* `err` (`Error`) — Fatal error
+* `node` ([**Node**][node])
+* `file` ([**VFile**][file])
+
+### `processor.runSync(node[, file])`
Transform a syntax tree by applying [**plug-in**][plugin]s to it.
-If asynchronous [**plug-in**][plugin]s are configured, an error
-is thrown if [`done`][run-done] is not supplied.
+If asynchronous [**plug-in**][plugin]s are configured, an error is thrown.
###### Parameters
-* `node` ([**Node**][node]);
-* `file` ([**VFile**][file], optional);
-* `value` (`string`, optional) — String representation of a file.
-* `done` ([`Function`][run-done], optional).
+* `node` ([**Node**][node])
+* `file` ([**VFile**][file], optional)
+ — Or anything which can be given to `vfile()`
###### Returns
[**Node**][node] — The given syntax tree.
-##### `function done(err[, node, file])`
-
-Invoked when transformation is complete. Either invoked with an
-error, or a syntax tree and a file.
+###### Note
-###### Parameters
-
-* `err` (`Error`) — Fatal error;
-* `node` ([**Node**][node]);
-* `file` ([**VFile**][file]).
+`runSync` [freezes][freeze] the processor, if not already frozen.
-### `processor.process(file|value[, options][, done])`
+### `processor.process(file|value[, done])`
Process the given representation of a file as configured on the
processor. The process invokes `parse`, `run`, and `stringify`
internally.
-If asynchronous [**plug-in**][plugin]s are configured, an error
-is thrown if [`done`][process-done] is not supplied.
-
###### Parameters
-* `file` ([**VFile**][file]);
-* `value` (`string`) — String representation of a file;
-* `options` (`Object`, optional) — Configuration for both the parser
- and compiler;
-* `done` ([`Function`][process-done], optional).
+* `file` ([**VFile**][file])
+* `value` (`string`) — String representation of a file
+* `done` ([`Function`][process-done], optional)
###### Returns
-[**VFile**][file] — Virtual file with modified [`contents`][vfile-contents].
+[**Promise**][promise], if `done` is not given. Rejected with an error,
+or resolved with the resulting file.
+
+###### Note
+
+`process` [freezes][freeze] the processor, if not already frozen.
#### `function done(err, file)`
@@ -450,71 +440,105 @@ any, and the [**VFile**][file].
###### Parameters
-* `err` (`Error`, optional) — Fatal error;
-* `file` ([**VFile**][file]).
+* `err` (`Error`, optional) — Fatal error
+* `file` ([**VFile**][file])
-### `processor.write(chunk[, encoding][, callback])`
-
-> **Note**: Although the interface is compatible with streams,
-> all data is currently buffered and passed through in one go.
-> This might be changed later.
+###### Example
-Write data to the in-memory buffer.
+```js
+var unified = require('unified');
+var markdown = require('remark-parse');
+var remark2rehype = require('remark-rehype');
+var doc = require('rehype-document');
+var format = require('rehype-format');
+var html = require('rehype-stringify');
+var reporter = require('vfile-reporter');
-###### Parameters
+unified()
+ .use(markdown)
+ .use(remark2rehype)
+ .use(doc)
+ .use(format)
+ .use(html)
+ .process('# Hello world!')
+ .then(function (file) {
+ console.log(String(file));
+ }, function (err) {
+ console.error(String(err));
+ });
+```
-* `chunk` ([`Buffer`][buffer] or `string`);
-* `encoding` (`string`, defaults to `utf8`);
-* `callback` (`Function`) — Invoked on successful write.
+Yields:
-###### Returns
+```html
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ </head>
+ <body>
+ <h1>Hello world!</h1>
+ </body>
+</html>
+```
-`boolean` — Whether the write was successful (currently, always true).
+### `processor.processSync(file|value)`
-### `processor.end()`
+Process the given representation of a file as configured on the
+processor. The process invokes `parse`, `run`, and `stringify`
+internally.
-Signal the writing is complete. Passes all arguments to a final
-[`write`][write], and starts the process (using, when available,
-options given to [`pipe`][pipe]).
+If asynchronous [**plug-in**][plugin]s are configured, an error is thrown.
-###### Events
+###### Parameters
-* `data` (`string`)
- — When the process was successful, triggered with the compiled
- file;
-* `error` (`Error`)
- — When the process was unsuccessful, triggered with the fatal
- error;
-* `warning` ([`VFileMessage`][vfilemessage])
- — Each message created by the plug-ins in the process is triggered
- and separately passed.
+* `file` ([**VFile**][file])
+* `value` (`string`) — String representation of a file
###### Returns
-`boolean` — Whether the write was successful (currently, always true).
+[**VFile**][file] — Virtual file with modified [`contents`][vfile-contents].
-### `processor.pipe(stream[, options])`
+###### Note
-> **Note**: This does not pass all processed data (e.g., from loose
-> `process()` calls) to the destination stream. There’s one process
-> created internally especially for streams. Only data piped into
-> the processor is piped out.
+`processSync` [freezes][freeze] the processor, if not already frozen.
-Pipe data streamed into the processor, processed, to the destination
-stream. Optionally also set the configuration for how the data
-is processed. Calls [`Stream#pipe`][stream-pipe]
-with the given arguments under the hood.
+###### Example
-###### Parameters
+```js
+var unified = require('unified');
+var markdown = require('remark-parse');
+var remark2rehype = require('remark-rehype');
+var doc = require('rehype-document');
+var format = require('rehype-format');
+var html = require('rehype-stringify');
+var reporter = require('vfile-reporter');
-* `stream` ([`WritableStream`][writable-stream]);
+var processor = unified()
+ .use(markdown)
+ .use(remark2rehype)
+ .use(doc)
+ .use(format)
+ .use(html);
-* `options` (`Object`, optional) — Configuration for process and
- `stream.pipe`.
+console.log(processor.processSync('# Hello world!').toString());
+```
-###### Returns
+Yields:
-[`WritableStream`][writable-stream] — The given stream.
+```html
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ </head>
+ <body>
+ <h1>Hello world!</h1>
+ </body>
+</html>
+```
### `processor.data(key[, value])`
@@ -525,13 +549,18 @@ needed when parsing, transforming, and compiling HTML.
###### Parameters
-* `key` (`string`) — Identifier;
-* `value` (`*`, optional) — Value to set. Omit if getting `key`.
+* `key` (`string`) — Identifier
+* `value` (`*`, optional) — Value to set. Omit if getting `key`
###### Returns
-* `processor` — If setting, the processor on which `data` is invoked;
-* `*` — If getting, the value at `key`.
+* `processor` — If setting, the processor on which `data` is invoked
+* `*` — If getting, the value at `key`
+
+###### Note
+
+Setting information with `data` cannot occur on [frozen][freeze] processors.
+Invoke the processor first to create a new unfrozen processor.
###### Example
@@ -549,19 +578,21 @@ Yields:
bravo
```
-### `processor.abstract()`
+### `processor.freeze()`
-Turn a processor into an abstract processor. Abstract processors
-are meant to be extended, and not to be configured or processed
-directly (as concrete processors are).
+Freeze a processor. Frozen processors are meant to be extended, and not to
+be configured or processed directly.
-Once a processor is abstract, it cannot be made concrete again.
-But, a new concrete processor functioning just like it can be
-created by invoking the processor.
+Once a processor is frozen, it cannot be unfrozen. But, a new processor
+functioning just like it can be created by invoking the processor.
+
+It’s possible to freeze processors explicitly, by calling `.freeze()`, but
+[`.parse()`][parse], [`.run()`][run], [`.stringify()`][stringify], and
+[`.process()`][process] call `.freeze()` to freeze a processor too.
###### Returns
-`Processor` — The processor on which `abstract` is invoked.
+`Processor` — The processor on which `freeze` is invoked.
###### Example
@@ -573,44 +604,216 @@ var unified = require('unified');
var parse = require('rehype-parse');
var stringify = require('rehype-stringify');
-module.exports = unified().use(parse).use(stringify).abstract();
+module.exports = unified().use(parse).use(stringify).freeze();
```
-The below example, `a.js`, shows how that processor can be used to
-create a command line interface which reformats markdown passed on
-**stdin**(4) and outputs it on **stdout**(4).
+The below example, `a.js`, shows how that processor can be used and
+configured.
```js
var rehype = require('rehype');
+var format = require('rehype-format');
+// ...
-process.stdin.pipe(rehype()).pipe(process.stdout);
+rehype()
+ .use(format)
+ // ...
```
The below example, `b.js`, shows a similar looking example which
-operates on the abstract [**rehype**][rehype] interface. If this
+operates on the frozen [**rehype**][rehype] interface. If this
behaviour was allowed it would result in unexpected behaviour, so
an error is thrown. **This is invalid**:
```js
var rehype = require('rehype');
+var format = require('rehype-format');
+// ...
-process.stdin.pipe(rehype).pipe(process.stdout);
+rehype
+ .use(format)
+ // ...
```
Yields:
```txt
-~/index.js:118
- throw new Error(
- ^
-
-Error: Cannot pipe into abstract processor.
-To make the processor concrete, invoke it: use `processor()` instead of `processor`.
- at assertConcrete (~/index.js:118:13)
- at Function.<anonymous> (~/index.js:135:7)
- ...
- at Object.<anonymous> (~/b.js:76:15)
- ...
+~/node_modules/unified/index.js:440
+ throw new Error(
+ ^
+
+Error: Cannot invoke `use` on a frozen processor.
+Create a new processor first, by invoking it: use `processor()` instead of `processor`.
+ at assertUnfrozen (~/node_modules/unified/index.js:440:11)
+ at Function.use (~/node_modules/unified/index.js:172:5)
+ at Object.<anonymous> (~/b.js:6:4)
+```
+
+## `Plugin`
+
+A **unified** plugin changes the way the applied-on processor works,
+in the following ways:
+
+* It modifies the [**processor**][processor]: such as changing the
+ parser, the compiler, or linking the processor to other processors
+* It transforms the [**syntax tree**][node] representation of a file
+* It modifies metadata of a file
+
+Plug-in’s are a concept which materialise as [**attacher**][attacher]s.
+
+###### Example
+
+`move.js`:
+
+```js
+module.exports = move;
+
+function move(options) {
+ var expected = (options || {}).extname;
+
+ if (!expected) {
+ throw new Error('Missing `extname` in options');
+ }
+
+ return transformer;
+
+ function transformer(tree, file) {
+ if (file.extname && file.extname !== expected) {
+ file.extname = expected;
+ }
+ }
+}
+```
+
+`index.js`:
+
+```js
+var unified = require('unified');
+var parse = require('remark-parse');
+var remark2rehype = require('remark-rehype');
+var stringify = require('rehype-stringify');
+var vfile = require('to-vfile');
+var reporter = require('vfile-reporter');
+var move = require('./move');
+
+unified()
+ .use(parse)
+ .use(remark2rehype)
+ .use(move, {extname: '.html'})
+ .use(stringify)
+ .process(vfile.readSync('index.md'), function (err, file) {
+ console.error(reporter(err || file));
+ if (file) {
+ vfile.writeSync(file); // Written to `index.html`.
+ }
+ });
+```
+
+### `function attacher([options])`
+
+An attacher is the thing passed to [`use`][use]. It configures the
+processor and in turn can receive options.
+
+Attachers can configure processors, such as by interacting with parsers
+and compilers, linking them to other processors, or by specifying how
+the syntax tree is handled.
+
+###### Context
+
+The context object is set to the invoked on [`processor`][processor].
+
+###### Parameters
+
+* `options` (`*`, optional) — Configuration
+
+###### Returns
+
+[`transformer`][transformer] — Optional.
+
+###### Note
+
+Attachers are invoked when the processor is [frozen][freeze]: either when
+`.freeze()` is called explicitly, or when [`.parse()`][parse], [`.run()`][run],
+[`.stringify()`][stringify], or [`.process()`][process] is called for the first
+time.
+
+### `function transformer(node, file[, next])`
+
+Transformers modify the syntax tree or metadata of a file.
+A transformer is a function which is invoked each time a file is
+passed through the transform phase. If an error occurs (either
+because it’s thrown, returned, rejected, or passed to [`next`][next]),
+the process stops.
+
+The transformation process in **unified** is handled by [`trough`][trough],
+see it’s documentation for the exact semantics of transformers.
+
+###### Parameters
+
+* `node` ([**Node**][node])
+* `file` ([**VFile**][file])
+* `next` ([`Function`][next], optional)
+
+###### Returns
+
+* `Error` — Can be returned to stop the process
+* [**Node**][node] — Can be returned and results in further
+ transformations and `stringify`s to be performed on the new
+ tree
+* `Promise` — If a promise is returned, the function is asynchronous,
+ and **must** be resolved (optionally with a [**Node**][node]) or
+ rejected (optionally with an `Error`)
+
+#### `function next(err[, tree[, file]])`
+
+If the signature of a transformer includes `next` (third argument),
+the function **may** finish asynchronous, and **must** invoke `next()`.
+
+###### Parameters
+
+* `err` (`Error`, optional) — Stop the process
+* `node` ([**Node**][node], optional) — New syntax tree
+* `file` ([**VFile**][file], optional) — New virtual file
+
+## `Preset`
+
+A **unified** preset provides a potentially sharable way to configure
+processors. They can contain multiple plugins and optionally settings as
+well.
+
+###### Example
+
+`preset.js`:
+
+```js
+exports.settings = {bullet: '*', fences: true};
+
+exports.plugins = [
+ require('remark-preset-lint-recommended'),
+ require('remark-comment-config'),
+ require('remark-preset-lint-markdown-style-guide'),
+ [require('remark-toc'), {maxDepth: 3, tight: true}],
+ require('remark-github')
+];
+```
+
+`index.js`:
+
+```js
+var remark = require('remark');
+var vfile = require('to-vfile');
+var reporter = require('vfile-reporter');
+var preset = require('./preset');
+
+remark()
+ .use(preset)
+ .process(vfile.readSync('index.md'), function (err, file) {
+ console.error(reporter(err || file));
+
+ if (file) {
+ vfile.writeSync(file);
+ }
+ });
```
## License
@@ -619,55 +822,63 @@ To make the processor concrete, invoke it: use `processor()` instead of `process
<!-- Definitions -->
-[travis-badge]: https://img.shields.io/travis/wooorm/unified.svg
+[logo]: https://cdn.rawgit.com/unifiedjs/unified/84f55c8/logo.svg
-[travis]: https://travis-ci.org/wooorm/unified
+[travis-badge]: https://img.shields.io/travis/unifiedjs/unified.svg
-[codecov-badge]: https://img.shields.io/codecov/c/github/wooorm/unified.svg
+[travis]: https://travis-ci.org/unifiedjs/unified
-[codecov]: https://codecov.io/github/wooorm/unified
+[codecov-badge]: https://img.shields.io/codecov/c/github/unifiedjs/unified.svg
-[npm-install]: https://docs.npmjs.com/cli/install
+[codecov]: https://codecov.io/github/unifiedjs/unified
-[releases]: https://github.com/wooorm/unified/releases
+[npm]: https://docs.npmjs.com/cli/install
[license]: LICENSE
[author]: http://wooorm.com
+[site]: https://unifiedjs.github.io
+
+[guides]: https://unifiedjs.github.io/#guides
+
[rehype]: https://github.com/wooorm/rehype
[remark]: https://github.com/wooorm/remark
[retext]: https://github.com/wooorm/retext
-[hast]: https://github.com/wooorm/hast
+[hast]: https://github.com/syntax-tree/hast
-[mdast]: https://github.com/wooorm/mdast
+[mdast]: https://github.com/syntax-tree/mdast
-[nlcst]: https://github.com/wooorm/nlcst
+[nlcst]: https://github.com/syntax-tree/nlcst
-[unist]: https://github.com/wooorm/unist
+[unist]: https://github.com/syntax-tree/unist
-[remark-rehype]: https://github.com/wooorm/remark-rehype
+[engine]: https://github.com/unifiedjs/unified-engine
-[remark-retext]: https://github.com/wooorm/remark-retext
+[args]: https://github.com/unifiedjs/unified-args
+
+[gulp]: https://github.com/unifiedjs/unified-engine-gulp
-[unist-utilities]: https://github.com/wooorm/unist#list-of-utilities
+[atom]: https://github.com/unifiedjs/unified-engine-atom
-[vfile]: https://github.com/wooorm/vfile
+[remark-rehype]: https://github.com/wooorm/remark-rehype
+
+[remark-retext]: https://github.com/wooorm/remark-retext
-[vfile-contents]: https://github.com/wooorm/vfile#vfilecontents
+[rehype-retext]: https://github.com/wooorm/rehype-retext
-[vfile-utilities]: https://github.com/wooorm/vfile#related-tools
+[rehype-remark]: https://github.com/wooorm/rehype-remark
-[vfilemessage]: https://github.com/wooorm/vfile#vfilemessage
+[unist-utilities]: https://github.com/syntax-tree/unist#list-of-utilities
-[writable-stream]: https://nodejs.org/api/stream.html#stream_class_stream_writable_1
+[vfile]: https://github.com/vfile/vfile
-[stream-pipe]: https://nodejs.org/api/stream.html#stream_readable_pipe_destination_options
+[vfile-contents]: https://github.com/vfile/vfile#vfilecontents
-[buffer]: https://nodejs.org/api/buffer.html#buffer_buffer
+[vfile-utilities]: https://github.com/vfile/vfile#related-tools
[file]: #file
@@ -675,25 +886,27 @@ To make the processor concrete, invoke it: use `processor()` instead of `process
[processor]: #processor
-[process]: #processorprocessfilevalue-options-done
+[process]: #processorprocessfilevalue-done
-[parse]: #processorparsefilevalue-options
+[parse]: #processorparsefilevalue
[parser]: #processorparser
-[stringify]: #processorstringifynode-filevalue-options
+[stringify]: #processorstringifynode-file
+
+[run]: #processorrunnode-file-done
[compiler]: #processorcompiler
[use]: #processoruseplugin-options
-[attacher]: #function-attacherprocessor-options
+[attacher]: #function-attacheroptions
[transformer]: #function-transformernode-file-next
[next]: #function-nexterr-tree-file
-[abstract]: #processorabstract
+[freeze]: #processorfreeze
[plugin]: #plugin
@@ -701,8 +914,6 @@ To make the processor concrete, invoke it: use `processor()` instead of `process
[process-done]: #function-doneerr-file
-[write]: #processorwritechunk-encoding-callback
-
-[pipe]: #processorpipestream-options
-
[trough]: https://github.com/wooorm/trough#function-fninput-next
+
+[promise]: https://developer.mozilla.org/Web/JavaScript/Reference/Global_Objects/Promise
diff --git a/tools/eslint/node_modules/unist-util-stringify-position/LICENSE b/tools/eslint/node_modules/unist-util-stringify-position/LICENSE
new file mode 100644
index 0000000000..8d8660d36e
--- /dev/null
+++ b/tools/eslint/node_modules/unist-util-stringify-position/LICENSE
@@ -0,0 +1,22 @@
+(The MIT License)
+
+Copyright (c) 2016 Titus Wormer <tituswormer@gmail.com>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/tools/eslint/node_modules/unist-util-stringify-position/index.js b/tools/eslint/node_modules/unist-util-stringify-position/index.js
new file mode 100644
index 0000000000..bf8ac832b0
--- /dev/null
+++ b/tools/eslint/node_modules/unist-util-stringify-position/index.js
@@ -0,0 +1,50 @@
+'use strict';
+
+var own = {}.hasOwnProperty;
+
+module.exports = stringify;
+
+function stringify(value) {
+ /* Nothing. */
+ if (!value || typeof value !== 'object') {
+ return null;
+ }
+
+ /* Node. */
+ if (own.call(value, 'position') || own.call(value, 'type')) {
+ return location(value.position);
+ }
+
+ /* Location. */
+ if (own.call(value, 'start') || own.call(value, 'end')) {
+ return location(value);
+ }
+
+ /* Position. */
+ if (own.call(value, 'line') || own.call(value, 'column')) {
+ return position(value);
+ }
+
+ /* ? */
+ return null;
+}
+
+function position(pos) {
+ if (!pos || typeof pos !== 'object') {
+ pos = {};
+ }
+
+ return index(pos.line) + ':' + index(pos.column);
+}
+
+function location(loc) {
+ if (!loc || typeof loc !== 'object') {
+ loc = {};
+ }
+
+ return position(loc.start) + '-' + position(loc.end);
+}
+
+function index(value) {
+ return value && typeof value === 'number' ? value : 1;
+}
diff --git a/tools/eslint/node_modules/unist-util-stringify-position/package.json b/tools/eslint/node_modules/unist-util-stringify-position/package.json
new file mode 100644
index 0000000000..01eadc6acc
--- /dev/null
+++ b/tools/eslint/node_modules/unist-util-stringify-position/package.json
@@ -0,0 +1,102 @@
+{
+ "_from": "unist-util-stringify-position@^1.0.0",
+ "_id": "unist-util-stringify-position@1.1.1",
+ "_inBundle": false,
+ "_integrity": "sha1-PMvcU2ee7W7PN3fdf14yKcG2qjw=",
+ "_location": "/unist-util-stringify-position",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "unist-util-stringify-position@^1.0.0",
+ "name": "unist-util-stringify-position",
+ "escapedName": "unist-util-stringify-position",
+ "rawSpec": "^1.0.0",
+ "saveSpec": null,
+ "fetchSpec": "^1.0.0"
+ },
+ "_requiredBy": [
+ "/eslint-plugin-markdown/vfile"
+ ],
+ "_resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-1.1.1.tgz",
+ "_shasum": "3ccbdc53679eed6ecf3777dd7f5e3229c1b6aa3c",
+ "_spec": "unist-util-stringify-position@^1.0.0",
+ "_where": "j:\\temp\\_git\\node-fork\\tools\\eslint\\node_modules\\eslint-plugin-markdown\\node_modules\\vfile",
+ "author": {
+ "name": "Titus Wormer",
+ "email": "tituswormer@gmail.com",
+ "url": "http://wooorm.com"
+ },
+ "bugs": {
+ "url": "https://github.com/syntax-tree/unist-util-stringify-position/issues"
+ },
+ "bundleDependencies": false,
+ "contributors": [
+ {
+ "name": "Titus Wormer",
+ "email": "tituswormer@gmail.com",
+ "url": "http://wooorm.com"
+ }
+ ],
+ "dependencies": {},
+ "deprecated": false,
+ "description": "Stringify a Unist node, location, or position",
+ "devDependencies": {
+ "browserify": "^14.1.0",
+ "esmangle": "^1.0.0",
+ "nyc": "^10.0.0",
+ "remark-cli": "^3.0.0",
+ "remark-preset-wooorm": "^3.0.0",
+ "tape": "^4.5.1",
+ "xo": "^0.18.1"
+ },
+ "files": [
+ "index.js"
+ ],
+ "homepage": "https://github.com/syntax-tree/unist-util-stringify-position#readme",
+ "keywords": [
+ "unist",
+ "position",
+ "location",
+ "node",
+ "stringify",
+ "tostring",
+ "util",
+ "utility"
+ ],
+ "license": "MIT",
+ "name": "unist-util-stringify-position",
+ "nyc": {
+ "check-coverage": true,
+ "lines": 100,
+ "functions": 100,
+ "branches": 100
+ },
+ "remarkConfig": {
+ "plugins": [
+ "preset-wooorm"
+ ]
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/syntax-tree/unist-util-stringify-position.git"
+ },
+ "scripts": {
+ "build": "npm run build-md && npm run build-bundle && npm run build-mangle",
+ "build-bundle": "browserify index.js --no-builtins -s unistUtilStringifyPosition > unist-util-stringify-position.js",
+ "build-mangle": "esmangle unist-util-stringify-position.js > unist-util-stringify-position.min.js",
+ "build-md": "remark . --quiet --frail --output",
+ "lint": "xo",
+ "test": "npm run build && npm run lint && npm run test-coverage",
+ "test-api": "node test",
+ "test-coverage": "nyc --reporter lcov tape test.js"
+ },
+ "version": "1.1.1",
+ "xo": {
+ "space": true,
+ "esnext": false,
+ "ignores": [
+ "unist-util-stringify-position.js"
+ ]
+ }
+}
diff --git a/tools/eslint/node_modules/unist-util-stringify-position/readme.md b/tools/eslint/node_modules/unist-util-stringify-position/readme.md
new file mode 100644
index 0000000000..36155a47de
--- /dev/null
+++ b/tools/eslint/node_modules/unist-util-stringify-position/readme.md
@@ -0,0 +1,85 @@
+# unist-util-stringify-position [![Build Status][build-badge]][build-page] [![Coverage Status][coverage-badge]][coverage-page]
+
+Stringify a [**Unist**][unist] [position][] or [location][].
+
+## Installation
+
+[npm][]:
+
+```bash
+npm install unist-util-stringify-position
+```
+
+## Usage
+
+```javascript
+var stringify = require('unist-util-stringify-position');
+
+stringify({line: 2, column: 3 }); //=> '2:3'
+
+stringify({
+ start: {line: 2},
+ end: {line: 3}
+}); //=> '2:1-3:1'
+
+stringify({
+ type: 'text',
+ value: '!',
+ position: {
+ start: {line: 5, column: 11},
+ end: {line: 5, column: 12}
+ }
+}); //=> '5:11-5:12'
+```
+
+## API
+
+### `stringifyPosition(node|location|position)`
+
+Stringify one position, a location (start and end positions), or
+a node’s location.
+
+###### Parameters
+
+* `node` ([`Node`][node])
+ — Node whose `'position'` property to stringify
+* `location` ([`Location`][location])
+ — Location whose `'start'` and `'end'` positions to stringify
+* `position` ([`Position`][position])
+ — Location whose `'line'` and `'column'` to stringify
+
+###### Returns
+
+`string?` — A range `ls:cs-le:ce` (when given `node` or
+`location`) or a point `l:c` (when given `position`), where `l` stands
+for line, `c` for column, `s` for `start`, and `e` for
+end. `null` is returned if the given value is neither `node`,
+`location`, nor `position`.
+
+## License
+
+[MIT][license] © [Titus Wormer][author]
+
+<!-- Definition -->
+
+[build-badge]: https://img.shields.io/travis/syntax-tree/unist-util-stringify-position.svg
+
+[build-page]: https://travis-ci.org/syntax-tree/unist-util-stringify-position
+
+[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/unist-util-stringify-position.svg
+
+[coverage-page]: https://codecov.io/github/syntax-tree/unist-util-stringify-position?branch=master
+
+[npm]: https://docs.npmjs.com/cli/install
+
+[license]: LICENSE
+
+[author]: http://wooorm.com
+
+[unist]: https://github.com/syntax-tree/unist
+
+[node]: https://github.com/syntax-tree/unist#node
+
+[location]: https://github.com/syntax-tree/unist#location
+
+[position]: https://github.com/syntax-tree/unist#position
diff --git a/tools/eslint/node_modules/vfile/history.md b/tools/eslint/node_modules/vfile/history.md
deleted file mode 100644
index 2f6fd078b9..0000000000
--- a/tools/eslint/node_modules/vfile/history.md
+++ /dev/null
@@ -1,56 +0,0 @@
-<!--remark setext-->
-
-<!--lint disable no-multiple-toplevel-headings-->
-
-1.4.0 / 2016-04-18
-==================
-
-* Add support for passing `ruleId` to `message()` ([`77547fb`](https://github.com/wooorm/vfile/commit/77547fb))
-
-1.3.1 / 2016-01-21
-==================
-
-1.3.0 / 2016-01-21
-==================
-
-* Refactor API signatures in `readme.md` ([`d41883c`](https://github.com/wooorm/vfile/commit/d41883c))
-* Add npm deployment to Travis ([`0d236c0`](https://github.com/wooorm/vfile/commit/0d236c0))
-* Update metadata in `package.json` ([`9726eec`](https://github.com/wooorm/vfile/commit/9726eec))
-* Refactor to replace mocha with tape ([`05d29df`](https://github.com/wooorm/vfile/commit/05d29df))
-* Update dev-dependencies ([`6255dd9`](https://github.com/wooorm/vfile/commit/6255dd9))
-* Add new `basename` method ([`07b79af`](https://github.com/wooorm/vfile/commit/07b79af))
-
-1.2.0 / 2015-12-27
-==================
-
-* Update list of related tools ([`69e576f`](https://github.com/wooorm/vfile/commit/69e576f))
-* Remove distribution files from source ([`b45c780`](https://github.com/wooorm/vfile/commit/b45c780))
-* Remove support for bower ([`849c3ad`](https://github.com/wooorm/vfile/commit/849c3ad))
-* Rename mdast to remark ([`b3c8cea`](https://github.com/wooorm/vfile/commit/b3c8cea))
-
-1.1.2 / 2015-10-16
-==================
-
-* Fix missing `Error` properties on `VFileMessage` ([`c896cf9`](https://github.com/wooorm/vfile/commit/c896cf9))
-
-1.1.1 / 2015-10-14
-==================
-
-* Fix Safari 9 ([`bcb7a61`](https://github.com/wooorm/vfile/commit/bcb7a61))
-* Add `convert-vinyl-to-vfile` to related tools ([`1423652`](https://github.com/wooorm/vfile/commit/1423652))
-
-1.1.0 / 2015-08-21
-==================
-
-* Add extensive location information to messages ([`848aef7`](https://github.com/wooorm/vfile/commit/848aef7))
-* Add history tracking ([`67d0112`](https://github.com/wooorm/vfile/commit/67d0112))
-
-1.0.1 / 2015-08-17
-==================
-
-* Add list of related tools to `readme.md` ([`863df04`](https://github.com/wooorm/vfile/commit/863df04))
-* Update dependencies ([`5184aec`](https://github.com/wooorm/vfile/commit/5184aec))
-* Update documentation with difference from vinyl ([`76e1d39`](https://github.com/wooorm/vfile/commit/76e1d39))
-
-1.0.0 / 2015-07-26
-==================
diff --git a/tools/eslint/node_modules/vfile/index.js b/tools/eslint/node_modules/vfile/index.js
index 7d775cebf8..bc5b0ef853 100644
--- a/tools/eslint/node_modules/vfile/index.js
+++ b/tools/eslint/node_modules/vfile/index.js
@@ -1,628 +1,261 @@
-/**
- * @author Titus Wormer
- * @copyright 2015 Titus Wormer
- * @license MIT
- * @module vfile
- * @fileoverview Virtual file format to attach additional
- * information related to processed input. Similar to
- * `wearefractal/vinyl`. Additionally, `VFile` can be
- * passed directly to ESLint formatters to visualise
- * warnings and errors relating to a file.
- * @example
- * var VFile = require('vfile');
- *
- * var file = new VFile({
- * 'directory': '~',
- * 'filename': 'example',
- * 'extension': 'txt',
- * 'contents': 'Foo *bar* baz'
- * });
- *
- * file.toString(); // 'Foo *bar* baz'
- * file.filePath(); // '~/example.txt'
- *
- * file.move({'extension': 'md'});
- * file.filePath(); // '~/example.md'
- *
- * file.warn('Something went wrong', {'line': 2, 'column': 3});
- * // { [~/example.md:2:3: Something went wrong]
- * // name: '~/example.md:2:3',
- * // file: '~/example.md',
- * // reason: 'Something went wrong',
- * // line: 2,
- * // column: 3,
- * // fatal: false }
- */
-
'use strict';
-/* eslint-env commonjs */
-
-var proto;
-
-var SEPARATOR = '/';
-
-try {
- SEPARATOR = require('pa' + 'th').sep;
-} catch (e) { /* empty */ }
-
-/**
- * Construct a new file message.
- *
- * Note: We cannot invoke `Error` on the created context,
- * as that adds readonly `line` and `column` attributes on
- * Safari 9, thus throwing and failing the data.
- *
- * @example
- * var message = new VFileMessage('Whoops!');
- *
- * message instanceof Error // true
- *
- * @constructor
- * @class {VFileMessage}
- * @param {string} reason - Reason for messaging.
- * @property {boolean} [fatal=null] - Whether the message
- * is fatal.
- * @property {string} [name=''] - File-name and positional
- * information.
- * @property {string} [file=''] - File-path.
- * @property {string} [reason=''] - Reason for messaging.
- * @property {number} [line=null] - Start of message.
- * @property {number} [column=null] - Start of message.
- * @property {Position|Location} [location=null] - Place of
- * message.
- * @property {string} [stack] - Stack-trace of warning.
- */
-function VFileMessage(reason) {
- this.message = reason;
-}
-
-/**
- * Inherit from `Error#`.
- */
-function VFileMessagePrototype() {}
-
-VFileMessagePrototype.prototype = Error.prototype;
-
-proto = new VFileMessagePrototype();
-
-VFileMessage.prototype = proto;
-
-/*
- * Expose defaults.
- */
-
-proto.file = proto.name = proto.reason = proto.message = proto.stack = '';
-proto.fatal = proto.column = proto.line = null;
-
-/**
- * File-related message with location information.
- *
- * @typedef {Error} VFileMessage
- * @property {string} name - (Starting) location of the
- * message, preceded by its file-path when available,
- * and joined by `:`. Used internally by the native
- * `Error#toString()`.
- * @property {string} file - File-path.
- * @property {string} reason - Reason for message.
- * @property {number?} line - Line of message, when
- * available.
- * @property {number?} column - Column of message, when
- * available.
- * @property {string?} stack - Stack of message, when
- * available.
- * @property {boolean?} fatal - Whether the associated file
- * is still processable.
- */
-
-/**
- * Stringify a position.
- *
- * @example
- * stringify({'line': 1, 'column': 3}) // '1:3'
- * stringify({'line': 1}) // '1:1'
- * stringify({'column': 3}) // '1:3'
- * stringify() // '1:1'
- *
- * @private
- * @param {Object?} [position] - Single position, like
- * those available at `node.position.start`.
- * @return {string} - Compiled location.
- */
-function stringify(position) {
- if (!position) {
- position = {};
- }
-
- return (position.line || 1) + ':' + (position.column || 1);
-}
-
-/**
- * ESLint's formatter API expects `filePath` to be a
- * string. This hack supports invocation as well as
- * implicit coercion.
- *
- * @example
- * var file = new VFile({
- * 'filename': 'example',
- * 'extension': 'txt'
- * });
- *
- * filePath = filePathFactory(file);
- *
- * String(filePath); // 'example.txt'
- * filePath(); // 'example.txt'
- *
- * @private
- * @param {VFile} file - Virtual file.
- * @return {Function} - `filePath` getter.
- */
-function filePathFactory(file) {
- /**
- * Get the filename, with extension and directory, if applicable.
- *
- * @example
- * var file = new VFile({
- * 'directory': '~',
- * 'filename': 'example',
- * 'extension': 'txt'
- * });
- *
- * String(file.filePath); // ~/example.txt
- * file.filePath() // ~/example.txt
- *
- * @memberof {VFile}
- * @property {Function} toString - Itself. ESLint's
- * formatter API expects `filePath` to be `string`.
- * This hack supports invocation as well as implicit
- * coercion.
- * @return {string} - If the `vFile` has a `filename`,
- * it will be prefixed with the directory (slashed),
- * if applicable, and suffixed with the (dotted)
- * extension (if applicable). Otherwise, an empty
- * string is returned.
- */
- function filePath() {
- var directory = file.directory;
- var separator;
-
- if (file.filename || file.extension) {
- separator = directory.charAt(directory.length - 1);
-
- if (separator === '/' || separator === '\\') {
- directory = directory.slice(0, -1);
- }
-
- if (directory === '.') {
- directory = '';
- }
-
- return (directory ? directory + SEPARATOR : '') +
- file.filename +
- (file.extension ? '.' + file.extension : '');
- }
-
- return '';
- }
+var path = require('path');
+var replace = require('replace-ext');
+var stringify = require('unist-util-stringify-position');
+var buffer = require('is-buffer');
- filePath.toString = filePath;
-
- return filePath;
-}
+module.exports = VFile;
-/**
-* Get the filename with extantion.
-*
-* @example
-* var file = new VFile({
-* 'directory': '~/foo/bar'
-* 'filename': 'example',
-* 'extension': 'txt'
-* });
-*
-* file.basename() // example.txt
-*
-* @memberof {VFile}
-* @return {string} - name of file with extantion.
-*/
-function basename() {
- var self = this;
- var extension = self.extension;
-
- if (self.filename || extension) {
- return self.filename + (extension ? '.' + extension : '');
- }
+var own = {}.hasOwnProperty;
+var proto = VFile.prototype;
- return '';
-}
+proto.toString = toString;
+proto.message = message;
+proto.fail = fail;
-/**
- * Construct a new file.
- *
- * @example
- * var file = new VFile({
- * 'directory': '~',
- * 'filename': 'example',
- * 'extension': 'txt',
- * 'contents': 'Foo *bar* baz'
- * });
- *
- * file === VFile(file) // true
- * file === new VFile(file) // true
- * VFile('foo') instanceof VFile // true
- *
- * @constructor
- * @class {VFile}
- * @param {Object|VFile|string} [options] - either an
- * options object, or the value of `contents` (both
- * optional). When a `file` is passed in, it's
- * immediately returned.
- * @property {string} [contents=''] - Content of file.
- * @property {string} [directory=''] - Path to parent
- * directory.
- * @property {string} [filename=''] - Filename.
- * A file-path can still be generated when no filename
- * exists.
- * @property {string} [extension=''] - Extension.
- * A file-path can still be generated when no extension
- * exists.
- * @property {boolean?} quiet - Whether an error created by
- * `VFile#fail()` is returned (when truthy) or thrown
- * (when falsey). Ensure all `messages` associated with
- * a file are handled properly when setting this to
- * `true`.
- * @property {Array.<VFileMessage>} messages - List of associated
- * messages.
- */
+/* Slight backwards compatibility. Remove in the future. */
+proto.warn = message;
+
+/* Order of setting (least specific to most), we need this because
+ * otherwise `{stem: 'a', path: '~/b.js'}` would throw, as a path
+ * is needed before a stem can be set. */
+var order = [
+ 'history',
+ 'path',
+ 'basename',
+ 'stem',
+ 'extname',
+ 'dirname'
+];
+
+/* Construct a new file. */
function VFile(options) {
- var self = this;
-
- /*
- * No `new` operator.
- */
-
- if (!(self instanceof VFile)) {
- return new VFile(options);
- }
-
- /*
- * Given file.
- */
-
- if (
- options &&
- typeof options.message === 'function' &&
- typeof options.hasFailed === 'function'
- ) {
- return options;
+ var prop;
+ var index;
+ var length;
+
+ if (!options) {
+ options = {};
+ } else if (typeof options === 'string' || buffer(options)) {
+ options = {contents: options};
+ } else if ('message' in options && 'messages' in options) {
+ return options;
+ }
+
+ if (!(this instanceof VFile)) {
+ return new VFile(options);
+ }
+
+ this.data = {};
+ this.messages = [];
+ this.history = [];
+ this.cwd = process.cwd();
+
+ /* Set path related properties in the correct order. */
+ index = -1;
+ length = order.length;
+
+ while (++index < length) {
+ prop = order[index];
+
+ if (own.call(options, prop)) {
+ this[prop] = options[prop];
}
+ }
- if (!options) {
- options = {};
- } else if (typeof options === 'string') {
- options = {
- 'contents': options
- };
+ /* Set non-path related properties. */
+ for (prop in options) {
+ if (order.indexOf(prop) === -1) {
+ this[prop] = options[prop];
}
-
- self.contents = options.contents || '';
-
- self.messages = [];
-
- /*
- * Make sure eslint’s formatters stringify `filePath`
- * properly.
- */
-
- self.filePath = filePathFactory(self);
-
- self.history = [];
-
- self.move({
- 'filename': options.filename,
- 'directory': options.directory,
- 'extension': options.extension
- });
+ }
}
-/**
- * Get the value of the file.
- *
- * @example
- * var vFile = new VFile('Foo');
- * String(vFile); // 'Foo'
- *
- * @this {VFile}
- * @memberof {VFile}
- * @return {string} - value at the `contents` property
- * in context.
- */
-function toString() {
- return this.contents;
-}
+/* Access full path (`~/index.min.js`). */
+Object.defineProperty(proto, 'path', {
+ get: function () {
+ return this.history[this.history.length - 1];
+ },
+ set: function (path) {
+ assertNonEmpty(path, 'path');
-/**
- * Move a file by passing a new directory, filename,
- * and extension. When these are not given, the default
- * values are kept.
- *
- * @example
- * var file = new VFile({
- * 'directory': '~',
- * 'filename': 'example',
- * 'extension': 'txt',
- * 'contents': 'Foo *bar* baz'
- * });
- *
- * file.move({'directory': '/var/www'});
- * file.filePath(); // '/var/www/example.txt'
- *
- * file.move({'extension': 'md'});
- * file.filePath(); // '/var/www/example.md'
- *
- * @this {VFile}
- * @memberof {VFile}
- * @param {Object?} [options] - Configuration.
- * @return {VFile} - Context object.
- */
-function move(options) {
- var self = this;
- var before = self.filePath();
- var after;
-
- if (!options) {
- options = {};
+ if (path !== this.path) {
+ this.history.push(path);
}
-
- self.directory = options.directory || self.directory || '';
- self.filename = options.filename || self.filename || '';
- self.extension = options.extension || self.extension || '';
-
- after = self.filePath();
-
- if (after && before !== after) {
- self.history.push(after);
+ }
+});
+
+/* Access parent path (`~`). */
+Object.defineProperty(proto, 'dirname', {
+ get: function () {
+ return typeof this.path === 'string' ? path.dirname(this.path) : undefined;
+ },
+ set: function (dirname) {
+ assertPath(this.path, 'dirname');
+ this.path = path.join(dirname || '', this.basename);
+ }
+});
+
+/* Access basename (`index.min.js`). */
+Object.defineProperty(proto, 'basename', {
+ get: function () {
+ return typeof this.path === 'string' ? path.basename(this.path) : undefined;
+ },
+ set: function (basename) {
+ assertNonEmpty(basename, 'basename');
+ assertPart(basename, 'basename');
+ this.path = path.join(this.dirname || '', basename);
+ }
+});
+
+/* Access extname (`.js`). */
+Object.defineProperty(proto, 'extname', {
+ get: function () {
+ return typeof this.path === 'string' ? path.extname(this.path) : undefined;
+ },
+ set: function (extname) {
+ var ext = extname || '';
+
+ assertPart(ext, 'extname');
+ assertPath(this.path, 'extname');
+
+ if (ext) {
+ if (ext.charAt(0) !== '.') {
+ throw new Error('`extname` must start with `.`');
+ }
+
+ if (ext.indexOf('.', 1) !== -1) {
+ throw new Error('`extname` cannot contain multiple dots');
+ }
}
- return self;
+ this.path = replace(this.path, ext);
+ }
+});
+
+/* Access stem (`index.min`). */
+Object.defineProperty(proto, 'stem', {
+ get: function () {
+ return typeof this.path === 'string' ? path.basename(this.path, this.extname) : undefined;
+ },
+ set: function (stem) {
+ assertNonEmpty(stem, 'stem');
+ assertPart(stem, 'stem');
+ this.path = path.join(this.dirname || '', stem + (this.extname || ''));
+ }
+});
+
+/* Get the value of the file. */
+function toString(encoding) {
+ var value = this.contents || '';
+ return buffer(value) ? value.toString(encoding) : String(value);
}
-/**
- * Create a message with `reason` at `position`.
+/* Create a message with `reason` at `position`.
* When an error is passed in as `reason`, copies the
- * stack. This does not add a message to `messages`.
- *
- * @example
- * var file = new VFile();
- *
- * file.message('Something went wrong');
- * // { [1:1: Something went wrong]
- * // name: '1:1',
- * // file: '',
- * // reason: 'Something went wrong',
- * // line: null,
- * // column: null }
- *
- * @this {VFile}
- * @memberof {VFile}
- * @param {string|Error} reason - Reason for message.
- * @param {Node|Location|Position} [position] - Location
- * of message in file.
- * @param {string} [ruleId] - Category of warning.
- * @return {VFileMessage} - File-related message with
- * location information.
- */
+ * stack. This does not add a message to `messages`. */
function message(reason, position, ruleId) {
- var filePath = this.filePath();
- var range;
- var err;
- var location = {
- 'start': {
- 'line': null,
- 'column': null
- },
- 'end': {
- 'line': null,
- 'column': null
- }
- };
-
- /*
- * Node / location / position.
- */
-
- if (position && position.position) {
- position = position.position;
- }
-
- if (position && position.start) {
- range = stringify(position.start) + '-' + stringify(position.end);
- location = position;
- position = position.start;
+ var filePath = this.path;
+ var range = stringify(position) || '1:1';
+ var location;
+ var err;
+
+ location = {
+ start: {line: null, column: null},
+ end: {line: null, column: null}
+ };
+
+ if (position && position.position) {
+ position = position.position;
+ }
+
+ if (position) {
+ /* Location. */
+ if (position.start) {
+ location = position;
+ position = position.start;
} else {
- range = stringify(position);
-
- if (position) {
- location.start = position;
- location.end.line = null;
- location.end.column = null;
- }
+ /* Position. */
+ location.start = position;
}
+ }
- err = new VFileMessage(reason.message || reason);
+ err = new VMessage(reason.message || reason);
- err.name = (filePath ? filePath + ':' : '') + range;
- err.file = filePath;
- err.reason = reason.message || reason;
- err.line = position ? position.line : null;
- err.column = position ? position.column : null;
- err.location = location;
- err.ruleId = ruleId || null;
+ err.name = (filePath ? filePath + ':' : '') + range;
+ err.file = filePath || '';
+ err.reason = reason.message || reason;
+ err.line = position ? position.line : null;
+ err.column = position ? position.column : null;
+ err.location = location;
+ err.ruleId = ruleId || null;
+ err.source = null;
+ err.fatal = false;
- if (reason.stack) {
- err.stack = reason.stack;
- }
+ if (reason.stack) {
+ err.stack = reason.stack;
+ }
- return err;
-}
+ this.messages.push(err);
-/**
- * Warn. Creates a non-fatal message (see `VFile#message()`),
- * and adds it to the file's `messages` list.
- *
- * @example
- * var file = new VFile();
- *
- * file.warn('Something went wrong');
- * // { [1:1: Something went wrong]
- * // name: '1:1',
- * // file: '',
- * // reason: 'Something went wrong',
- * // line: null,
- * // column: null,
- * // fatal: false }
- *
- * @see VFile#message
- * @this {VFile}
- * @memberof {VFile}
- */
-function warn() {
- var err = this.message.apply(this, arguments);
+ return err;
+}
- err.fatal = false;
+/* Fail. Creates a vmessage, associates it with the file,
+ * and throws it. */
+function fail() {
+ var message = this.message.apply(this, arguments);
- this.messages.push(err);
+ message.fatal = true;
- return err;
+ throw message;
}
-/**
- * Fail. Creates a fatal message (see `VFile#message()`),
- * sets `fatal: true`, adds it to the file's
- * `messages` list.
- *
- * If `quiet` is not `true`, throws the error.
- *
- * @example
- * var file = new VFile();
- *
- * file.fail('Something went wrong');
- * // 1:1: Something went wrong
- * // at VFile.exception (vfile/index.js:296:11)
- * // at VFile.fail (vfile/index.js:360:20)
- * // at repl:1:6
- *
- * file.quiet = true;
- * file.fail('Something went wrong');
- * // { [1:1: Something went wrong]
- * // name: '1:1',
- * // file: '',
- * // reason: 'Something went wrong',
- * // line: null,
- * // column: null,
- * // fatal: true }
- *
- * @this {VFile}
- * @memberof {VFile}
- * @throws {VFileMessage} - When not `quiet: true`.
- * @param {string|Error} reason - Reason for failure.
- * @param {Node|Location|Position} [position] - Place
- * of failure in file.
- * @return {VFileMessage} - Unless thrown, of course.
- */
-function fail(reason, position) {
- var err = this.message(reason, position);
-
- err.fatal = true;
-
- this.messages.push(err);
-
- if (!this.quiet) {
- throw err;
- }
-
- return err;
-}
+/* Inherit from `Error#`. */
+function VMessagePrototype() {}
+VMessagePrototype.prototype = Error.prototype;
+VMessage.prototype = new VMessagePrototype();
-/**
- * Check if a fatal message occurred making the file no
- * longer processable.
- *
- * @example
- * var file = new VFile();
- * file.quiet = true;
- *
- * file.hasFailed(); // false
- *
- * file.fail('Something went wrong');
- * file.hasFailed(); // true
- *
- * @this {VFile}
- * @memberof {VFile}
- * @return {boolean} - `true` if at least one of file's
- * `messages` has a `fatal` property set to `true`
- */
-function hasFailed() {
- var messages = this.messages;
- var index = -1;
- var length = messages.length;
-
- while (++index < length) {
- if (messages[index].fatal) {
- return true;
- }
- }
+/* Message properties. */
+proto = VMessage.prototype;
- return false;
-}
+proto.file = '';
+proto.name = '';
+proto.reason = '';
+proto.message = '';
+proto.stack = '';
+proto.fatal = null;
+proto.column = null;
+proto.line = null;
-/**
- * Access metadata.
- *
- * @example
- * var file = new VFile('Foo');
- *
- * file.namespace('foo').bar = 'baz';
+/* Construct a new file message.
*
- * console.log(file.namespace('foo').bar) // 'baz';
- *
- * @this {VFile}
- * @memberof {VFile}
- * @param {string} key - Namespace key.
- * @return {Object} - Private space.
- */
-function namespace(key) {
- var self = this;
- var space = self.data;
-
- if (!space) {
- space = self.data = {};
- }
-
- if (!space[key]) {
- space[key] = {};
- }
-
- return space[key];
+ * Note: We cannot invoke `Error` on the created context,
+ * as that adds readonly `line` and `column` attributes on
+ * Safari 9, thus throwing and failing the data. */
+function VMessage(reason) {
+ this.message = reason;
}
-/*
- * Methods.
- */
-
-proto = VFile.prototype;
-
-proto.basename = basename;
-proto.move = move;
-proto.toString = toString;
-proto.message = message;
-proto.warn = warn;
-proto.fail = fail;
-proto.hasFailed = hasFailed;
-proto.namespace = namespace;
+/* Assert that `part` is not a path (i.e., does
+ * not contain `path.sep`). */
+function assertPart(part, name) {
+ if (part.indexOf(path.sep) !== -1) {
+ throw new Error('`' + name + '` cannot be a path: did not expect `' + path.sep + '`');
+ }
+}
-/*
- * Expose.
- */
+/* Assert that `part` is not empty. */
+function assertNonEmpty(part, name) {
+ if (!part) {
+ throw new Error('`' + name + '` cannot be empty');
+ }
+}
-module.exports = VFile;
+/* Assert `path` exists. */
+function assertPath(path, name) {
+ if (!path) {
+ throw new Error('Setting `' + name + '` requires `path` to be set too');
+ }
+}
diff --git a/tools/eslint/node_modules/vfile/package.json b/tools/eslint/node_modules/vfile/package.json
index 64820cb423..d0b6c122f7 100644
--- a/tools/eslint/node_modules/vfile/package.json
+++ b/tools/eslint/node_modules/vfile/package.json
@@ -1,95 +1,49 @@
{
- "_from": "vfile@^1.0.0",
- "_id": "vfile@1.4.0",
+ "_from": "vfile@^2.0.0",
+ "_id": "vfile@2.1.0",
"_inBundle": false,
- "_integrity": "sha1-wP1vpIT43r23cfaMMe112I2pf+c=",
+ "_integrity": "sha1-086Lgl57jVO4lhZDQSczgZNvAr0=",
"_location": "/vfile",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
- "raw": "vfile@^1.0.0",
+ "raw": "vfile@^2.0.0",
"name": "vfile",
"escapedName": "vfile",
- "rawSpec": "^1.0.0",
+ "rawSpec": "^2.0.0",
"saveSpec": null,
- "fetchSpec": "^1.0.0"
+ "fetchSpec": "^2.0.0"
},
"_requiredBy": [
"/unified"
],
- "_resolved": "https://registry.npmjs.org/vfile/-/vfile-1.4.0.tgz",
- "_shasum": "c0fd6fa484f8debdb771f68c31ed75d88da97fe7",
- "_spec": "vfile@^1.0.0",
- "_where": "/Users/trott/io.js/tools/eslint-tmp/node_modules/eslint/node_modules/unified",
- "author": {
- "name": "Titus Wormer",
- "email": "tituswormer@gmail.com",
- "url": "http://wooorm.com"
- },
- "bugs": {
- "url": "https://github.com/wooorm/vfile/issues"
- },
+ "_resolved": "https://registry.npmjs.org/vfile/-/vfile-2.1.0.tgz",
+ "_shasum": "d3ce8b825e7b8d53b896164341273381936f02bd",
+ "_shrinkwrap": null,
+ "_spec": "vfile@^2.0.0",
+ "_where": "j:\\temp\\_git\\node-fork\\tools\\eslint\\node_modules\\unified",
+ "bin": null,
"bundleDependencies": false,
- "contributors": [
- {
- "name": "Titus Wormer",
- "email": "tituswormer@gmail.com",
- "url": "http://wooorm.com"
- }
- ],
- "dependencies": {},
+ "dependencies": {
+ "is-buffer": "^1.1.4",
+ "replace-ext": "1.0.0",
+ "unist-util-stringify-position": "^1.0.0"
+ },
"deprecated": false,
- "description": "Virtual file format for text processing",
+ "description": "[![Build Status][build-badge]][build-status] [![Coverage Status][coverage-badge]][coverage-status]",
"devDependencies": {
- "browserify": "^13.0.0",
- "eslint": "^2.0.0",
+ "browserify": "^14.0.0",
"esmangle": "^1.0.0",
- "istanbul": "^0.4.0",
- "jscs": "^3.0.0",
- "jscs-jsdoc": "^2.0.0",
- "remark": "^4.0.0",
- "remark-comment-config": "^3.0.0",
- "remark-github": "^4.0.1",
- "remark-lint": "^3.0.0",
- "remark-man": "^3.0.0",
- "remark-toc": "^3.0.0",
- "remark-validate-links": "^3.0.0",
- "tape": "^4.4.0"
+ "nyc": "^10.0.0",
+ "remark-cli": "^3.0.0",
+ "remark-preset-wooorm": "^3.0.0",
+ "tape": "^4.4.0",
+ "xo": "^0.18.0"
},
- "files": [
- "index.js"
- ],
- "homepage": "https://github.com/wooorm/vfile#readme",
- "keywords": [
- "virtual",
- "file",
- "text",
- "processing",
- "message",
- "warning",
- "error",
- "remark",
- "retext"
- ],
- "license": "MIT",
"name": "vfile",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/wooorm/vfile.git"
- },
- "scripts": {
- "build": "npm run build-md && npm run build-bundle && npm run build-mangle",
- "build-bundle": "browserify index.js -s VFile > vfile.js",
- "build-mangle": "esmangle vfile.js > vfile.min.js",
- "build-md": "remark . --quiet --frail",
- "lint": "npm run lint-api && npm run lint-style",
- "lint-api": "eslint .",
- "lint-style": "jscs --reporter inline .",
- "test": "npm run build && npm run lint && npm run test-coverage",
- "test-api": "node test.js",
- "test-coverage": "istanbul cover test.js",
- "test-travis": "npm run test-coverage"
- },
- "version": "1.4.0"
+ "optionalDependencies": {},
+ "peerDependencies": {},
+ "scripts": {},
+ "version": "2.1.0"
}
diff --git a/tools/eslint/node_modules/vfile/readme.md b/tools/eslint/node_modules/vfile/readme.md
index 48f5269c54..38896f6940 100644
--- a/tools/eslint/node_modules/vfile/readme.md
+++ b/tools/eslint/node_modules/vfile/readme.md
@@ -1,538 +1,290 @@
-# ![vfile](https://cdn.rawgit.com/wooorm/vfile/master/logo.svg)
+# ![vfile][]
-[![Build Status](https://img.shields.io/travis/wooorm/vfile.svg)](https://travis-ci.org/wooorm/vfile) [![Coverage Status](https://img.shields.io/codecov/c/github/wooorm/vfile.svg)](https://codecov.io/github/wooorm/vfile)
+[![Build Status][build-badge]][build-status]
+[![Coverage Status][coverage-badge]][coverage-status]
-**VFile** is a virtual file format used by [**retext**](https://github.com/wooorm/retext)
-(natural language) and [**remark**](https://github.com/wooorm/remark)
-(markdown). Two processors which parse, transform, and compile text. Both need
-a virtual representation of files and a place to store metadata and messages.
-And, they work in the browser. **VFile** provides these requirements.
+**VFile** is a virtual file format used by [**unified**][unified],
+a text processing umbrella (it powers [**retext**][retext] for
+natural language, [**remark**][remark] for markdown, and
+[**rehype**][rehype] for HTML). Each processors that parse, transform,
+and compile text, and need a virtual representation of files and a
+place to store [messages][] about them. Plus, they work in the browser.
+**VFile** provides these requirements at a small size, in IE 9 and up.
-Also, **VFile** exposes a warning mechanism compatible with [**ESLint**](https://github.com/eslint/eslint)s
-formatters, making it easy to expose [stylish](https://github.com/eslint/eslint/blob/master/lib/formatters/stylish.js)
-warnings, or export [tap](https://github.com/eslint/eslint/blob/master/lib/formatters/tap.js)
-compliant messages.
-
-> **VFile** is different from (the excellent :+1:) [**vinyl**](https://github.com/wearefractal/vinyl)
-> in that it does not include file-system or node-only functionality. No
-> buffers, streams, or stats. In addition, the focus on
-> [metadata](#vfilenamespacekey) and [messages](#vfilemessagereason-position-ruleid)
-> are useful when processing a file through a
-> [middleware](https://github.com/segmentio/ware) pipeline.
+> **VFile** is different from the excellent [**vinyl**][vinyl]
+> in that it has a smaller API, a smaller size, and focuses on
+> [messages][].
## Installation
-[npm](https://docs.npmjs.com/cli/install):
+[npm][]:
```bash
npm install vfile
```
-**VFile** is also available for [duo](http://duojs.org/#getting-started),
-and as an AMD, CommonJS, and globals module, [uncompressed and
-compressed](https://github.com/wooorm/vfile/releases).
-
## Table of Contents
* [Usage](#usage)
-
-* [Related Tools](#related-tools)
-
+* [Utilities](#utilities)
+* [Reporters](#reporters)
* [API](#api)
-
- * [VFile()](#vfile-1)
- * [VFile#contents](#vfilecontents)
- * [VFile#directory](#vfiledirectory)
- * [VFile#filename](#vfilefilename)
- * [VFile#extension](#vfileextension)
- * [VFile#basename()](#vfilebasename)
- * [VFile#quiet](#vfilequiet)
- * [VFile#messages](#vfilemessages)
- * [VFile#history](#vfilehistory)
- * [VFile#toString()](#vfiletostring)
- * [VFile#filePath()](#vfilefilepath)
- * [VFile#move(options)](#vfilemoveoptions)
- * [VFile#namespace(key)](#vfilenamespacekey)
+ * [VFile(\[options\])](#vfileoptions)
+ * [vfile.contents](#vfilecontents)
+ * [vfile.cwd](#vfilecwd)
+ * [vfile.path](#vfilepath)
+ * [vfile.basename](#vfilebasename)
+ * [vfile.stem](#vfilestem)
+ * [vfile.extname](#vfileextname)
+ * [vfile.dirname](#vfiledirname)
+ * [vfile.history](#vfilehistory)
+ * [vfile.messages](#vfilemessages)
+ * [vfile.data](#vfiledata)
+ * [VFile#toString(\[encoding\])](#vfiletostringencoding)
* [VFile#message(reason\[, position\[, ruleId\]\])](#vfilemessagereason-position-ruleid)
- * [VFile#warn(reason\[, position\[, ruleId\]\])](#vfilewarnreason-position-ruleid)
* [VFile#fail(reason\[, position\[, ruleId\]\])](#vfilefailreason-position-ruleid)
- * [VFile#hasFailed()](#vfilehasfailed)
* [VFileMessage](#vfilemessage)
-
* [License](#license)
## Usage
```js
-var VFile = require('vfile');
-
-var file = new VFile({
- 'directory': '~',
- 'filename': 'example',
- 'extension': 'txt',
- 'contents': 'Foo *bar* baz'
-});
-
-file.toString(); // 'Foo *bar* baz'
-file.filePath(); // '~/example.txt'
-
-file.move({'extension': 'md'});
-file.filePath(); // '~/example.md'
-
-file.warn('Something went wrong', {'line': 1, 'column': 3});
-// { [~/example.md:1:3: Something went wrong]
-// name: '~/example.md:1:3',
-// file: '~/example.md',
-// reason: 'Something went wrong',
-// line: 1,
-// column: 3,
-// fatal: false }
-```
-
-## Related Tools
-
-[**VFile**](#api)s are used by both [**retext**](https://github.com/wooorm/retext)
-and [**remark**](https://github.com/wooorm/remark).
-
-In addition, here’s a list of useful tools:
-
-* [`dustinspecker/convert-vinyl-to-vfile`](https://github.com/dustinspecker/convert-vinyl-to-vfile)
- — Convert a [Vinyl](https://github.com/wearefractal/vinyl) file to a VFile;
-
-* [`shinnn/is-vfile-message`](https://github.com/shinnn/is-vfile-message)
- — Check if a value is a `VFileMessage` object;
-
-* [`wooorm/to-vfile`](https://github.com/wooorm/to-vfile)
- — Create a virtual file from a file-path;
-
-* [`wooorm/vfile-find-down`](https://github.com/wooorm/vfile-find-down)
- — Find one or more files by searching the file system downwards;
-
-* [`wooorm/vfile-find-up`](https://github.com/wooorm/vfile-find-up)
- — Find one or more files by searching the file system upwards;
+var vfile = require('vfile');
-* [`wooorm/vfile-location`](https://github.com/wooorm/vfile-location)
- — Convert between positions (line and column-based) and offsets
- (range-based) locations;
+var file = vfile({path: '~/example.txt', contents: 'Alpha *braavo* charlie.'});
-* [`shinnn/vfile-messages-to-vscode-diagnostics`](https://github.com/shinnn/vfile-messages-to-vscode-diagnostics)
- — Convert `VFileMessage`s into an array of VS Code diagnostics;
+file.path; //=> '~/example.txt'
+file.dirname; //=> '~'
-* [`wooorm/vfile-reporter`](https://github.com/wooorm/vfile-reporter)
- — Stylish reporter for virtual files.
+file.extname = '.md';
-* [`wooorm/vfile-sort`](https://github.com/wooorm/vfile-sort)
- — Sort virtual file messages by line/column;
+file.basename; //=> 'example.md'
-## API
-
-### `VFile()`
-
-**VFile** objects make it easy to move files, to trigger warnings and
-errors, and to store supplementary metadata relating to files, all without
-accessing the file-system.
-
-**Example**:
+file.basename = 'index.text';
-```js
-var file = new VFile({
- 'directory': '~',
- 'filename': 'example',
- 'extension': 'txt',
- 'contents': 'Foo *bar* baz'
-});
+file.history; //=> ['~/example.txt', '~/example.md', '~/index.text']
-file === VFile(file); // true
-file === new VFile(file); // true
+file.message('`braavo` is misspelt; did you mean `bravo`?', {line: 1, column: 8});
-VFile('foo') instanceof VFile; // true
+console.log(file.messages);
```
-**Signatures**:
-
-* `file = VFile(contents|options|vFile?)`.
-
-**Parameters**:
-
-* `contents` (`string`) — Contents of the file;
-
-* `vFile` (`VFile`) — Existing representation, returned without modification;
-
-* `options` (`Object`):
-
- * `directory` (`string?`, default: `''`)
- — Parent directory;
-
- * `filename` (`string?`, default: `''`)
- — Name, without extension;
-
- * `extension` (`string?`, default: `''`)
- — Extension(s), without initial dot;
-
- * `contents` (`string?`, default: `''`)
- — Raw value.
-
-**Returns**:
-
-`vFile` — Instance.
-
-**Notes**:
-
-`VFile` exposes an interface compatible with ESLint’s formatters. For example,
-to expose warnings using ESLint’s `compact` formatter, execute the following:
-
-```javascript
-var compact = require('eslint/lib/formatters/compact');
-var VFile = require('vfile');
-
-var vFile = new VFile({
- 'directory': '~',
- 'filename': 'hello',
- 'extension': 'txt'
-});
-
-vFile.warn('Whoops, something happened!');
-
-console.log(compact([vFile]));
-```
-
-Which would yield the following:
-
-```text
-~/hello.txt: line 0, col 0, Warning - Whoops, something happened!
-
-1 problem
-```
-
-### `VFile#contents`
-
-`string` — Content of file.
-
-### `VFile#directory`
-
-`string` — Path to parent directory.
-
-### `VFile#filename`
-
-`string` — Filename. A file-path can still be generated when no filename exists.
-
-### `VFile#extension`
-
-`string` — Extension. A file-path can still be generated when no extension
-exists.
-
-### `VFile#basename()`
-
-Get the filename, with extension, if applicable.
-
-**Example**:
+Yields:
```js
-var file = new VFile({
- 'directory': '~',
- 'filename': 'example',
- 'extension': 'txt'
-});
-
-file.basename() // example.txt
+[ { [~/index.text:1:8: `braavo` is misspelt; did you mean `bravo`?]
+ message: '`braavo` is misspelt; did you mean `bravo`?',
+ name: '~/index.text:1:8',
+ file: '~/index.text',
+ reason: '`braavo` is misspelt; did you mean `bravo`?',
+ line: 1,
+ column: 8,
+ location: { start: [Object], end: [Object] },
+ ruleId: null,
+ source: null,
+ fatal: false } ]
```
-**Signatures**:
-
-* `string = vFile.basename()`.
-
-**Returns**:
-
-`string`— Returns the file path without a directory, if applicable.
-Otherwise,an empty string is returned.
-
-### `VFile#quiet`
-
-`boolean?` — Whether an error created by [`VFile#fail()`](#vfilemessagereason-position-ruleid)
-is returned (when truthy) or thrown (when falsey).
+## Utilities
+
+The following list of projects includes tools for working with virtual
+files. See [**Unist**][unist] for projects working with nodes.
+
+* [`convert-vinyl-to-vfile`](https://github.com/dustinspecker/convert-vinyl-to-vfile)
+ — Convert from [Vinyl][]
+* [`is-vfile-message`](https://github.com/shinnn/is-vfile-message)
+ — Check if a value is a `VFileMessage` object
+* [`to-vfile`](https://github.com/vfile/to-vfile)
+ — Create a virtual file from a file-path (and optionally read it)
+* [`vfile-find-down`](https://github.com/vfile/vfile-find-down)
+ — Find files by searching the file system downwards
+* [`vfile-find-up`](https://github.com/vfile/vfile-find-up)
+ — Find files by searching the file system upwards
+* [`vfile-location`](https://github.com/vfile/vfile-location)
+ — Convert between line/column- and range-based locations
+* [`vfile-statistics`](https://github.com/vfile/vfile-statistics)
+ — Count messages per category
+* [`vfile-messages-to-vscode-diagnostics`](https://github.com/shinnn/vfile-messages-to-vscode-diagnostics)
+ — Convert to VS Code diagnostics
+* [`vfile-sort`](https://github.com/vfile/vfile-sort)
+ — Sort messages by line/column
+* [`vfile-to-eslint`](https://github.com/vfile/vfile-to-eslint)
+ — Convert VFiles to ESLint formatter compatible output
+
+## Reporters
+
+The following list of projects show linting results for given virtual files.
+Reporters _must_ accept `Array.<VFile>` as their first argument, and return
+`string`. Reporters _may_ accept other values too, in which case it’s suggested
+to stick to `vfile-reporter`s interface.
+
+* [`vfile-reporter`](https://github.com/vfile/vfile-reporter)
+ — Stylish reporter
+* [`vfile-reporter-json`](https://github.com/vfile/vfile-reporter-json)
+ — JSON reporter
+* [`vfile-reporter-pretty`](https://github.com/vfile/vfile-reporter-pretty)
+ — Pretty reporter
-Ensure all `messages` associated with a file are handled properly when setting
-this to `true`.
-
-### `VFile#messages`
-
-`Array.<VFileMessage>` — List of associated messages.
-
-**Notes**:
-
-`VFile#message()`, and in turn `VFile#warn()` and `VFile#fail()`, return
-`Error` objects that adhere to the [`VFileMessage`](#vfilemessage) schema.
-Its results can populate `messages`.
+## API
-### `VFile#history`
+### `VFile([options])`
-`Array.<String>` — List of file-paths the file [`move`](#vfilemoveoptions)d
-between.
+Create a new virtual file. If `options` is `string` or `Buffer`, treats
+it as `{contents: options}`. If `options` is a `VFile`, returns it.
+All other options are set on the newly created `vfile`.
-### `VFile#toString()`
+Path related properties are set in the following order (least specific
+to most specific): `history`, `path`, `basename`, `stem`, `extname`,
+`dirname`.
-Get the value of the file.
+It’s not possible to set either `dirname` or `extname` without setting
+either `history`, `path`, `basename`, or `stem` as well.
-**Example**:
+###### Example
```js
-var vFile = new VFile('Foo');
-String(vFile); // 'Foo'
+vfile();
+vfile('console.log("alpha");');
+vfile(Buffer.from('exit 1'));
+vfile({path: path.join(__dirname, 'readme.md')});
+vfile({stem: 'readme', extname: '.md', dirname: __dirname});
+vfile({other: 'properties', are: 'copied', ov: {e: 'r'}});
```
-**Signatures**:
-
-* `string = vFile.toString()`.
+### `vfile.contents`
-**Returns**:
+`Buffer`, `string`, `null` — Raw value.
-`string` — Contents.
+### `vfile.cwd`
-### `VFile#filePath()`
+`string` — Base of `path`. Defaults to `process.cwd()`.
-Get the filename, with extension and directory, if applicable.
+### `vfile.path`
-**Example**:
+`string?` — Path of `vfile`. Cannot be nullified.
-```js
-var file = new VFile({
- 'directory': '~',
- 'filename': 'example',
- 'extension': 'txt'
-});
-
-String(file.filePath); // ~/example.txt
-file.filePath() // ~/example.txt
-```
+### `vfile.basename`
-**Signatures**:
+`string?` — Current name (including extension) of `vfile`. Cannot
+contain path separators. Cannot be nullified either (use
+`file.path = file.dirname` instead).
-* `string = vFile.filePath()`.
+### `vfile.stem`
-**Returns**:
-
-`string` — If the `vFile` has a `filename`, it will be prefixed with the
-directory (slashed), if applicable, and suffixed with the (dotted) extension
-(if applicable). Otherwise, an empty string is returned.
-
-### `VFile#move(options)`
-
-Move a file by passing a new directory, filename, and extension. When these
-are not given, the default values are kept.
-
-**Example**:
-
-```js
-var file = new VFile({
- 'directory': '~',
- 'filename': 'example',
- 'extension': 'txt',
- 'contents': 'Foo *bar* baz'
-});
-
-file.move({'directory': '/var/www'});
-file.filePath(); // '/var/www/example.txt'
-
-file.move({'extension': 'md'});
-file.filePath(); // '/var/www/example.md'
-```
+`string?` — Name (without extension) of `vfile`. Cannot be nullified,
+and cannot contain path separators.
-**Signatures**:
+### `vfile.extname`
-* `vFile = vFile.move(options?)`.
+`string?` — Extension (with dot) of `vfile`. Cannot be set if
+there’s no `path` yet and cannot contain path separators.
-**Parameters**:
+### `vfile.dirname`
-* `options` (`Object`):
+`string?` — Path to parent directory of `vfile`. Cannot be set if
+there’s no `path` yet.
- * `directory` (`string`, default: `''`)
- — Parent directory;
+### `vfile.history`
- * `filename` (`string?`, default: `''`)
- — Name, without extension;
+`Array.<string>` — List of file-paths the file moved between.
- * `extension` (`string`, default: `''`)
- — Extension(s), without initial dot.
+### `vfile.messages`
-**Returns**:
+`Array.<VFileMessage>` — List of messages associated with the file.
-`vFile` — Context object (chainable).
+### `vfile.data`
-### `VFile#namespace(key)`
+`Object` — Place to store custom information. It’s OK to store custom
+data directly on the `vfile`, moving it to `data` gives a _little_ more
+privacy.
-Access metadata.
+### `VFile#toString([encoding])`
-**Example**:
-
-```js
-var file = new VFile('Foo');
-
-file.namespace('foo').bar = 'baz';
-
-console.log(file.namespace('foo').bar) // 'baz';
-```
-
-**Parameters**:
-
-* `key` (`string`) — Namespace key.
-
-**Returns**:
-
-`Object` — Private namespace for metadata.
+Convert contents of `vfile` to string. If `contents` is a buffer,
+`encoding` is used to stringify buffers (default: `'utf8'`).
### `VFile#message(reason[, position[, ruleId]])`
-Create a message with `reason` at `position`. When an error is passed in as
-`reason`, copies the stack. This does not add a message to `messages`.
-
-**Example**:
-
-```js
-var file = new VFile();
-
-file.message('Something went wrong');
-// { [1:1: Something went wrong]
-// name: '1:1',
-// file: '',
-// reason: 'Something went wrong',
-// line: null,
-// column: null }
-```
-
-**Signatures**:
+Associates a message with the file for `reason` at `position`. When an
+error is passed in as `reason`, copies the stack.
-* `VFileMessage = vFile.message(err|reason, node|location|position?,
- ruleId?)`.
+###### Parameters
-**Parameters**:
+* `reason` (`string` or `Error`)
+ — Reason for message, uses the stack and message of the error if given
+* `position` (`Node`, `Location`, or `Position`, optional)
+ — Place at which the message occurred in `vfile`
+* `ruleId` (`string`, optional)
+ — Category of warning
-* `err` (`Error`) — Original error, whose stack and message are used;
+###### Returns
-* `reason` (`string`) — Reason for message;
-
-* `node` (`Node`) — Syntax tree object;
-
-* `location` (`Object`) — Syntax tree location (found at `node.position`);
-
-* `position` (`Object`) — Syntax tree position (found at
- `node.position.start` or `node.position.end`).
-
-* `ruleId` (`string`) — Category of warning.
-
-**Returns**:
-
-[`VFileMessage`](#vfilemessage) — File-related message with location
-information.
-
-### `VFile#warn(reason[, position[, ruleId]])`
-
-Warn. Creates a non-fatal message (see [`VFile#message()`](#vfilemessagereason-position-ruleid)),
-and adds it to the file's [`messages`](#vfilemessages) list.
-
-**Example**:
-
-```js
-var file = new VFile();
-
-file.warn('Something went wrong');
-// { [1:1: Something went wrong]
-// name: '1:1',
-// file: '',
-// reason: 'Something went wrong',
-// line: null,
-// column: null,
-// fatal: false }
-```
-
-**See**:
-
-* [`VFile#message`](#vfilemessagereason-position-ruleid)
+[`VFileMessage`][message].
### `VFile#fail(reason[, position[, ruleId]])`
-Fail. Creates a fatal message (see `VFile#message()`), sets `fatal: true`,
-adds it to the file's `messages` list.
+Associates a fatal message with the file, then immediately throws it.
+Note: fatal errors mean a file is no longer processable.
+Calls [`#message()`][messages] internally.
-If `quiet` is not `true`, throws the error.
+###### Throws
-**Example**:
+[`VFileMessage`][message].
-```js
-var file = new VFile();
-
-file.fail('Something went wrong');
-// 1:1: Something went wrong
-// at VFile.exception (vfile/index.js:296:11)
-// at VFile.fail (vfile/index.js:360:20)
-// at repl:1:6
-
-file.quiet = true;
-file.fail('Something went wrong');
-// { [1:1: Something went wrong]
-// name: '1:1',
-// file: '',
-// reason: 'Something went wrong',
-// line: null,
-// column: null,
-// fatal: true }
-```
-
-**See**:
-
-* [`VFile#message`](#vfilemessagereason-position-ruleid)
-
-### `VFile#hasFailed()`
-
-Check if a fatal message occurred making the file no longer processable.
-
-**Example**:
+### `VFileMessage`
-```js
-var file = new VFile();
-file.quiet = true;
+File-related message describing something at certain position (extends
+`Error`).
+
+###### Properties
+
+* `file` (`string`) — File-path (when the message was triggered)
+* `reason` (`string`) — Reason for message
+* `ruleId` (`string?`) — Category of message
+* `source` (`string?`) — Namespace of warning
+* `stack` (`string?`) — Stack of message
+* `fatal` (`boolean?`) — If `true`, marks associated file as no longer
+ processable
+* `line` (`number?`) — Starting line of error
+* `column` (`number?`) — Starting column of error
+* `location` (`object`) — Full range information, when available. Has
+ `start` and `end` properties, both set to an object with `line` and
+ `column`, set to `number?`
-file.hasFailed(); // false
+## License
-file.fail('Something went wrong');
-file.hasFailed(); // true
-```
+[MIT][license] © [Titus Wormer][author]
-**Signatures**:
+<!-- Definitions -->
-* `boolean = vFile.hasFailed()`.
+[build-badge]: https://img.shields.io/travis/vfile/vfile.svg
-**Returns**:
+[build-status]: https://travis-ci.org/vfile/vfile
-`boolean` — `true` if at least one of file’s `messages` has a `fatal`
-property set to `true`.
+[coverage-badge]: https://img.shields.io/codecov/c/github/vfile/vfile.svg
-### `VFileMessage`
+[coverage-status]: https://codecov.io/github/vfile/vfile
-`Error` — File-related message with location information.
+[npm]: https://docs.npmjs.com/cli/install
-**Properties**:
+[license]: LICENSE
-* `name` (`string`)
- — (Starting) location of the message, preceded by its file-path when
- available, and joined by `':'`. Used by the native
- [`Error#toString()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/name);
+[author]: http://wooorm.com
-* `file` (`string`) — File-path;
+[vfile]: https://cdn.rawgit.com/vfile/vfile/a20a566/logo.svg
-* `reason` (`string`) — Reason for message;
+[unified]: https://github.com/unifiedjs/unified
-* `line` (`number?`) — Line of error, when available;
+[retext]: https://github.com/wooorm/retext
-* `column` (`number?`) — Column of error, when available;
+[remark]: https://github.com/wooorm/remark
-* `stack` (`string?`) — Stack of message, when available;
+[rehype]: https://github.com/wooorm/rehype
-* `fatal` (`boolean?`) — Whether the associated file is still processable.
+[vinyl]: https://github.com/gulpjs/vinyl
-* `location` (`object`) — Full range information, when available. Has
- `start` and `end` properties, both set to an object with `line` and
- `column`, set to `number?`.
+[unist]: https://github.com/syntax-tree/unist#list-of-utilities
-## License
+[messages]: #vfilemessagereason-position-ruleid
-[MIT](LICENSE) © [Titus Wormer](http://wooorm.com)
+[message]: #vfilemessage
diff --git a/tools/eslint/node_modules/x-is-function/LICENSE b/tools/eslint/node_modules/x-is-function/LICENSE
new file mode 100644
index 0000000000..4f2aa21a49
--- /dev/null
+++ b/tools/eslint/node_modules/x-is-function/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2016 Alexander Praetorius
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/tools/eslint/node_modules/x-is-function/README.md b/tools/eslint/node_modules/x-is-function/README.md
new file mode 100644
index 0000000000..0c21a7e9ff
--- /dev/null
+++ b/tools/eslint/node_modules/x-is-function/README.md
@@ -0,0 +1,41 @@
+# x-is-function
+x is a function
+
+# usage
+`npm install x-is-function`
+
+```js
+var isFunction = require('x-is-function')
+
+isFunction(function () {})
+// -> true
+
+isFunction("hello")
+// -> false
+
+isFunction("")
+// -> false
+
+isFunction(9)
+// -> false
+
+isFunction(true)
+// -> false
+
+isFunction(new Date())
+// -> false
+
+isFunction({})
+// -> false
+
+isFunction(null)
+// -> false
+
+isFunction(undefined)
+// -> false
+```
+
+
+# related
+a list of other `x-is-...` modules can be found at
+* [x-is](https://www.npmjs.com/package/x-is)
diff --git a/tools/eslint/node_modules/x-is-function/index.js b/tools/eslint/node_modules/x-is-function/index.js
new file mode 100644
index 0000000000..b820d6318d
--- /dev/null
+++ b/tools/eslint/node_modules/x-is-function/index.js
@@ -0,0 +1,3 @@
+module.exports = function isFunction (fn) {
+ return Object.prototype.toString.call(fn) === '[object Function]'
+}
diff --git a/tools/eslint/node_modules/x-is-function/package.json b/tools/eslint/node_modules/x-is-function/package.json
new file mode 100644
index 0000000000..ec0a7db4b2
--- /dev/null
+++ b/tools/eslint/node_modules/x-is-function/package.json
@@ -0,0 +1,46 @@
+{
+ "_from": "x-is-function@^1.0.4",
+ "_id": "x-is-function@1.0.4",
+ "_inBundle": false,
+ "_integrity": "sha1-XSlNw9Joy90GJYDgxd93o5HR+h4=",
+ "_location": "/x-is-function",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "x-is-function@^1.0.4",
+ "name": "x-is-function",
+ "escapedName": "x-is-function",
+ "rawSpec": "^1.0.4",
+ "saveSpec": null,
+ "fetchSpec": "^1.0.4"
+ },
+ "_requiredBy": [
+ "/eslint-plugin-markdown/unified"
+ ],
+ "_resolved": "https://registry.npmjs.org/x-is-function/-/x-is-function-1.0.4.tgz",
+ "_shasum": "5d294dc3d268cbdd062580e0c5df77a391d1fa1e",
+ "_spec": "x-is-function@^1.0.4",
+ "_where": "j:\\temp\\_git\\node-fork\\tools\\eslint\\node_modules\\eslint-plugin-markdown\\node_modules\\unified",
+ "author": {
+ "name": "@serapath"
+ },
+ "bugs": {
+ "url": "https://github.com/serapath/x-is-function/issues"
+ },
+ "bundleDependencies": false,
+ "deprecated": false,
+ "description": "Simple function test",
+ "homepage": "https://github.com/serapath/x-is-function#readme",
+ "license": "MIT",
+ "main": "index.js",
+ "name": "x-is-function",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/serapath/x-is-function.git"
+ },
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "version": "1.0.4"
+}
diff --git a/tools/eslint/node_modules/x-is-string/LICENCE b/tools/eslint/node_modules/x-is-string/LICENCE
new file mode 100644
index 0000000000..0d0834052f
--- /dev/null
+++ b/tools/eslint/node_modules/x-is-string/LICENCE
@@ -0,0 +1,19 @@
+Copyright (c) 2014 Matt-Esch.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/tools/eslint/node_modules/x-is-string/README.md b/tools/eslint/node_modules/x-is-string/README.md
new file mode 100644
index 0000000000..99977d475a
--- /dev/null
+++ b/tools/eslint/node_modules/x-is-string/README.md
@@ -0,0 +1,46 @@
+# x-is-string
+
+Simple string test
+
+## Example
+
+```js
+var isString = require("x-is-string")
+
+isString("hello")
+// -> true
+
+isString("")
+// -> true
+
+isString(new String("things"))
+// -> true
+
+isString(1)
+// -> false
+
+isString(true)
+// -> false
+
+isString(new Date())
+// -> false
+
+isString({})
+// -> false
+
+isString(null)
+// -> false
+
+isString(undefined)
+// -> false
+```
+
+## Installation
+
+`npm install x-is-string`
+
+## Contributors
+
+ - Matt-Esch
+
+## MIT Licenced \ No newline at end of file
diff --git a/tools/eslint/node_modules/x-is-string/index.js b/tools/eslint/node_modules/x-is-string/index.js
new file mode 100644
index 0000000000..090130d4ce
--- /dev/null
+++ b/tools/eslint/node_modules/x-is-string/index.js
@@ -0,0 +1,7 @@
+var toString = Object.prototype.toString
+
+module.exports = isString
+
+function isString(obj) {
+ return toString.call(obj) === "[object String]"
+}
diff --git a/tools/eslint/node_modules/x-is-string/package.json b/tools/eslint/node_modules/x-is-string/package.json
new file mode 100644
index 0000000000..8ec07a4d69
--- /dev/null
+++ b/tools/eslint/node_modules/x-is-string/package.json
@@ -0,0 +1,86 @@
+{
+ "_from": "x-is-string@^0.1.0",
+ "_id": "x-is-string@0.1.0",
+ "_inBundle": false,
+ "_integrity": "sha1-R0tQhlrzpJqcRlfwWs0UVFj3fYI=",
+ "_location": "/x-is-string",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "x-is-string@^0.1.0",
+ "name": "x-is-string",
+ "escapedName": "x-is-string",
+ "rawSpec": "^0.1.0",
+ "saveSpec": null,
+ "fetchSpec": "^0.1.0"
+ },
+ "_requiredBy": [
+ "/eslint-plugin-markdown/unified"
+ ],
+ "_resolved": "https://registry.npmjs.org/x-is-string/-/x-is-string-0.1.0.tgz",
+ "_shasum": "474b50865af3a49a9c4657f05acd145458f77d82",
+ "_spec": "x-is-string@^0.1.0",
+ "_where": "j:\\temp\\_git\\node-fork\\tools\\eslint\\node_modules\\eslint-plugin-markdown\\node_modules\\unified",
+ "author": {
+ "name": "Matt-Esch",
+ "email": "matt@mattesch.info"
+ },
+ "bugs": {
+ "url": "https://github.com/Matt-Esch/x-is-string/issues",
+ "email": "matt@mattesch.info"
+ },
+ "bundleDependencies": false,
+ "contributors": [
+ {
+ "name": "Matt-Esch"
+ }
+ ],
+ "dependencies": {},
+ "deprecated": false,
+ "description": "Simple string test",
+ "devDependencies": {
+ "tape": "^2.12.2"
+ },
+ "homepage": "https://github.com/Matt-Esch/x-is-string",
+ "keywords": [],
+ "licenses": [
+ {
+ "type": "MIT",
+ "url": "http://github.com/Matt-Esch/x-is-string/raw/master/LICENSE"
+ }
+ ],
+ "main": "index",
+ "name": "x-is-string",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/Matt-Esch/x-is-string.git"
+ },
+ "scripts": {
+ "cover": "istanbul cover --report none --print detail ./test/index.js",
+ "start": "node ./index.js",
+ "test": "node ./test/index.js",
+ "test-browser": "testem-browser ./test/browser/index.js",
+ "testem": "testem-both -b=./test/browser/index.js",
+ "travis-test": "istanbul cover ./test/index.js && ((cat coverage/lcov.info | coveralls) || exit 0)",
+ "view-cover": "istanbul report html && google-chrome ./coverage/index.html",
+ "watch": "nodemon -w ./index.js index.js"
+ },
+ "testling": {
+ "files": "test/index.js",
+ "browsers": [
+ "ie/8..latest",
+ "firefox/16..latest",
+ "firefox/nightly",
+ "chrome/22..latest",
+ "chrome/canary",
+ "opera/12..latest",
+ "opera/next",
+ "safari/5.1..latest",
+ "ipad/6.0..latest",
+ "iphone/6.0..latest",
+ "android-browser/4.2..latest"
+ ]
+ },
+ "version": "0.1.0"
+}
diff --git a/tools/eslint/package-lock.json b/tools/eslint/package-lock.json
index 0718fa08a8..2038ec2453 100644
--- a/tools/eslint/package-lock.json
+++ b/tools/eslint/package-lock.json
@@ -95,11 +95,6 @@
"resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz",
"integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo="
},
- "ccount": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/ccount/-/ccount-1.0.1.tgz",
- "integrity": "sha1-ZlaHlFFowhjsd/9hpBVa4AInqWw="
- },
"chalk": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
@@ -110,11 +105,6 @@
"resolved": "https://registry.npmjs.org/character-entities/-/character-entities-1.2.0.tgz",
"integrity": "sha1-poPiz3Xb6LFxljUxNk5Y4YobFV8="
},
- "character-entities-html4": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/character-entities-html4/-/character-entities-html4-1.1.0.tgz",
- "integrity": "sha1-GrCFUdPOH6HfCNAPucod77FHoGw="
- },
"character-entities-legacy": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-1.1.0.tgz",
@@ -191,9 +181,9 @@
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ="
},
"eslint-plugin-markdown": {
- "version": "1.0.0-beta.4",
- "resolved": "https://registry.npmjs.org/eslint-plugin-markdown/-/eslint-plugin-markdown-1.0.0-beta.4.tgz",
- "integrity": "sha1-gqGZcTmeSxti99SsZCRofCwH7no="
+ "version": "1.0.0-beta.7",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-markdown/-/eslint-plugin-markdown-1.0.0-beta.7.tgz",
+ "integrity": "sha1-Euc6QSfEpLedlm+fR1hR3Q949+c="
},
"eslint-scope": {
"version": "3.7.1",
@@ -350,6 +340,11 @@
"resolved": "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-1.0.0.tgz",
"integrity": "sha1-4GSS5xnBvxXewjnk8a9fZ7TW578="
},
+ "is-buffer": {
+ "version": "1.1.5",
+ "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.5.tgz",
+ "integrity": "sha1-Hzsm72E7IUuIy8ojzGwB2Hlh7sw="
+ },
"is-decimal": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-decimal/-/is-decimal-1.0.0.tgz",
@@ -385,6 +380,11 @@
"resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.0.tgz",
"integrity": "sha1-/AbloWg/vaE95mev9xe7wQpI838="
},
+ "is-plain-obj": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz",
+ "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4="
+ },
"is-promise": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz",
@@ -400,6 +400,16 @@
"resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.0.0.tgz",
"integrity": "sha1-jfV8YeouPFAUCNEA+wE8+NbgzGI="
},
+ "is-whitespace-character": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-whitespace-character/-/is-whitespace-character-1.0.0.tgz",
+ "integrity": "sha1-u/SoN2Tq0NRRvsKlUhjpGWGtwnU="
+ },
+ "is-word-character": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-word-character/-/is-word-character-1.0.0.tgz",
+ "integrity": "sha1-o6nl3a1wxcLuNvSpz8mlP0RTUkc="
+ },
"isarray": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
@@ -445,15 +455,10 @@
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz",
"integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4="
},
- "longest-streak": {
+ "markdown-escapes": {
"version": "1.0.0",
- "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-1.0.0.tgz",
- "integrity": "sha1-0GWXxNTDG1LMsfXY+P5xSOr9aWU="
- },
- "markdown-table": {
- "version": "0.4.0",
- "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-0.4.0.tgz",
- "integrity": "sha1-iQwsGzv+g/sA5BKbjkz+ZFJw+dE="
+ "resolved": "https://registry.npmjs.org/markdown-escapes/-/markdown-escapes-1.0.0.tgz",
+ "integrity": "sha1-yMoZ8dlNaCRZ4Kk8htsnp+9xayM="
},
"mimic-fn": {
"version": "1.1.0",
@@ -520,11 +525,6 @@
"resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-1.1.1.tgz",
"integrity": "sha1-gRLYhHExnyerrk1klksSL+ThuJA="
},
- "parse5": {
- "version": "2.2.3",
- "resolved": "https://registry.npmjs.org/parse5/-/parse5-2.2.3.tgz",
- "integrity": "sha1-DE/EHBAAxea5PUiwP4CDg3g06fY="
- },
"path-is-absolute": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
@@ -575,26 +575,21 @@
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.2.tgz",
"integrity": "sha1-WgTfBeT1f+Pw3Gj90R3FyXx+b00="
},
- "remark": {
- "version": "5.1.0",
- "resolved": "https://registry.npmjs.org/remark/-/remark-5.1.0.tgz",
- "integrity": "sha1-y0Y709vLS5l5STXu4c9x16jjBow="
- },
"remark-parse": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-1.1.0.tgz",
- "integrity": "sha1-w8oQ+ajaBGFcKPCapOMEUQUm7CE="
- },
- "remark-stringify": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/remark-stringify/-/remark-stringify-1.1.0.tgz",
- "integrity": "sha1-pxBeJbnuK/mkm3XSxCPxGwauIJI="
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-3.0.1.tgz",
+ "integrity": "sha1-G5+EGkTY9PvyJGhQJlRZpOs1TIA="
},
"repeat-string": {
"version": "1.6.1",
"resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz",
"integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc="
},
+ "replace-ext": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz",
+ "integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs="
+ },
"require-uncached": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz",
@@ -650,6 +645,11 @@
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
"integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw="
},
+ "state-toggle": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/state-toggle/-/state-toggle-1.0.0.tgz",
+ "integrity": "sha1-0g+aYWu08MO5i5GSLSW2QKorxCU="
+ },
"string_decoder": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz",
@@ -672,11 +672,6 @@
}
}
},
- "stringify-entities": {
- "version": "1.3.1",
- "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-1.3.1.tgz",
- "integrity": "sha1-sVDsLXKsTBtfMktR+2soyc3/BYw="
- },
"strip-ansi": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
@@ -748,15 +743,20 @@
"integrity": "sha1-a5qu379z3xdWrZ4xbdmBiFhAzX0="
},
"unified": {
- "version": "4.2.1",
- "resolved": "https://registry.npmjs.org/unified/-/unified-4.2.1.tgz",
- "integrity": "sha1-dv9Dqo2kMPbn5KVchOusKtLPzS4="
+ "version": "6.1.5",
+ "resolved": "https://registry.npmjs.org/unified/-/unified-6.1.5.tgz",
+ "integrity": "sha1-cWk3hyYhpjE15iztLzrGoGPG+4c="
},
"unist-util-remove-position": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/unist-util-remove-position/-/unist-util-remove-position-1.1.1.tgz",
"integrity": "sha1-WoXBVV/BugwQG4ZwfRXlD6TIcbs="
},
+ "unist-util-stringify-position": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-1.1.1.tgz",
+ "integrity": "sha1-PMvcU2ee7W7PN3fdf14yKcG2qjw="
+ },
"unist-util-visit": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-1.1.3.tgz",
@@ -768,9 +768,9 @@
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
},
"vfile": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/vfile/-/vfile-1.4.0.tgz",
- "integrity": "sha1-wP1vpIT43r23cfaMMe112I2pf+c="
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/vfile/-/vfile-2.1.0.tgz",
+ "integrity": "sha1-086Lgl57jVO4lhZDQSczgZNvAr0="
},
"vfile-location": {
"version": "2.0.1",
@@ -792,6 +792,16 @@
"resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz",
"integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c="
},
+ "x-is-function": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/x-is-function/-/x-is-function-1.0.4.tgz",
+ "integrity": "sha1-XSlNw9Joy90GJYDgxd93o5HR+h4="
+ },
+ "x-is-string": {
+ "version": "0.1.0",
+ "resolved": "https://registry.npmjs.org/x-is-string/-/x-is-string-0.1.0.tgz",
+ "integrity": "sha1-R0tQhlrzpJqcRlfwWs0UVFj3fYI="
+ },
"xtend": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz",
diff --git a/tools/eslint/package.json b/tools/eslint/package.json
index 50fb36855d..df68de2e4a 100644
--- a/tools/eslint/package.json
+++ b/tools/eslint/package.json
@@ -40,7 +40,7 @@
"concat-stream": "^1.6.0",
"debug": "^2.6.8",
"doctrine": "^2.0.0",
- "eslint-plugin-markdown": "^1.0.0-beta.4",
+ "eslint-plugin-markdown": "^1.0.0-beta.7",
"eslint-scope": "^3.7.1",
"espree": "^3.4.3",
"esquery": "^1.0.0",
diff --git a/tools/icu/README.md b/tools/icu/README.md
index c70fa4ee42..2b5d74ac20 100644
--- a/tools/icu/README.md
+++ b/tools/icu/README.md
@@ -28,7 +28,7 @@ Also running
<!-- eslint-disable strict -->
```js
- new Intl.DateTimeFormat('es', {month: 'long'}).format(new Date(9E8));
+new Intl.DateTimeFormat('es', {month: 'long'}).format(new Date(9E8));
```
…Should return `January` not `enero`.
diff --git a/tools/package-lock.json b/tools/package-lock.json
index 45a4897e9c..cd42a9cbe9 100644
--- a/tools/package-lock.json
+++ b/tools/package-lock.json
@@ -194,9 +194,9 @@
"integrity": "sha1-u7VaKCIO4Itp2pVU1FprLr/X2RM="
},
"eslint-plugin-markdown": {
- "version": "1.0.0-beta.4",
- "resolved": "https://registry.npmjs.org/eslint-plugin-markdown/-/eslint-plugin-markdown-1.0.0-beta.4.tgz",
- "integrity": "sha1-gqGZcTmeSxti99SsZCRofCwH7no="
+ "version": "1.0.0-beta.7",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-markdown/-/eslint-plugin-markdown-1.0.0-beta.7.tgz",
+ "integrity": "sha1-Euc6QSfEpLedlm+fR1hR3Q949+c="
},
"eslint-scope": {
"version": "3.7.1",
diff --git a/tools/update-eslint.sh b/tools/update-eslint.sh
index 0c9d3758dc..6fa8c77d6e 100755
--- a/tools/update-eslint.sh
+++ b/tools/update-eslint.sh
@@ -12,12 +12,10 @@ rm -rf eslint
mkdir eslint-tmp
cd eslint-tmp
-npm install --global-style --no-binlinks --production eslint@latest
+npm install --global-style --no-bin-links --production eslint@latest
cd node_modules/eslint
-# eslint-plugin-markdown is pinned at 1.0.0-beta.4 until there is a release
-# that fixes https://github.com/eslint/eslint-plugin-markdown/issues/69.
-npm install --no-bin-links --production eslint-plugin-markdown@1.0.0-beta.4
+npm install --no-bin-links --production eslint-plugin-markdown@next
cd ../..
# Install dmn if it is not in path.