diff --git a/doc/api/dns.md b/doc/api/dns.md index 3813712305abe8..b4d078bbb88d61 100644 --- a/doc/api/dns.md +++ b/doc/api/dns.md @@ -65,7 +65,7 @@ section if a custom port is used. For example: - + ```js [ '4.4.4.4', @@ -314,7 +314,7 @@ function will contain an array of objects with the following properties: For example: - + ```js { flags: 's', @@ -374,7 +374,7 @@ be an object with the following properties: * `expire` * `minttl` - + ```js { nsname: 'ns.example.com', @@ -405,7 +405,7 @@ be an array of objects with the following properties: * `port` * `name` - + ```js { priority: 10, @@ -459,12 +459,12 @@ will be present on the object: Here is a example of the `ret` object passed to the callback: - + ```js [ { type: 'A', address: '127.0.0.1', ttl: 299 }, { type: 'CNAME', value: 'example.com' }, { type: 'MX', exchange: 'alt4.aspmx.l.example.com', priority: 50 }, - { type: 'NS', value: 'ns1.example.com', type: 'NS' }, + { type: 'NS', value: 'ns1.example.com' }, { type: 'TXT', entries: [ 'v=spf1 include:_spf.example.com ~all' ] }, { type: 'SOA', nsname: 'ns1.example.com', diff --git a/doc/api/http.md b/doc/api/http.md index 6b152c522e0be6..a9e9cd3876f380 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -12,7 +12,7 @@ user is able to stream data. HTTP message headers are represented by an object like this: - + ```js { 'content-length': '123', 'content-type': 'text/plain', diff --git a/doc/api/os.md b/doc/api/os.md index 6afa69d39edb1d..3b4b9526cb48cc 100644 --- a/doc/api/os.md +++ b/doc/api/os.md @@ -254,7 +254,7 @@ The properties available on the assigned network address object include: * `scopeid` {number} The numeric IPv6 scope ID (only specified when `family` is `IPv6`) - + ```js { lo: [ diff --git a/doc/api/process.md b/doc/api/process.md index 9a8323de1741cf..82d854109973c2 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -528,7 +528,7 @@ running the `./configure` script. An example of the possible output looks like: - + ```js { target_defaults: @@ -792,7 +792,7 @@ See environ(7). An example of this object looks like: - + ```js { TERM: 'xterm-256color', @@ -1224,7 +1224,7 @@ console.log(process.memoryUsage()); Will generate: - + ```js { rss: 4935680, @@ -1396,7 +1396,7 @@ tarball. For example: - + ```js { name: 'node', @@ -1758,7 +1758,7 @@ console.log(process.versions); Will generate an object similar to: - + ```js { http_parser: '2.3.0', diff --git a/doc/api/querystring.md b/doc/api/querystring.md index 9216414f8a194e..c6b89235c14d43 100644 --- a/doc/api/querystring.md +++ b/doc/api/querystring.md @@ -59,7 +59,7 @@ collection of key and value pairs. For example, the query string `'foo=bar&abc=xyz&abc=123'` is parsed into: - + ```js { foo: 'bar', diff --git a/doc/api/repl.md b/doc/api/repl.md index 9d6bdfb112d6cf..d18b34a5eab724 100644 --- a/doc/api/repl.md +++ b/doc/api/repl.md @@ -40,7 +40,7 @@ The following special commands are supported by all REPL instances: `> .load ./file/to/load.js` * `.editor` - Enter editor mode (`-D` to finish, `-C` to cancel) - + ```js > .editor // Entering editor mode (^D to finish, ^C to cancel) @@ -76,7 +76,7 @@ evaluation function when the `repl.REPLServer` instance is created. The default evaluator supports direct evaluation of JavaScript expressions: - + ```js > 1 + 1 2 @@ -105,7 +105,7 @@ repl.start('> ').context.m = msg; Properties in the `context` object appear as local within the REPL: - + ```js $ node repl_test.js > m @@ -135,7 +135,7 @@ REPL environment when used. For instance, unless otherwise declared as a global or scoped variable, the input `fs` will be evaluated on-demand as `global.fs = require('fs')`. - + ```js > fs.createReadStream('./some/file'); ``` @@ -146,7 +146,7 @@ The default evaluator will, by default, assign the result of the most recently evaluated expression to the special variable `_` (underscore). Explicitly setting `_` to a value will disable this behavior. - + ```js > [ 'a', 'b', 'c' ] [ 'a', 'b', 'c' ] @@ -293,7 +293,7 @@ r.on('reset', initializeContext); When this code is executed, the global `'m'` variable can be modified but then reset to its initial value using the `.clear` command: - + ```js $ ./node example.js > m @@ -443,7 +443,7 @@ Node.js itself uses the `repl` module to provide its own interactive interface for executing JavaScript. This can be used by executing the Node.js binary without passing any arguments (or by passing the `-i` argument): - + ```js $ node > const a = [1, 2, 3]; diff --git a/doc/api/v8.md b/doc/api/v8.md index 32b0fe71eec55e..e9ee98a4844cf6 100644 --- a/doc/api/v8.md +++ b/doc/api/v8.md @@ -116,7 +116,7 @@ swapped out by the operating system. For example: - + ```js { total_heap_size: 7326976, diff --git a/tools/eslint/node_modules/ccount/history.md b/tools/eslint/node_modules/ccount/history.md deleted file mode 100644 index 908b6f7578944e..00000000000000 --- a/tools/eslint/node_modules/ccount/history.md +++ /dev/null @@ -1,11 +0,0 @@ - - - - -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 0d72d6e52763cc..00000000000000 --- 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 d773d12c8c59e5..00000000000000 --- 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] - - - -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] - - - -[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 fa0d7bc7c770c8..00000000000000 --- 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 9540ae4f9514bf..00000000000000 --- 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 d607a6483e2d8f..00000000000000 --- 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] - - - -[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 4f212022c81355..749c18832358a1 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 `` 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. + + + + ```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 7d0fa62f795914..8df09ef614d2da 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 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 bf0bf1ca703e8c..54d03e7a41309a 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 similarity index 92% rename from tools/eslint/node_modules/parse5/LICENSE rename to tools/eslint/node_modules/is-buffer/LICENSE index 120d532f4af34e..0c068ceecbd48f 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 00000000000000..cb6f356d5a95a0 --- /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 00000000000000..36c808ea7579c2 --- /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 + * @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 00000000000000..f9440208bc0262 --- /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 00000000000000..0d1ba9eeb89723 --- /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 00000000000000..654d0bfe943437 --- /dev/null +++ b/tools/eslint/node_modules/is-plain-obj/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (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 00000000000000..697b7e70c9032a --- /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 00000000000000..269e56aeff0646 --- /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 similarity index 94% rename from tools/eslint/node_modules/ccount/LICENSE rename to tools/eslint/node_modules/is-whitespace-character/LICENSE index 32e7a3d93ca5a2..8d8660d36ef2ec 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 +Copyright (c) 2016 Titus Wormer 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 similarity index 59% rename from tools/eslint/node_modules/longest-streak/history.md rename to tools/eslint/node_modules/is-whitespace-character/history.md index 654a34d89a391f..674e111c479ebb 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 ---- + -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 00000000000000..f9e23df3f72b0b --- /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 00000000000000..d70f094f556af5 --- /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 00000000000000..c2ac49c21300e8 --- /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] + + + +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] + + + +[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 similarity index 94% rename from tools/eslint/node_modules/character-entities-html4/LICENSE rename to tools/eslint/node_modules/is-word-character/LICENSE index 32e7a3d93ca5a2..8d8660d36ef2ec 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 +Copyright (c) 2016 Titus Wormer 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 00000000000000..674e111c479ebb --- /dev/null +++ b/tools/eslint/node_modules/is-word-character/history.md @@ -0,0 +1,6 @@ + + + + +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 00000000000000..c2f9c3fd05992c --- /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 00000000000000..61aee67a54ebb3 --- /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 00000000000000..4a0a25fd299d77 --- /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] + + + +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] + + + +[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 719d5168603e4f..00000000000000 --- 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 e9af0ed2d72cac..00000000000000 --- 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 780c53cf7b1eda..00000000000000 --- 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 similarity index 94% rename from tools/eslint/node_modules/markdown-table/LICENSE rename to tools/eslint/node_modules/markdown-escapes/LICENSE index ce731a9cb02e09..8d8660d36ef2ec 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 +Copyright (c) 2016 Titus Wormer 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 00000000000000..f20d5035693db5 --- /dev/null +++ b/tools/eslint/node_modules/markdown-escapes/history.md @@ -0,0 +1,6 @@ + + + + +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 00000000000000..38f81193e81238 --- /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.} - 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 00000000000000..2ed7bc0ffdbafb --- /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 00000000000000..8ab33f397d289d --- /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] + + + +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.`. + +### `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] + + + +[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 9931cc11d2fa4b..00000000000000 --- 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 8b64246a2d4cce..00000000000000 --- 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.>} table - * @param {Object?} options - * @param {boolean?} [options.rule=true] - * @param {string?} [options.delimiter=" | "] - * @param {string?} [options.start="| "] - * @param {string?} [options.end=" |"] - * @param {Array.?} 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 49117592fc33b6..00000000000000 --- 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 7b36f893369992..00000000000000 --- a/tools/eslint/node_modules/parse5/README.md +++ /dev/null @@ -1,40 +0,0 @@ -

- - parse5 - -

- -

-WHATWG HTML5 specification-compliant, fast and ready for production HTML parsing/serialization toolset for Node.js -

- -

- Build Status - NPM Version - Downloads - Downloads total -

- -

-parse5 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 jsdom, Angular2, Polymer and many more. -

- ----- - -

- Documentation -

- -

- Version history -

- -

- Online playground -

- -

- Issue tracker -

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 2c6927a873a719..00000000000000 --- 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 4dedbbffce6f04..00000000000000 --- 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 d826eaa36da1ac..00000000000000 --- 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 c35934a96a7c3d..00000000000000 --- 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 8777e97ab79d1a..00000000000000 --- 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 28663c2193ea42..00000000000000 --- 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 - * @example - * var parse5 = require('parse5'); - * - * var document = parse5.parse('Hi there!'); - */ -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 - * @example - * var parse5 = require('parse5'); - * - * var documentFragment = parse5.parseFragment('
'); - * - * // Parses the html fragment in the context of the parsed element. - * var trFragment = parser.parseFragment(documentFragment.childNodes[0], ''); - */ -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('Hi there!'); - * - * // Serializes a document. - * var html = parse5.serialize(document); - * - * // Serializes the 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('
', { 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 c92baf5606ec7d..00000000000000 --- 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

- First 'p' closes without a closing tag and - // for cases like - '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: and 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 bbdebd7cfc5a94..00000000000000 --- 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} 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 e1711910e3971d..00000000000000 --- 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 bdf192050d43bf..00000000000000 --- 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
Shake it, baby