diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..97ff4e8a --- /dev/null +++ b/.editorconfig @@ -0,0 +1,16 @@ +root = true + +[*.{json,js}] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +indent_style = space +indent_size = 2 + +[*.md, !test/*.md] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +indent_style = tab +indent_size = 4 \ No newline at end of file diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 00000000..121531af --- /dev/null +++ b/.eslintignore @@ -0,0 +1 @@ +*.min.js diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 00000000..7fdd6141 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,28 @@ +{ + "extends": "standard", + "plugins": [ + "standard" + ], + "parserOptions": { "ecmaVersion": 5 }, + "rules": { + "semi": "off", + "indent": ["warn", 2, { + "VariableDeclarator": { "var": 2 }, + "SwitchCase": 1, + "outerIIFEBody": 0 + }], + "space-before-function-paren": "off", + "operator-linebreak": ["error", "before", { "overrides": { "=": "after" } }], + "no-cond-assign": "off", + "no-useless-escape": "off", + "no-return-assign": "off", + "one-var": "off", + "no-control-regex": "off" + }, + "env": { + "node": true, + "browser": true, + "amd": true, + "jasmine": true + } +} diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..8f2d8c35 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +test/* linguist-vendored + diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 27fbcc1a..9df84eaf 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,11 +1,42 @@ +**Marked version:** + +**Markdown flavor:** Markdown.pl|CommonMark|GitHub Flavored Markdown|n/a + + + + + ## Expectation +**CommonMark Demo:** [demo](https://spec.commonmark.org/dingus/) + + ## Result +**Marked Demo:** [demo](https://marked.js.org/demo/) + + ## What was attempted + + diff --git a/.github/ISSUE_TEMPLATE/Bug_report.md b/.github/ISSUE_TEMPLATE/Bug_report.md new file mode 100644 index 00000000..d8042b4d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/Bug_report.md @@ -0,0 +1,27 @@ +--- +name: Bug report +about: Marked says it does this thing but does not + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: + + + + + + + +**Expected behavior** +A clear and concise description of what you expected to happen. diff --git a/.github/ISSUE_TEMPLATE/Feature_request.md b/.github/ISSUE_TEMPLATE/Feature_request.md new file mode 100644 index 00000000..745d4b43 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/Feature_request.md @@ -0,0 +1,14 @@ +--- +name: Feature request +about: Marked doesn't do this thing and I think it should + +--- + +**Describe the feature** +A clear and concise description of what you would like. + +**Why is this feature necessary?** +A clear and concise description of why. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. diff --git a/.github/ISSUE_TEMPLATE/Proposal.md b/.github/ISSUE_TEMPLATE/Proposal.md new file mode 100644 index 00000000..aa94da3a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/Proposal.md @@ -0,0 +1,11 @@ +--- +name: Proposal +about: Marked doesn't do this thing and I think it should + +--- + +**What pain point are you perceiving?.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..8274e607 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,53 @@ + + + +**Marked version:** + + + +**Markdown flavor:** Markdown.pl|CommonMark|GitHub Flavored Markdown|n/a + +## Description + +- Fixes #### (if fixing a known issue; otherwise, describe issue using the following format) + + + +## Contributor + +- [ ] Test(s) exist to ensure functionality and minimize regression (if no tests added, list tests covering this PR); or, +- [ ] no tests required for this PR. +- [ ] If submitting new feature, it has been documented in the appropriate places. + +## Committer + +In most cases, this should be a different person than the contributor. + +- [ ] Draft GitHub release notes have been updated. +- [ ] CI is green (no forced merge required). +- [ ] Merge PR diff --git a/.github/PULL_REQUEST_TEMPLATE/badges.md b/.github/PULL_REQUEST_TEMPLATE/badges.md new file mode 100644 index 00000000..2078243d --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/badges.md @@ -0,0 +1,50 @@ +**@mention the contributor:** + +## Recommendation to: + +- [ ] Change user group +- [ ] Add a badge +- [ ] Remove a badge + + + +## As the one mentioned, I would like to: + +- [ ] accept the recommendation; or, +- [ ] graciously decline; or, +- [ ] dispute the recommendation + +within 30 days, if you have not indicated which option you are taking one of the following will happen: + +1. If adding a badge, we will assume you are graciously declining. +2. If removing a badge, we will assume you do not want to dispute the recommendation; therefore, the badge will be removed. + + + +Note: All committers must approve via review before merging, the disapproving committer can simply close the PR. \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE/release.md b/.github/PULL_REQUEST_TEMPLATE/release.md new file mode 100644 index 00000000..29cd7f2e --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/release.md @@ -0,0 +1,25 @@ +## Publisher + +- [ ] `$ npm version` has been run. +- [ ] Release notes in [draft GitHub release](https://github.com/markedjs/marked/releases) are up to date +- [ ] Release notes include which flavors and versions of Markdown are supported by this release +- [ ] Committer checklist is complete. +- [ ] Merge PR. +- [ ] Publish GitHub release using `master` with correct version number. +- [ ] `$ npm publish` has been run. +- [ ] Create draft GitHub release to prepare next release. + +Note: If merges to `master` occur after submitting this PR and before running `$ npm pubish` you should be able to + +1. pull from `upstream/master` (`git pull upstream master`) into the branch holding this version, +2. run `$ npm run build` to regenerate the `min` file, and +3. commit and push the updated changes. + +## Committer + +In most cases, this should be someone different than the publisher. + +- [ ] Version in `package.json` has been updated (see [PUBLISHING.md](https://github.com/markedjs/marked/blob/master/docs/PUBLISHING.md)). +- [ ] The `marked.min.js` has been updated; or, +- [ ] release does not change library. +- [ ] CI is green (no forced merge required). diff --git a/.gitignore b/.gitignore index 14a781d9..68ccf75d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ +.DS_Store node_modules/ test/compiled_tests diff --git a/.npmignore b/.npmignore index 3fb773c0..029b9260 100644 --- a/.npmignore +++ b/.npmignore @@ -1,2 +1,3 @@ .git* test/ +docs \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 60d00ce1..54212604 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,47 @@ language: node_js -node_js: - - "0.10" - - "0.8" - - "0.6" + +jobs: + fast_finish: true + allow_failures: + - stage: security scan 🔐 + + include: + - stage: unit tests 👩🏽‍💻 + script: npm run test:unit + node_js: lts/* + + - stage: spec tests 👩🏽‍💻 + script: npm run test:specs + node_js: v0.10 + - node_js: v4 + - node_js: lts/* + - node_js: node + + - stage: lint ✨ + script: npm run test:lint + node_js: lts/* + + - stage: minify 🗜️ + script: | + npm run build + if ! git diff --quiet; then + git config --global user.email "travis@travis-ci.org" + git config --global user.name "Travis-CI" + git config credential.helper "store --file=.git/credentials" + echo "https://${GITHUB_TOKEN}:@github.com" > .git/credentials + git commit -am '🗜️ minify [skip ci]' + git push origin HEAD:${TRAVIS_BRANCH} + fi + node_js: lts/* + if: branch = master AND type = push + + - stage: security scan 🔐 + script: npm run test:redos + node_js: lts/* + +cache: + directories: + - node_modules + +git: + depth: 3 diff --git a/LICENSE b/LICENSE deleted file mode 100644 index a7b812ed..00000000 --- a/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2011-2014, Christopher Jeffrey (https://github.com/chjj/) - -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/README.md b/README.md index 8d3db112..fe7611c8 100644 --- a/README.md +++ b/README.md @@ -1,304 +1,44 @@ -# marked + + + -> A full-featured markdown parser and compiler, written in JavaScript. Built -> for speed. +# Marked -[![NPM version](https://badge.fury.io/js/marked.svg)][badge] +[![npm](https://badgen.net/npm/v/marked)](https://www.npmjs.com/package/marked) +[![gzip size](http://img.badgesize.io/https://cdn.jsdelivr.net/npm/marked/marked.min.js?compression=gzip)](https://cdn.jsdelivr.net/npm/marked/marked.min.js) +[![install size](https://badgen.net/packagephobia/install/marked)](https://packagephobia.now.sh/result?p=marked) +[![downloads](https://badgen.net/npm/dt/marked)](https://www.npmjs.com/package/marked) +[![travis](https://badgen.net/travis/markedjs/marked)](https://travis-ci.org/markedjs/marked) -## Install +- ⚡ built for speed +- ⬇️ low-level compiler for parsing markdown without caching or blocking for long periods of time +- ⚖️ light-weight while implementing all markdown features from the supported flavors & specifications +- 🌐 works in a browser, on a server, or from a command line interface (CLI) -``` bash -npm install marked --save -``` +## Demo -or if you want to use the `marked` CLI tool (not necessary when using npm run-scripts): +Checkout the [demo page](https://marked.js.org/demo/) to see marked in action ⛹️ -``` bash -npm install -g marked -``` +## Docs + +Our [documentation pages](https://marked.js.org) are also rendered using marked 💯 + +Also read about: + +* [Options](https://marked.js.org/#/USING_ADVANCED.md) +* [Extensibility](https://marked.js.org/#/USING_PRO.md) + +## Installation + +**CLI:** `npm install -g marked` + +**In-browser:** `npm install marked --save` ## Usage -Minimal usage: +### Warning: 🚨 Marked does not [sanitize](https://marked.js.org/#/USING_ADVANCED.md#options) the output HTML by default 🚨 -```js -var marked = require('marked'); -console.log(marked('I am using __markdown__.')); -// Outputs:

I am using markdown.

-``` - -Example setting options: - -```js -var marked = require('marked'); -marked.setOptions({ - renderer: new marked.Renderer(), - gfm: true, - tables: true, - breaks: false, - pedantic: false, - sanitize: false, - smartLists: true, - smartypants: false, - xhtml: false -}); - -console.log(marked('I am using __markdown__.')); -``` - -### Browser - -```html - - - - - Marked in the browser - - - -
- - - -``` - -## marked(markdownString [,options] [,callback]) - -### markdownString - -Type: `string` - -String of markdown source to be compiled. - -### options - -Type: `object` - -Hash of options. Can also be set using the `marked.setOptions` method as seen -above. - -### callback - -Type: `function` - -Function called when the `markdownString` has been fully parsed when using -async highlighting. If the `options` argument is omitted, this can be used as -the second argument. - -## Options - -### highlight - -Type: `function` - -A function to highlight code blocks. The first example below uses async highlighting with -[node-pygmentize-bundled][pygmentize], and the second is a synchronous example using -[highlight.js][highlight]: - -```js -var marked = require('marked'); - -var markdownString = '```js\n console.log("hello"); \n```'; - -// Async highlighting with pygmentize-bundled -marked.setOptions({ - highlight: function (code, lang, callback) { - require('pygmentize-bundled')({ lang: lang, format: 'html' }, code, function (err, result) { - callback(err, result.toString()); - }); - } -}); - -// Using async version of marked -marked(markdownString, function (err, content) { - if (err) throw err; - console.log(content); -}); - -// Synchronous highlighting with highlight.js -marked.setOptions({ - highlight: function (code) { - return require('highlight.js').highlightAuto(code).value; - } -}); - -console.log(marked(markdownString)); -``` - -#### highlight arguments - -`code` - -Type: `string` - -The section of code to pass to the highlighter. - -`lang` - -Type: `string` - -The programming language specified in the code block. - -`callback` - -Type: `function` - -The callback function to call when using an async highlighter. - -### renderer - -Type: `object` -Default: `new Renderer()` - -An object containing functions to render tokens to HTML. - -#### Overriding renderer methods - -The renderer option allows you to render tokens in a custom manner. Here is an -example of overriding the default heading token rendering by adding an embedded anchor tag like on GitHub: - -```javascript -var marked = require('marked'); -var renderer = new marked.Renderer(); - -renderer.heading = function (text, level) { - var escapedText = text.toLowerCase().replace(/[^\w]+/g, '-'); - - return '' + - text + ''; -}; - -console.log(marked('# heading+', { renderer: renderer })); -``` -This code will output the following HTML: -```html -

- - - - heading+ -

-``` - -#### Block level renderer methods - -- code(*string* code, *string* language) -- blockquote(*string* quote) -- html(*string* html) -- heading(*string* text, *number* level) -- hr() -- list(*string* body, *boolean* ordered) -- listitem(*string* text) -- paragraph(*string* text) -- table(*string* header, *string* body) -- tablerow(*string* content) -- tablecell(*string* content, *object* flags) - -`flags` has the following properties: - -```js -{ - header: true || false, - align: 'center' || 'left' || 'right' -} -``` - -#### Inline level renderer methods - -- strong(*string* text) -- em(*string* text) -- codespan(*string* code) -- br() -- del(*string* text) -- link(*string* href, *string* title, *string* text) -- image(*string* href, *string* title, *string* text) -- text(*string* text) - -### gfm - -Type: `boolean` -Default: `true` - -Enable [GitHub flavored markdown][gfm]. - -### tables - -Type: `boolean` -Default: `true` - -Enable GFM [tables][tables]. -This option requires the `gfm` option to be true. - -### breaks - -Type: `boolean` -Default: `false` - -Enable GFM [line breaks][breaks]. -This option requires the `gfm` option to be true. - -### pedantic - -Type: `boolean` -Default: `false` - -Conform to obscure parts of `markdown.pl` as much as possible. Don't fix any of -the original markdown bugs or poor behavior. - -### sanitize - -Type: `boolean` -Default: `false` - -Sanitize the output. Ignore any HTML that has been input. - -### smartLists - -Type: `boolean` -Default: `true` - -Use smarter list behavior than the original markdown. May eventually be -default with the old behavior moved into `pedantic`. - -### smartypants - -Type: `boolean` -Default: `false` - -Use "smart" typographic punctuation for things like quotes and dashes. - -### xhtml - -Type: `boolean` -Default: `false` - -Self-close the tags for void elements (<br/>, <img/>, etc.) with a "/" as required by XHTML. - -## Access to lexer and parser - -You also have direct access to the lexer and parser if you so desire. - -``` js -var tokens = marked.lexer(text, options); -console.log(marked.parser(tokens)); -``` - -``` js -var lexer = new marked.Lexer(options); -var tokens = lexer.lex(text); -console.log(tokens); -console.log(lexer.rules); -``` - -## CLI +**CLI** ``` bash $ marked -o hello.html @@ -308,109 +48,26 @@ $ cat hello.html

hello world

``` -## Philosophy behind marked +**Browser** -The point of marked was to create a markdown compiler where it was possible to -frequently parse huge chunks of markdown without having to worry about -caching the compiled output somehow...or blocking for an unnecessarily long time. - -marked is very concise and still implements all markdown features. It is also -now fully compatible with the client-side. - -marked more or less passes the official markdown test suite in its -entirety. This is important because a surprising number of markdown compilers -cannot pass more than a few tests. It was very difficult to get marked as -compliant as it is. It could have cut corners in several areas for the sake -of performance, but did not in order to be exactly what you expect in terms -of a markdown rendering. In fact, this is why marked could be considered at a -disadvantage in the benchmarks. - -Along with implementing every markdown feature, marked also implements [GFM -features][gfmf]. - -## Benchmarks - -node v8.1.3 - -``` bash -$ npm run bench -marked completed in 27497ms. -marked (gfm) completed in 31378ms. -marked (pedantic) completed in 25741ms. -commonmark completed in 25736ms. -markdown-it completed in 23816ms. -markdown.js completed in 79779ms. +```html + + + + + Marked in the browser + + +
+ + + + ``` -### Pro level - -You also have direct access to the lexer and parser if you so desire. - -``` js -var tokens = marked.lexer(text, options); -console.log(marked.parser(tokens)); -``` - -``` js -var lexer = new marked.Lexer(options); -var tokens = lexer.lex(text); -console.log(tokens); -console.log(lexer.rules); -``` - -``` bash -$ node -> require('marked').lexer('> i am using marked.') -[ { type: 'blockquote_start' }, - { type: 'paragraph', - text: 'i am using marked.' }, - { type: 'blockquote_end' }, - links: {} ] -``` - -## Running Tests & Contributing - -If you want to submit a pull request, make sure your changes pass the test -suite. If you're adding a new feature, be sure to add your own test. - -The marked test suite is set up slightly strangely: `test/new` is for all tests -that are not part of the original markdown.pl test suite (this is where your -test should go if you make one). `test/original` is only for the original -markdown.pl tests. - -In other words, if you have a test to add, add it to `test/new/`. If your test -uses a certain feature, for example, maybe it assumes GFM is *not* enabled, you -can add [front-matter](https://www.npmjs.com/package/front-matter) to the top of -your `.md` file - -``` yml ---- -gfm: false ---- -``` - -To run the tests: - -``` bash -npm run test -``` - -### Contribution and License Agreement - -If you contribute code to this project, you are implicitly allowing your code -to be distributed under the MIT license. You are also implicitly verifying that -all code is your original work. `` - ## License Copyright (c) 2011-2018, Christopher Jeffrey. (MIT License) - -See LICENSE for more info. - -[gfm]: https://help.github.com/articles/github-flavored-markdown -[gfmf]: http://github.github.com/github-flavored-markdown/ -[pygmentize]: https://github.com/rvagg/node-pygmentize-bundled -[highlight]: https://github.com/isagalaev/highlight.js -[badge]: http://badge.fury.io/js/marked -[tables]: https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#wiki-tables -[breaks]: https://help.github.com/articles/github-flavored-markdown#newlines diff --git a/bin/marked b/bin/marked index df4dcc0f..09e55943 100755 --- a/bin/marked +++ b/bin/marked @@ -5,9 +5,9 @@ * Copyright (c) 2011-2013, Christopher Jeffrey (MIT License) */ -var fs = require('fs') - , util = require('util') - , marked = require('../'); +var fs = require('fs'), + path = require('path'), + marked = require('../'); /** * Man Page @@ -20,12 +20,12 @@ function help() { cwd: process.cwd(), env: process.env, setsid: false, - customFds: [0, 1, 2] + stdio: 'inherit' }; - spawn('man', [__dirname + '/../man/marked.1'], options) - .on('error', function(err) { - fs.readFile(__dirname + '/../man/marked.1.txt', 'utf8', function(err, data) { + spawn('man', [path.resolve(__dirname, '/../man/marked.1')], options) + .on('error', function() { + fs.readFile(path.resolve(__dirname, '/../man/marked.1.txt'), 'utf8', function(err, data) { if (err) throw err; console.log(data); }); @@ -37,13 +37,14 @@ function help() { */ function main(argv, callback) { - var files = [] - , options = {} - , input - , output - , arg - , tokens - , opt; + var files = [], + options = {}, + input, + output, + string, + arg, + tokens, + opt; function getarg() { var arg = argv.shift(); @@ -86,6 +87,10 @@ function main(argv, callback) { case '--input': input = argv.shift(); break; + case '-s': + case '--string': + string = argv.shift(); + break; case '-t': case '--tokens': tokens = true; @@ -118,6 +123,9 @@ function main(argv, callback) { function getData(callback) { if (!input) { if (files.length <= 2) { + if (string) { + return callback(null, string); + } return getStdin(callback); } input = files.pop(); @@ -146,8 +154,8 @@ function main(argv, callback) { */ function getStdin(callback) { - var stdin = process.stdin - , buff = ''; + var stdin = process.stdin, + buff = ''; stdin.setEncoding('utf8'); diff --git a/bower.json b/bower.json index ea79113c..57c91f03 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "marked", - "homepage": "https://github.com/chjj/marked", + "homepage": "https://github.com/markedjs/marked", "authors": [ "Christopher Jeffrey " ], diff --git a/component.json b/component.json index 1d672877..7ebd0356 100644 --- a/component.json +++ b/component.json @@ -1,7 +1,7 @@ { "name": "marked", "version": "0.3.4", - "repo": "chjj/marked", + "repo": "markedjs/marked", "description": "A markdown parser built for speed", "keywords": ["markdown", "markup", "html"], "scripts": ["lib/marked.js"], diff --git a/doc/todo.md b/doc/todo.md deleted file mode 100644 index 2e60b162..00000000 --- a/doc/todo.md +++ /dev/null @@ -1,2 +0,0 @@ -# Todo - diff --git a/docs/AUTHORS.md b/docs/AUTHORS.md new file mode 100644 index 00000000..0bf00ead --- /dev/null +++ b/docs/AUTHORS.md @@ -0,0 +1,256 @@ +# Authors + +Marked takes an encompassing approach to its community. As such, you can think of these as [concentric circles](https://medium.com/the-node-js-collection/healthy-open-source-967fa8be7951), where each group encompases the following groups. + + + + + + + + + + + + + + +
+ + + +
+ Christopher Jeffrey +
Original Author
+ Started the fire +
+ + + +
+ Josh Bruce +
Publisher
+ Release Wrangler; Humaning Helper; Heckler of Hypertext +
+ + + +
+ Steven +
Admin
+ Open source, of course; GitHub Guru; Humaning Helper +
+ + + +
+ Jamie Davis +
Committer
+ Seeker of Security +
+ + + +
+ Tony Brix +
Committer
+ Titan of the test harness; Dr. DevOps +
+   +
+ + + + + + + + + + + + + + +
+ + + +
+ Brandon der Blätter +
Contributor
+ Curious Contributor +
+ + + +
+ Carlos Valle +
Contributor
+ Maker of the Marked mark from 2018 to present +
+ + + +
+ Federico Soave +
Contributor
+ Regent of the Regex; Master of Marked +
+ + + +
+ Karen Yavine +
Contributor
+ Snyk's Security Saint +
+ + + +
+ Костя Третяк +
Contributor
+ +
+ + + +
+ Tom Theisen +
Contributor
+ Defibrillator +
+ +## Publishers + +Publishers are admins who also have the responsibility, privilege, and burden of publishing the new releases to NPM and performing outreach and external stakeholder communications. Further, when things go pear-shaped, they're the ones taking most of the heat. Finally, when things go well, they're the primary ones praising the contributors who made it possible. + +(In other words, while Admins are focused primarily on the internal workings of the project, Publishers are focused on internal *and* external concerns.) + +**Should not exceed 2:** Having more people with the authority to publish a release can quickly turn into a consensus seeking nightmare (design by committee). Having only one is preferred (Directly Responsible Individual); however, given the nature of the project and its history, having an immediate fallback, and a potential deep fallback (Original author) is probably a good idea. + +[Details on badges](#badges) + +## Admins + +Admins are committers who also have the responsibility, privilege, and burden of selecting committers and making sure the project itself runs smoothly, which includes community maintenance, governance, dispute resolution, and so on. (Letting the contributors easily enter into, and work within, the project to begin contributing, with as little friction as possible.) + +**Should not exceed 3:** When there are too many people with the ability to resolve disputes, the dispute itself can quickly turn into a dispute amongst the admins themselves; therefore, we want this group to be small enough to commit to action and large enough to not put too much burden on one person. (Should ensure faster resolution and responsiveness.) + +To be listed: Admins are usually selected from the pool of committers (or they volunteer, using the same process) who demonstrate good understanding of the marked culture, operations, and do their best to help new contributors get up to speed on how to contribute effectively to the project. + +To be removed: You can remove yourself through the [GitHub UI](https://help.github.com/articles/removing-yourself-from-a-collaborator-s-repository/). + +[Details on badges](#badges) + +## Committers + +Committers are contributors who also have the responsibility, privilege, some might even say burden of being able to review and merge contributions (just usually not their own). + +A note on "decision making authority". This is related to submitting PRs and the [advice process](http://www.reinventingorganizationswiki.com/Decision_Making). The person marked as having decision making authority over a certain area should be sought for advice in that area before committing to a course of action. + +**Should not exceed 5:** For larger PRs affecting more of the codebase and, most likely, review by more people, we try to keep this pool small and responsive and let those with decision making authority have final say without negative repercussions from the other committers. + +To be listed: Committers are usually selected (or they volunteer, using the same process) from contributors who enter the discussions regarding the future direction of Marked (maybe even doing informal reviews of contributions despite not being able to merge them yourself). + +To be removed: You can remove yourself through the [GitHub UI](https://help.github.com/articles/removing-yourself-from-a-collaborator-s-repository/). + +A note on volunteering: + +1. Please do not volunteer unless you believe you can demonstrate to your peers you can do the work required. +2. Please do not overcommit yourself; we count on those committed to the project to be responsive. Really consider, with all you have going on, wehther you able to really commit to it. +3. Don't let the previous frighten you away, it can always be changed later by you or your peers. + +[Details on badges](#badges) + +## Contributors + +Contributors are users who submit a [PR](https://github.com/markedjs/marked/pulls), [Issue](https://github.com/markedjs/marked/issues), or collaborate in making Marked a better product and experience for all the users. + +To be listed: make a contribution and, if it has significant impact, the committers may be able to add you here. + +To be removed: please let us know or submit a PR. + +[Details on badges](#badges) + +## Users + +Users are anyone using Marked in some fashion, without them, there's no reason for us to exist. + +|Individual or Organization |Website |Project |Submitted by | +|:--------------------------|:-----------------------|:------------------------------------|:---------------------------------------------------| +|MarkedJS |https://marked.js.org |https://github.com/markedjs/marked |The marked committers | + +To be listed: All fields are optional. Contact any of the committers or, more timely, submit a pull request with the following (using the first row as an example): + +- **Individual or Organization:** The name you would like associated with the record. +- **Website:** A URL to a standalone website for the project. +- **Project:** A URL for the repository of the project using marked. +- **Submitted by:** The name and optional honorifics for the person adding the listing. + +To be removed: Same as above. Only instead of requesting addition request deletion or delete the row yourself. + +

Badges

+ +Badges? You don't *need* no stinkin' badges. + +Movie references aside. (It was either that or, "Let's play a game", but that would have been creepy…that's why it will most likely come later.) + +Badges? If you *want* 'em, we got 'em, and here's how you get 'em (and…dramatic pause…why not two dramatic pauses for emphasis?… how they can be taken away). + +- [ ] Add the appropriate badge to the desired contributor in the desired column of this page, even if they're not listed here yet. +- [ ] Submit a PR (we're big on PRs around here, if you haven't noticed, help us help you). +- [ ] Follow the instructions for submitting a badge PR. (There are more details to find within. Come on. Everybody likes surprises, right? No? Actually, we just try to put documentation where it belongs, closer to the code and part of the sequence of events.) + +### Badges at play: + +
+
Curious Contributor
+
A contributor with less than one year on this page who is actively engaged in submitting PRs, Issues, making recommendations, sharing thoughts…without being too annoying about it (let's be clear, submitting 100 Issues recommending the Marked Committers send everyone candy is trying for the badge, not honestly earning it).
+
Dr. DevOps
+
+

Someone who understands and contributes to improving the developer experience and flow of Marked into the world.

+
+ "The main characteristic of the DevOps movement is to strongly advocate automation and monitoring at all steps of software construction, from integration, testing, releasing to deployment and infrastructure management. DevOps aims at shorter development cycles, increased deployment frequency, more dependable releases, in close alignment with business objectives." ~ Wikipedia +
+
+
Eye for the CLI
+
At this point? Pretty much anyone who can update that `man` file to the current Marked version without regression in the CLI tool itself.
+
GitHub Guru
+
Someone who always seems to be able to tell you easier ways to do things with GitHub.
+
Humaning Helper
+
Someone who goes out of their way to help contributors feel welcomed and valued. Further, someone who takes the extra steps(s) necessary to help new contributors get up to speed. Finally, they maintain composure even in times of disagreement and dispute resolution.
+
Heckler of Hypertext
+
Someone who demonstrates an esoteric level of knowledge when it comes to HTML. In other words, someone who says things like, "Did you know most Markdown flavors don't have a way to render a description list (`dl`)? All the more reason Markdown `!==` HTML."
+
Markdown Maestro
+
You know that person who knows about way too many different flavors of Markdown? The one who maybe seems a little too obsessed with the possibilities of Markdown beyond HTML? Come on. You know who they are. Or, at least you could, if you give them this badge.
+
Master of Marked
+
Someone who demonstrates they know the ins and outs of the codebase for Marked.
+
Open source, of course
+
Someone who advocates for and has a proven understanding of how to operate within open source communities.
+
Regent of the Regex
+

Can you demonstrate you understand the following without Google and Stackoverflow?

+

/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/

+

Because this author can't yet. That's who gets these.

+
+
Seeker of Security
+
Someone who has demonstrated a high degree of expertise or authority when it comes to software security.
+
Titan of the Test Harness
+
Someone who demonstrates high-levels of understanding regarding Marked's test harness.
+
Totally Tron
+
Someone who demonstrates they are willing and able to "fight for the users", both developers dependent on marked to do their jobs as well as end-users interacting with the output (particularly in the realm of those with the disabilities).
+
+ +### Special badges that come with the job: + +
+
Defibrillator
+
A contributor who stepped up to help bring Marked back to life by contriuting solutions to help Marked pass when compared against the CommonMark and GitHub Flavored Markdown specifications.
+
Maker of the Marked mark
+
This badge is given to the person or oganization credited with creating the logo (or logotype) used in Marked communications for a given period of time. **Maker of the Marked mark from 2017 to present**, for example.
+
Release Wrangler
+
This is a badge given to all Publishers.
+
Snyk's Security Saint
+
This is a badge given to whomever primarily reaches out from Snyk to let us know about security issues.
+
diff --git a/docs/CNAME b/docs/CNAME new file mode 100644 index 00000000..c92fdfcb --- /dev/null +++ b/docs/CNAME @@ -0,0 +1 @@ +marked.js.org diff --git a/docs/CODE_OF_CONDUCT.md b/docs/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..5335399b --- /dev/null +++ b/docs/CODE_OF_CONDUCT.md @@ -0,0 +1,74 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of experience, +nationality, personal appearance, race, religion, or sexual identity and +orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or +advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to block temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team by submitting a PR with changes to the [AUTHORS](#/AUTHORS.md) page (or emailing josh@8fold.com). All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version [1.4][version]. + +[homepage]: https://www.contributor-covenant.org/ +[version]: https://www.contributor-covenant.org/version/1/4/code-of-conduct.html diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md new file mode 100644 index 00000000..c8e6ac12 --- /dev/null +++ b/docs/CONTRIBUTING.md @@ -0,0 +1,92 @@ +# Contributing to Marked + +- [ ] Fork `markedjs/marked`. +- [ ] Clone the library locally using GitHub Desktop or the command line. +- [ ] Make sure you are on the `master` branch. +- [ ] Be sure to run `npm install` or `npm update`. +- [ ] Create a branch. +- [ ] Make as small a change as possible. +- [ ] Run `npm test`, fix any broken things (for linting, you can run `npm run lint` to have the linter fix them for you). +- [ ] Submit a PR. + +## Design principles + +Marked tends to favor following the SOLID set of software design and development principles; mainly the [single responsibility](https://en.wikipedia.org/wiki/Single_responsibility_principle) and [open/closed principles](https://en.wikipedia.org/wiki/Open/closed_principle): + +- **Single responsibility:** Marked, and the components of Marked, have the single responsibility of converting Markdown strings into HTML. +- **Open/closed:** Marked favors giving developers the means to easily extend the library and its components over changing Marked's behavior through configuration options. + +## Priorities + +We think we have our priorities sorted to build quality in. + +The following table lists the ticket type labels we use when there is work to be done on the code either through an Issue or a PR; in priority order. + +|Ticket type label |Description | +|:----------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +|L0 - security |A security vulnerability within the Marked library is discovered. | +|L1 - broken |Valid usage results in incorrect output compared to [supported specifications](#/README.md#specifications) OR causes marked to crash AND there is no known workaround for the issue. | +|L2 - annoying |Similar to L1 - broken only there is a known workaround avaialable for the issue. | +|RR - refactor and re-engineer |Results in an improvement to developers using Marked (improved readability) or end-users (faster performance) or both. | +|NFS - new feature (spec related) |A capability Marked does not currently provide but is in one of the [supported specifications](#/README.md#specifications) | +|NFU - new feature (user requested) |A capability Marked does not currently provide but has been requested by users of Marked. | + +## Test early, often, and everything + +We try to write test cases to validate output (writing tests based on the [supported specifications](#/README.md#specifications)) and minimize regression (writing tests for issues fixed). Therefore, if you would like to contribute, some things you should know regarding the test harness. + +|Location |Description | +|:-------------|:---------------------------------------------------| +|/test/browser |For testing Marked in a client-side implementation. | +|/test/new |Tests not related to the original `markdown.pl`. | +|/test/original|Tests validating against the original `markdown.pl`.| + +If your test uses features or options, assuming `gfm` is set to `false`, for example, you can add [front-matter](https://www.npmjs.com/package/front-matter) to the top of +your `.md` file + +``` yml +--- +gfm: false +--- +``` + +## Submitting PRs and Issues + +Marked provides templates for submitting both pull requests and issues. When you begin creating a new PR or issue, you will see instructions on using the template. + +The PR templates include checklists for both the submitter and the reviewer, which, in most cases, will not be the same person. + +## Scripts + +When it comes to NPM commands, we try to use the native scripts provided by the NPM framework. + +To run the tests: + +``` bash +npm test +``` + +To test whether you are using the standard syntax rules for the project: + +```bash +npm run test:lint +``` + +To see time comparisons between Marked and other popular Markdown libraries: + +```bash +npm run bench +``` + +To check for (and fix) standardized syntax (lint): + +```bash +npm run lint +``` + +To build your own minified version of Marked: + +```bash +npm run build +``` + diff --git a/docs/LICENSE.md b/docs/LICENSE.md new file mode 100644 index 00000000..64b41a0e --- /dev/null +++ b/docs/LICENSE.md @@ -0,0 +1,43 @@ +# License information + +## Contribution License Agreement + +If you contribute code to this project, you are implicitly allowing your code +to be distributed under the MIT license. You are also implicitly verifying that +all code is your original work. `` + +## Marked + +Copyright (c) 2011-2018, Christopher Jeffrey (https://github.com/chjj/) + +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. + +## Markdown + +Copyright © 2004, John Gruber +http://daringfireball.net/ +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. +* Neither the name “Markdown” nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +This software is provided by the copyright holders and contributors “as is” and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the copyright owner or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage. diff --git a/docs/PUBLISHING.md b/docs/PUBLISHING.md new file mode 100644 index 00000000..27937c2f --- /dev/null +++ b/docs/PUBLISHING.md @@ -0,0 +1,24 @@ +# Releasing Marked + +- [ ] See [contributing](#/CONTRIBUTING.md) +- [ ] Create release branch from `master` (`release-x.y.z`) +- [ ] Submit PR with minimal name: Release x.y.z +- [ ] Complete PR checklists + +## Overall strategy + +**Master is always shippable:** We try to merge PRs in such a way that `master` is the only branch to really be concerned about *and* `master` can always be released. This allows smoother flow between new fetures, bug fixes, and so on. (Almost a continuous deployment setup, without automation.) + +## Versioning + +We follow [semantic versioning](https://semver.org) where the following sequence is true `[major].[minor].[patch]`; therefore, consider the following implications of the release you are preparing: + +1. **Major:** There is at least one change not deemed backward compatible. +2. **Minor:** There is at least one new feature added to the release. +3. **Patch:** No breaking changes, no new features. + +What to expect while Marked is a zero-major (0.x.y): + +1. The major will remain at zero; thereby, alerting consumers to the potentially volatile nature of the package. +2. The minor will tend to be more analagous to a `major` release. +3. The patch will tend to be more analagous to a `minor` release or a collection of bug fixes (patches). diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 00000000..84f272ea --- /dev/null +++ b/docs/README.md @@ -0,0 +1,85 @@ +Marked is + +1. built for speed.* +2. a low-level markdown compiler for parsing markdown without caching or blocking for long periods of time.** +3. light-weight while implementing all markdown features from the supported flavors & specifications.*** +4. available as a command line interface (CLI) and running in client- or server-side JavaScript projects. + +

* Still working on metrics for comparative analysis and definition.
+** As few dependencies as possible.
+*** Strict compliance could result in slower processing when running comparative benchmarking.

+ + +

Demo

+ +Checkout the [demo page](./demo/) to see marked in action ⛹️ + +These documentation pages are also rendered using marked 💯 + + +

Installation

+ +**CLI:** `npm install -g marked` + +**In-browser:** `npm install marked --save` + +

Usage

+ +### Warning: 🚨 Marked does not [sanitize](https://marked.js.org/#/USING_ADVANCED.md#options) the output HTML by default 🚨 + +**CLI** + +``` bash +$ marked -o hello.html +hello world +^D +$ cat hello.html +

hello world

+``` + +``` bash +$ marked -s "*hello world*" +

hello world

+``` + +**Browser** + +```html + + + + + Marked in the browser + + +
+ + + + +``` + + +Marked offers [advanced configurations](#/USING_ADVANCED.md) and [extensibility](#/USING_PRO.md) as well. + +

Supported Markdown specifications

+ +We actively support the features of the following [Markdown flavors](https://github.com/commonmark/CommonMark/wiki/Markdown-Flavors). + +|Flavor |Version | +|:----------------------------------------------------------|:----------| +|The original markdown.pl |-- | +|[CommonMark](http://spec.commonmark.org/0.28/) |0.28 | +|[GitHub Flavored Markdown](https://github.github.com/gfm/) |0.28 | + +By supporting the above Markdown flavors, it's possible that Marked can help you use other flavors as well; however, these are not actively supported by the community. + +

Security

+ +The only completely secure system is the one that doesn't exist in the first place. Having said that, we take the security of Marked very seriously. + +Therefore, please disclose potential security issues by email to the project [committers](#/AUTHORS.md) as well as the [listed owners within NPM](https://docs.npmjs.com/cli/owner). We will provide an initial assessment of security reports within 48 hours and should apply patches within 2 weeks (also, feel free to contribute a fix for the issue). + diff --git a/docs/USING_ADVANCED.md b/docs/USING_ADVANCED.md new file mode 100644 index 00000000..1b2b84b1 --- /dev/null +++ b/docs/USING_ADVANCED.md @@ -0,0 +1,78 @@ +## The `marked` function + +```js +marked(markdownString [,options] [,callback]) +``` + +|Argument |Type |Notes | +|:---------------------|:------------|:----------------------------------------------------------------------------------------------------| +|markdownString |`string` |String of markdown source to be compiled. | +|options|`object`|Hash of options. Can also use `marked.setOptions`. | +|callback |`function` |Called when `markdownString` has been parsed. Can be used as second argument if no `options` present.| + +### Alternative using reference + +```js +// Create reference instance +var myMarked = require('marked'); + +// Set options +// `highlight` example uses `highlight.js` +myMarked.setOptions({ + renderer: new myMarked.Renderer(), + highlight: function(code) { + return require('highlight.js').highlightAuto(code).value; + }, + pedantic: false, + gfm: true, + tables: true, + breaks: false, + sanitize: false, + smartLists: true, + smartypants: false, + xhtml: false +}); + +// Compile +console.log(myMarked('I am using __markdown__.')); +``` + +

Options

+ +|Member |Type |Default |Since |Notes | +|:-----------|:---------|:--------|:--------|:-------------| +|baseUrl |`string` |`null` |??? |A prefix url for any relative link. | +|breaks |`boolean` |`false` |??? |If true, use GFM [hard](https://github.github.com/gfm/#hard-line-breaks) and [soft](https://github.github.com/gfm/#soft-line-breaks) line breaks. Requires `gfm` be `true`.| +|gfm |`boolean` |`true` |??? |If true, use approved [GitHub Flavored Markdown (GFM) specification](https://github.github.com/gfm/).| +|headerIds |`boolean` |`true` |v0.4.0 |If true, include an `id` attribute when emitting headings (h1, h2, h3, etc).| +|headerPrefix|`string` |`''` |??? |A string to prefix the `id` attribute when emitting headings (h1, h2, h3, etc).| +|highlight |`function`|`null` |??? |A function to highlight code blocks, see Asynchronous highlighting.| +|langPrefix |`string` |`'language-'`|??? |A string to prefix the className in a `` block. Useful for syntax highlighting.| +|mangle |`boolean` |`true` |??? |If true, autolinked email address is escaped with HTML character references.| +|pedantic |`boolean` |`false` |??? |If true, conform to the original `markdown.pl` as much as possible. Don't fix original markdown bugs or behavior. Turns off and overrides `gfm`.| +|renderer |`object` |`new Renderer()`|???|An object containing functions to render tokens to HTML. See [extensibility](USING_PRO.md) for more details.| +|sanitize |`boolean` |`false` |??? |If true, sanitize the HTML passed into `markdownString` with the `sanitizer` function.| +|sanitizer |`function`|`null` |??? |A function to sanitize the HTML passed into `markdownString`.| +|silent |`boolean` |`false` |??? |If true, the parser does not throw any exception.| +|smartLists |`boolean` |`false` |??? |If true, use smarter list behavior than those found in `markdown.pl`.| +|smartypants |`boolean` |`false` |??? |If true, use "smart" typographic punctuation for things like quotes and dashes.| +|tables |`boolean` |`true` |??? |If true and `gfm` is true, use [GFM Tables extension](https://github.github.com/gfm/#tables-extension-).| +|xhtml |`boolean` |`false` |??? |If true, emit self-closing HTML tags for void elements (<br/>, <img/>, etc.) with a "/" as required by XHTML.| + +

Asynchronous highlighting

+ +Unlike `highlight.js` the `pygmentize.js` library uses asynchronous highlighting. This example demonstrates that marked is agnostic when it comes to the highlighter you use. + +```js +myMarked.setOptions({ + highlight: function(code, lang, callback) { + require('pygmentize-bundled') ({ lang: lang, format: 'html' }, code, function (err, result) { + callback(err, result.toString()); + }); + } +}); + +console.log(myMarked(markdownString)); +``` + +In both examples, `code` is a `string` representing the section of code to pass to the highlighter. In this example, `lang` is a `string` informing the highlighter what programming lnaguage to use for the `code` and `callback` is the `function` the asynchronous highlighter will call once complete. diff --git a/docs/USING_PRO.md b/docs/USING_PRO.md new file mode 100644 index 00000000..0ae4a98d --- /dev/null +++ b/docs/USING_PRO.md @@ -0,0 +1,151 @@ +## Extending Marked + +To champion the single-reponsibility and open/closed prinicples, we have tried to make it relatively painless to extend marked. If you are looking to add custom functionality, this is the place to start. + +

The renderer

+ +The renderer is... + +**Example:** Overriding default heading token by adding an embedded anchor tag like on GitHub. + +```js +// Create reference instance +var myMarked = require('marked'); + +// Get reference +var renderer = new myMarked.Renderer(); + +// Override function +renderer.heading = function (text, level) { + var escapedText = text.toLowerCase().replace(/[^\w]+/g, '-'); + + return ` + + + + + ${text} + `; +}; + +// Run marked +console.log(myMarked('# heading+', { renderer: renderer })); +``` + +**Output:** + +```html +

+ + + + heading+ +

+``` + +### Block level renderer methods + +- code(*string* code, *string* language, *boolean* escaped) +- blockquote(*string* quote) +- html(*string* html) +- heading(*string* text, *number* level, *string* rawtext) +- hr() +- list(*string* body, *boolean* ordered, *number* start) +- listitem(*string* text) +- paragraph(*string* text) +- table(*string* header, *string* body) +- tablerow(*string* content) +- tablecell(*string* content, *object* flags) + +`flags` has the following properties: + +```js +{ + header: true || false, + align: 'center' || 'left' || 'right' +} +``` + +### Inline level renderer methods + +- strong(*string* text) +- em(*string* text) +- codespan(*string* code) +- br() +- del(*string* text) +- link(*string* href, *string* title, *string* text) +- image(*string* href, *string* title, *string* text) +- text(*string* text) + +

The lexer

+ +The lexer is... + + +

The parser

+ +The parser is... + +*** + +

Access to lexer and parser

+ +You also have direct access to the lexer and parser if you so desire. + +``` js +var tokens = marked.lexer(text, options); +console.log(marked.parser(tokens)); +``` + +``` js +var lexer = new marked.Lexer(options); +var tokens = lexer.lex(text); +console.log(tokens); +console.log(lexer.rules); +``` + +``` bash +$ node +> require('marked').lexer('> i am using marked.') +[ { type: 'blockquote_start' }, + { type: 'paragraph', + text: 'i am using marked.' }, + { type: 'blockquote_end' }, + links: {} ] +``` + +The Lexers build an array of tokens, which will be passed to their respective +Parsers. The Parsers process each token in the token arrays, +which are removed from the array of tokens: + +``` js +const marked = require('marked'); + +const md = ` + # heading + + [link][1] + + [1]: #heading "heading" +`; + +const tokens = marked.lexer(md); +console.log(tokens); + +const html = marked.parser(tokens); +console.log(html); + +console.log(tokens); +``` + +``` bash +[ { type: 'heading', depth: 1, text: 'heading' }, + { type: 'paragraph', text: ' [link][1]' }, + { type: 'space' }, + links: { '1': { href: '#heading', title: 'heading' } } ] + +

heading

+

link

+ +[ links: { '1': { href: '#heading', title: 'heading' } } ] +``` diff --git a/doc/broken.md b/docs/broken.md similarity index 100% rename from doc/broken.md rename to docs/broken.md diff --git a/docs/demo/demo.css b/docs/demo/demo.css new file mode 100644 index 00000000..e459d868 --- /dev/null +++ b/docs/demo/demo.css @@ -0,0 +1,63 @@ +html, body { + margin: 0; + padding: 0; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + color: #333; + background-color: #fbfbfb; + height: 100%; +} + +textarea { + font-family: Menlo, Monaco, Consolas, "Courier New", monospace; + font-size: 12px; + resize: none; +} + +header { + padding-top: 10px; + display: flex; + height: 58px; +} + +header h1 { + margin: 0; +} + +.github-ribbon { + position: absolute; + top: 0; + right: 0; + border: 0; + z-index: 1000; +} + +.containers { + display: flex; + height: calc(100vh - 68px); +} + +.container { + flex-basis: 50%; + padding: 5px; + display: flex; + flex-direction: column; + height: 100%; + box-sizing: border-box; +} + +.pane, #input { + margin-top: 5px; + padding: 0.6em; + border: 1px solid #ccc; + overflow: auto; + flex-grow: 1; + flex-shrink: 1; +} + +#preview { + display: flex; +} + +#preview iframe { + flex-grow: 1; +} diff --git a/docs/demo/demo.js b/docs/demo/demo.js new file mode 100644 index 00000000..f1272459 --- /dev/null +++ b/docs/demo/demo.js @@ -0,0 +1,184 @@ +/* globals marked, unfetch, ES6Promise */ + +if (!window.Promise) { + window.Promise = ES6Promise; +} +if (!window.fetch) { + window.fetch = unfetch; +} + +var $inputElem = document.querySelector('#input'); +var $outputTypeElem = document.querySelector('#outputType'); +var $previewIframe = document.querySelector('#preview iframe'); +var $permalinkElem = document.querySelector('#permalink'); +var $clearElem = document.querySelector('#clear'); +var $htmlElem = document.querySelector('#html'); +var $lexerElem = document.querySelector('#lexer'); +var $panes = document.querySelectorAll('.pane'); +var inputDirty = true; +var $activeElem = null; +var changeTimeout = null; +var search = searchToObject(); + +var iframeLoaded = false; +$previewIframe.addEventListener('load', function () { + iframeLoaded = true; + inputDirty = true; + checkForChanges(); +}) + +if ('text' in search) { + $inputElem.value = search.text; +} else { + fetch('./initial.md') + .then(function (res) { return res.text(); }) + .then(function (text) { + if ($inputElem.value === '') { + $inputElem.value = text; + inputDirty = true; + clearTimeout(changeTimeout); + checkForChanges(); + setScrollPercent(0); + } + }); +} + +if (search.outputType) { + $outputTypeElem.value = search.outputType; +} + +fetch('./quickref.md') + .then(function (res) { return res.text(); }) + .then(function (text) { + document.querySelector('#quickref').value = text; + }); + +function handleChange() { + for (var i = 0; i < $panes.length; i++) { + $panes[i].style.display = 'none'; + } + $activeElem = document.querySelector('#' + $outputTypeElem.value); + $activeElem.style.display = ''; + + updateLink(); +}; + +$outputTypeElem.addEventListener('change', handleChange, false); +handleChange(); + +function handleInput() { + inputDirty = true; +}; + +$inputElem.addEventListener('change', handleInput, false); +$inputElem.addEventListener('keyup', handleInput, false); +$inputElem.addEventListener('keypress', handleInput, false); +$inputElem.addEventListener('keydown', handleInput, false); + +$clearElem.addEventListener('click', function () { + $inputElem.value = ''; + handleInput(); +}, false); + +function searchToObject() { + // modified from https://stackoverflow.com/a/7090123/806777 + var pairs = location.search.slice(1).split('&'); + var obj = {}; + + for (var i = 0; i < pairs.length; i++) { + if (pairs[i] === '') { + continue; + } + + var pair = pairs[i].split('='); + + obj[decodeURIComponent(pair.shift())] = decodeURIComponent(pair.join('=')); + } + + return obj; +} + +function jsonString(input) { + var output = (input + '') + .replace(/\n/g, '\\n') + .replace(/\r/g, '\\r') + .replace(/\t/g, '\\t') + .replace(/\f/g, '\\f') + .replace(/[\\"']/g, '\\$&') + .replace(/\u0000/g, '\\0'); + return '"' + output + '"'; +}; + +function getScrollSize() { + var e = $activeElem; + + return e.scrollHeight - e.clientHeight; +}; +function getScrollPercent() { + var size = getScrollSize(); + + if (size <= 0) { + return 1; + } + + return $activeElem.scrollTop / size; +}; +function setScrollPercent(percent) { + $activeElem.scrollTop = percent * getScrollSize(); +}; + +function updateLink() { + var outputType = ''; + if ($outputTypeElem.value !== 'preview') { + outputType = 'outputType=' + $outputTypeElem.value + '&'; + } + + $permalinkElem.href = '?' + outputType + 'text=' + encodeURIComponent($inputElem.value); + history.replaceState('', document.title, $permalinkElem.href); +} + +var delayTime = 1; +function checkForChanges() { + if (inputDirty) { + inputDirty = false; + + updateLink(); + + var startTime = new Date(); + + var scrollPercent = getScrollPercent(); + + var lexed = marked.lexer($inputElem.value); + + var lexedList = []; + + for (var i = 0; i < lexed.length; i++) { + var lexedLine = []; + for (var j in lexed[i]) { + lexedLine.push(j + ':' + jsonString(lexed[i][j])); + } + lexedList.push('{' + lexedLine.join(', ') + '}'); + } + + var parsed = marked.parser(lexed); + + if (iframeLoaded) { + $previewIframe.contentDocument.body.innerHTML = (parsed); + } + $htmlElem.value = (parsed); + $lexerElem.value = (lexedList.join('\n')); + + setScrollPercent(scrollPercent); + + var endTime = new Date(); + delayTime = endTime - startTime; + if (delayTime < 50) { + delayTime = 50; + } else if (delayTime > 500) { + delayTime = 1000; + } + } + changeTimeout = window.setTimeout(checkForChanges, delayTime); +}; +checkForChanges(); +setScrollPercent(0); diff --git a/docs/demo/index.html b/docs/demo/index.html new file mode 100644 index 00000000..57062e9a --- /dev/null +++ b/docs/demo/index.html @@ -0,0 +1,61 @@ + + + + + Marked Demo + + + + + + Fork me on GitHub + + +
+ + + +

Marked Demo

+
+ +
+
+
+ Input · + · + +
+ +
+ +
+
+ +
+ +
+ + +
+ + + + + + +
+
+ + + + + + + diff --git a/docs/demo/initial.md b/docs/demo/initial.md new file mode 100644 index 00000000..2465aef0 --- /dev/null +++ b/docs/demo/initial.md @@ -0,0 +1,36 @@ +Marked - Markdown Parser +======================== + +[Marked] lets you convert [Markdown] into HTML. Markdown is a simple text format whose goal is to be very easy to read and write, even when not converted to HTML. This demo page will let you type anything you like and see how it gets converted. Live. No more waiting around. + +How To Use The Demo +------------------- + +1. Type in stuff on the left. +2. See the live updates on the right. + +That's it. Pretty simple. There's also a drop-down option in the upper right to switch between various views: + +- **Preview:** A live display of the generated HTML as it would render in a browser. +- **HTML Source:** The generated HTML before your browser makes it pretty. +- **Lexer Data:** What [marked] uses internally, in case you like gory stuff like this. +- **Quick Reference:** A brief run-down of how to format things using markdown. + +Why Markdown? +------------- + +It's easy. It's not overly bloated, unlike HTML. Also, as the creator of [markdown] says, + +> The overriding design goal for Markdown's +> formatting syntax is to make it as readable +> as possible. The idea is that a +> Markdown-formatted document should be +> publishable as-is, as plain text, without +> looking like it's been marked up with tags +> or formatting instructions. + +Ready to start writing? Either start changing stuff on the left or +[clear everything](?text=) with a simple click. + +[Marked]: https://github.com/markedjs/marked/ +[Markdown]: http://daringfireball.net/projects/markdown/ diff --git a/docs/demo/preview.html b/docs/demo/preview.html new file mode 100644 index 00000000..7e8c89fe --- /dev/null +++ b/docs/demo/preview.html @@ -0,0 +1,12 @@ + + + + + + marked.js preview + + + + + + diff --git a/docs/demo/quickref.md b/docs/demo/quickref.md new file mode 100644 index 00000000..10f09bda --- /dev/null +++ b/docs/demo/quickref.md @@ -0,0 +1,167 @@ +Markdown Quick Reference +======================== + +This guide is a very brief overview, with examples, of the syntax that [Markdown] supports. It is itself written in Markdown and you can copy the samples over to the left-hand pane for experimentation. It's shown as *text* and not *rendered HTML*. + +[Markdown]: http://daringfireball.net/projects/markdown/ + + +Simple Text Formatting +====================== + +First thing is first. You can use *stars* or _underscores_ for italics. **Double stars** and __double underscores__ do bold. ***Three together*** do ___both___. + +Paragraphs are pretty easy too. Just have a blank line between chunks of text. + +> This chunk of text is in a block quote. Its multiple lines will all be +> indended a bit from the rest of the text. +> +> > Multiple levels of block quotes also work. + +Sometimes you want to include some code, such as when you are explaining how `

` HTML tags work, or maybe you are a programmer and you are discussing `someMethod()`. + +If you want to include some code and have +newlines preserved, indent the line with a tab +or at least four spaces. + Extra spaces work here too. +This is also called preformatted text and it is useful for showing examples. +The text will stay as text, so any *markdown* or HTML you add will +not show up formatted. This way you can show markdown examples in a +markdown document. + +> You can also use preformatted text with your blockquotes +> as long as you add at least five spaces. + + +Headings +======== + +There are a couple of ways to make headings. Using three or more equals signs on a line under a heading makes it into an "h1" style. Three or more hyphens under a line makes it "h2" (slightly smaller). You can also use multiple pound symbols before and after a heading. Pounds after the title are ignored. Here's some examples: + +This is H1 +========== + +This is H2 +---------- + +# This is H1 +## This is H2 +### This is H3 with some extra pounds ### +#### You get the idea #### +##### I don't need extra pounds at the end +###### H6 is the max + + +Links +===== + +Let's link to a few sites. First, let's use the bare URL, like . Great for text, but ugly for HTML. +Next is an inline link to [Google](http://www.google.com). A little nicer. +This is a reference-style link to [Wikipedia] [1]. +Lastly, here's a pretty link to [Yahoo]. The reference-style and pretty links both automatically use the links defined below, but they could be defined *anywhere* in the markdown and are removed from the HTML. The names are also case insensitive, so you can use [YaHoO] and have it link properly. + +[1]: http://www.wikipedia.org/ +[Yahoo]: http://www.yahoo.com/ + +Title attributes may be added to links by adding text after a link. +This is the [inline link](http://www.bing.com "Bing") with a "Bing" title. +You can also go to [W3C] [2] and maybe visit a [friend]. + +[2]: http://w3c.org (The W3C puts out specs for web-based things) +[Friend]: http://facebook.com/ "Facebook!" + +Email addresses in plain text are not linked: test@example.com. +Email addresses wrapped in angle brackets are linked: . +They are also obfuscated so that email harvesting spam robots hopefully won't get them. + + +Lists +===== + +* This is a bulleted list +* Great for shopping lists +- You can also use hyphens ++ Or plus symbols + +The above is an "unordered" list. Now, on for a bit of order. + +1. Numbered lists are also easy +2. Just start with a number +3738762. However, the actual number doesn't matter when converted to HTML. +1. This will still show up as 4. + +You might want a few advanced lists: + +- This top-level list is wrapped in paragraph tags +- This generates an extra space between each top-level item. + +- You do it by adding a blank line + +- This nested list also has blank lines between the list items. + +- How to create nested lists +1. Start your regular list +2. Indent nested lists with four spaces +3. Further nesting means you should indent with four more spaces + * This line is indented with eight spaces. + +- List items can be quite lengthy. You can keep typing and either continue +them on the next line with no indentation. + +- Alternately, if that looks ugly, you can also +indent the next line a bit for a prettier look. + +- You can put large blocks of text in your list by just indenting with four spaces. + +This is formatted the same as code, but you can inspect the HTML +and find that it's just wrapped in a `

` tag and *won't* be shown +as preformatted text. + +You can keep adding more and more paragraphs to a single +list item by adding the traditional blank line and then keep +on indenting the paragraphs with four spaces. You really need +to only indent the first line, but that looks ugly. + +- Lists support blockquotes + +> Just like this example here. By the way, you can +> nest lists inside blockquotes! +> - Fantastic! + +- Lists support preformatted text + + You just need to indent eight spaces. + + +Even More +========= + +Horizontal Rule +--------------- + +If you need a horizontal rule you just need to put at least three hyphens, asterisks, or underscores on a line by themselves. You can also even put spaces between the characters. + +--- +**************************** +_ _ _ _ _ _ _ + +Those three all produced horizontal lines. Keep in mind that three hyphens under any text turns that text into a heading, so add a blank like if you use hyphens. + +Images +------ + +Images work exactly like links, but they have exclamation points in front. They work with references and titles too. + +![Google Logo](http://www.google.com/images/errors/logo_sm.gif) and ![Happy]. + +[Happy]: http://www.wpclipart.com/smiley/simple_smiley/smiley_face_simple_green_small.png ("Smiley face") + + +Inline HTML +----------- + +If markdown is too limiting, you can just insert your own crazy HTML. Span-level HTML can *still* use markdown. Block level elements must be separated from text by a blank line and must not have any spaces before the opening and closing HTML. + +

+It is a pity, but markdown does **not** work in here for most markdown parsers. [Marked] handles it pretty well. +
diff --git a/docs/img/logo-black-and-white.svg b/docs/img/logo-black-and-white.svg new file mode 100644 index 00000000..5f6c0b78 --- /dev/null +++ b/docs/img/logo-black-and-white.svg @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/img/logo-black.svg b/docs/img/logo-black.svg new file mode 100644 index 00000000..a67fb80e --- /dev/null +++ b/docs/img/logo-black.svg @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 00000000..14c1b153 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,269 @@ + + + + + Marked.js Documentation + + + + + + +
+
+ + + +

Marked.js Documentation

+
+ +
+ + + + + + diff --git a/jasmine.json b/jasmine.json new file mode 100644 index 00000000..8d1be919 --- /dev/null +++ b/jasmine.json @@ -0,0 +1,11 @@ +{ + "spec_dir": "test", + "spec_files": [ + "**/*-spec.js" + ], + "helpers": [ + "helpers/**/*.js" + ], + "stopSpecOnExpectationFailure": false, + "random": true +} diff --git a/lib/marked.js b/lib/marked.js index e5c27514..f2fb9b6b 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -1,10 +1,10 @@ /** * marked - a markdown parser - * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed) - * https://github.com/chjj/marked + * Copyright (c) 2011-2018, Christopher Jeffrey. (MIT Licensed) + * https://github.com/markedjs/marked */ -;(function() { +;(function(root) { 'use strict'; /** @@ -16,59 +16,69 @@ var block = { code: /^( {4}[^\n]+\n*)+/, fences: noop, hr: /^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/, - heading: /^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/, + heading: /^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/, nptable: noop, blockquote: /^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/, list: /^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/, - html: /^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/, + html: '^ {0,3}(?:' // optional indentation + + '<(script|pre|style)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)' // (1) + + '|comment[^\\n]*(\\n+|$)' // (2) + + '|<\\?[\\s\\S]*?\\?>\\n*' // (3) + + '|\\n*' // (4) + + '|\\n*' // (5) + + '|)[\\s\\S]*?(?:\\n{2,}|$)' // (6) + + '|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$)' // (7) open tag + + '|(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$)' // (7) closing tag + + ')', def: /^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/, table: noop, lheading: /^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/, - paragraph: /^([^\n]+(?:\n?(?!hr|heading|lheading| {0,3}>|tag)[^\n]+)+)/, + paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading| {0,3}>|<\/?(?:tag)(?: +|\n|\/?>)|<(?:script|pre|style|!--))[^\n]+)*)/, text: /^[^\n]+/ }; -block._label = /(?:\\[\[\]]|[^\[\]])+/; -block._title = /(?:"(?:\\"|[^"]|"[^"\n]*")*"|'\n?(?:[^'\n]+\n?)*'|\([^()]*\))/; -block.def = replace(block.def) - ('label', block._label) - ('title', block._title) - (); +block._label = /(?!\s*\])(?:\\[\[\]]|[^\[\]])+/; +block._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/; +block.def = edit(block.def) + .replace('label', block._label) + .replace('title', block._title) + .getRegex(); block.bullet = /(?:[*+-]|\d+\.)/; block.item = /^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/; -block.item = replace(block.item, 'gm') - (/bull/g, block.bullet) - (); +block.item = edit(block.item, 'gm') + .replace(/bull/g, block.bullet) + .getRegex(); -block.list = replace(block.list) - (/bull/g, block.bullet) - ('hr', '\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))') - ('def', '\\n+(?=' + block.def.source + ')') - (); +block.list = edit(block.list) + .replace(/bull/g, block.bullet) + .replace('hr', '\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))') + .replace('def', '\\n+(?=' + block.def.source + ')') + .getRegex(); -block._tag = '(?!(?:' - + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code' - + '|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo' - + '|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b'; +block._tag = 'address|article|aside|base|basefont|blockquote|body|caption' + + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption' + + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe' + + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option' + + '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr' + + '|track|ul'; +block._comment = //; +block.html = edit(block.html, 'i') + .replace('comment', block._comment) + .replace('tag', block._tag) + .replace('attribute', / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/) + .getRegex(); -block.html = replace(block.html) - ('comment', //) - ('closed', /<(tag)[\s\S]+?<\/\1>/) - ('closing', /]*)*?\/?>/) - (/tag/g, block._tag) - (); +block.paragraph = edit(block.paragraph) + .replace('hr', block.hr) + .replace('heading', block.heading) + .replace('lheading', block.lheading) + .replace('tag', block._tag) // pars can be interrupted by type (6) html blocks + .getRegex(); -block.paragraph = replace(block.paragraph) - ('hr', block.hr) - ('heading', block.heading) - ('lheading', block.lheading) - ('tag', '<' + block._tag) - (); - -block.blockquote = replace(block.blockquote) - ('paragraph', block.paragraph) - (); +block.blockquote = edit(block.blockquote) + .replace('paragraph', block.paragraph) + .getRegex(); /** * Normal Block Grammar @@ -86,19 +96,37 @@ block.gfm = merge({}, block.normal, { heading: /^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/ }); -block.gfm.paragraph = replace(block.paragraph) - ('(?!', '(?!' +block.gfm.paragraph = edit(block.paragraph) + .replace('(?!', '(?!' + block.gfm.fences.source.replace('\\1', '\\2') + '|' + block.list.source.replace('\\1', '\\3') + '|') - (); + .getRegex(); /** * GFM + Tables Block Grammar */ block.tables = merge({}, block.gfm, { - nptable: /^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/, - table: /^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/ + nptable: /^ *([^|\n ].*\|.*)\n *([-:]+ *\|[-| :]*)(?:\n((?:.*[^>\n ].*(?:\n|$))*)\n*|$)/, + table: /^ *\|(.+)\n *\|?( *[-:]+[-| :]*)(?:\n((?: *[^>\n ].*(?:\n|$))*)\n*|$)/ +}); + +/** + * Pedantic grammar + */ + +block.pedantic = merge({}, block.normal, { + html: edit( + '^ *(?:comment *(?:\\n|\\s*$)' + + '|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)' // closed tag + + '|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))') + .replace('comment', block._comment) + .replace(/tag/g, '(?!(?:' + + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub' + + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)' + + '\\b)\\w+(?!:|[^\\w\\s@]*@)\\b') + .getRegex(), + def: /^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/ }); /** @@ -107,11 +135,13 @@ block.tables = merge({}, block.gfm, { function Lexer(options) { this.tokens = []; - this.tokens.links = {}; + this.tokens.links = Object.create(null); this.options = options || marked.defaults; this.rules = block.normal; - if (this.options.gfm) { + if (this.options.pedantic) { + this.rules = block.pedantic; + } else if (this.options.gfm) { if (this.options.tables) { this.rules = block.tables; } else { @@ -154,17 +184,23 @@ Lexer.prototype.lex = function(src) { */ Lexer.prototype.token = function(src, top) { - var src = src.replace(/^ +$/gm, '') - , next - , loose - , cap - , bull - , b - , item - , space - , i - , tag - , l; + src = src.replace(/^ +$/gm, ''); + var next, + loose, + cap, + bull, + b, + item, + listStart, + listItems, + t, + space, + i, + tag, + l, + isordered, + istask, + ischecked; while (src) { // newline @@ -184,7 +220,7 @@ Lexer.prototype.token = function(src, top) { this.tokens.push({ type: 'code', text: !this.options.pedantic - ? cap.replace(/\n+$/, '') + ? rtrim(cap, '\n') : cap }); continue; @@ -214,34 +250,36 @@ Lexer.prototype.token = function(src, top) { // table no leading pipe (gfm) if (top && (cap = this.rules.nptable.exec(src))) { - src = src.substring(cap[0].length); - item = { type: 'table', - header: cap[1].replace(/^ *| *\| *$/g, '').split(/ *\| */), + header: splitCells(cap[1].replace(/^ *| *\| *$/g, '')), align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), - cells: cap[3].replace(/\n$/, '').split('\n') + cells: cap[3] ? cap[3].replace(/\n$/, '').split('\n') : [] }; - for (i = 0; i < item.align.length; i++) { - if (/^ *-+: *$/.test(item.align[i])) { - item.align[i] = 'right'; - } else if (/^ *:-+: *$/.test(item.align[i])) { - item.align[i] = 'center'; - } else if (/^ *:-+ *$/.test(item.align[i])) { - item.align[i] = 'left'; - } else { - item.align[i] = null; + if (item.header.length === item.align.length) { + src = src.substring(cap[0].length); + + for (i = 0; i < item.align.length; i++) { + if (/^ *-+: *$/.test(item.align[i])) { + item.align[i] = 'right'; + } else if (/^ *:-+: *$/.test(item.align[i])) { + item.align[i] = 'center'; + } else if (/^ *:-+ *$/.test(item.align[i])) { + item.align[i] = 'left'; + } else { + item.align[i] = null; + } } + + for (i = 0; i < item.cells.length; i++) { + item.cells[i] = splitCells(item.cells[i], item.header.length); + } + + this.tokens.push(item); + + continue; } - - for (i = 0; i < item.cells.length; i++) { - item.cells[i] = item.cells[i].split(/ *\| */); - } - - this.tokens.push(item); - - continue; } // hr @@ -279,15 +317,21 @@ Lexer.prototype.token = function(src, top) { if (cap = this.rules.list.exec(src)) { src = src.substring(cap[0].length); bull = cap[2]; + isordered = bull.length > 1; - this.tokens.push({ + listStart = { type: 'list_start', - ordered: bull.length > 1 - }); + ordered: isordered, + start: isordered ? +bull : '', + loose: false + }; + + this.tokens.push(listStart); // Get each top-level item. cap = cap[0].match(this.rules.item); + listItems = []; next = false; l = cap.length; i = 0; @@ -328,11 +372,27 @@ Lexer.prototype.token = function(src, top) { if (!loose) loose = next; } - this.tokens.push({ - type: loose - ? 'loose_item_start' - : 'list_item_start' - }); + if (loose) { + listStart.loose = true; + } + + // Check for task list items + istask = /^\[[ xX]\] /.test(item); + ischecked = undefined; + if (istask) { + ischecked = item[1] !== ' '; + item = item.replace(/^\[[ xX]\] +/, ''); + } + + t = { + type: 'list_item_start', + task: istask, + checked: ischecked, + loose: loose + }; + + listItems.push(t); + this.tokens.push(t); // Recurse. this.token(item, false); @@ -342,6 +402,14 @@ Lexer.prototype.token = function(src, top) { }); } + if (listStart.loose) { + l = listItems.length; + i = 0; + for (; i < l; i++) { + listItems[i].loose = true; + } + } + this.tokens.push({ type: 'list_end' }); @@ -366,8 +434,8 @@ Lexer.prototype.token = function(src, top) { // def if (top && (cap = this.rules.def.exec(src))) { src = src.substring(cap[0].length); - if (cap[3]) cap[3] = cap[3].substring(1,cap[3].length-1); - tag = cap[1].toLowerCase(); + if (cap[3]) cap[3] = cap[3].substring(1, cap[3].length - 1); + tag = cap[1].toLowerCase().replace(/\s+/g, ' '); if (!this.tokens.links[tag]) { this.tokens.links[tag] = { href: cap[2], @@ -379,36 +447,38 @@ Lexer.prototype.token = function(src, top) { // table (gfm) if (top && (cap = this.rules.table.exec(src))) { - src = src.substring(cap[0].length); - item = { type: 'table', - header: cap[1].replace(/^ *| *\| *$/g, '').split(/ *\| */), + header: splitCells(cap[1].replace(/^ *| *\| *$/g, '')), align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), - cells: cap[3].replace(/(?: *\| *)?\n$/, '').split('\n') + cells: cap[3] ? cap[3].replace(/(?: *\| *)?\n$/, '').split('\n') : [] }; - for (i = 0; i < item.align.length; i++) { - if (/^ *-+: *$/.test(item.align[i])) { - item.align[i] = 'right'; - } else if (/^ *:-+: *$/.test(item.align[i])) { - item.align[i] = 'center'; - } else if (/^ *:-+ *$/.test(item.align[i])) { - item.align[i] = 'left'; - } else { - item.align[i] = null; + if (item.header.length === item.align.length) { + src = src.substring(cap[0].length); + + for (i = 0; i < item.align.length; i++) { + if (/^ *-+: *$/.test(item.align[i])) { + item.align[i] = 'right'; + } else if (/^ *:-+: *$/.test(item.align[i])) { + item.align[i] = 'center'; + } else if (/^ *:-+ *$/.test(item.align[i])) { + item.align[i] = 'left'; + } else { + item.align[i] = null; + } } + + for (i = 0; i < item.cells.length; i++) { + item.cells[i] = splitCells( + item.cells[i].replace(/^ *\| *| *\| *$/g, ''), + item.header.length); + } + + this.tokens.push(item); + + continue; } - - for (i = 0; i < item.cells.length; i++) { - item.cells[i] = item.cells[i] - .replace(/^ *\| *| *\| *$/g, '') - .split(/ *\| */); - } - - this.tokens.push(item); - - continue; } // lheading @@ -446,8 +516,7 @@ Lexer.prototype.token = function(src, top) { } if (src) { - throw new - Error('Infinite loop on byte: ' + src.charCodeAt(0)); + throw new Error('Infinite loop on byte: ' + src.charCodeAt(0)); } } @@ -459,40 +528,55 @@ Lexer.prototype.token = function(src, top) { */ var inline = { - escape: /^\\([\\`*{}\[\]()#+\-.!_>])/, + escape: /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, autolink: /^<(scheme:[^\s\x00-\x1f<>]*|email)>/, url: noop, - tag: /^|^<\/?[a-zA-Z0-9\-]+(?:"[^"]*"|'[^']*'|\s[^<'">\/]*)*?\/?>/, - link: /^!?\[(inside)\]\(href\)/, - reflink: /^!?\[(inside)\]\s*\[([^\]]*)\]/, - nolink: /^!?\[((?:\[[^\]]*\]|\\[\[\]]|[^\[\]])*)\]/, - strong: /^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/, - em: /^_([^\s_](?:[^_]|__)+?[^\s_])_\b|^\*((?:\*\*|[^*])+?)\*(?!\*)/, - code: /^(`+)(\s*)([\s\S]*?[^`]?)\2\1(?!`)/, - br: /^ {2,}\n(?!\s*$)/, + tag: '^comment' + + '|^' // self-closing tag + + '|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>' // open tag + + '|^<\\?[\\s\\S]*?\\?>' // processing instruction, e.g. + + '|^' // declaration, e.g. + + '|^', // CDATA section + link: /^!?\[(label)\]\(href(?:\s+(title))?\s*\)/, + reflink: /^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/, + nolink: /^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/, + strong: /^__([^\s])__(?!_)|^\*\*([^\s])\*\*(?!\*)|^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)/, + em: /^_([^\s_])_(?!_)|^\*([^\s*"<\[])\*(?!\*)|^_([^\s][\s\S]*?[^\s_])_(?!_)|^_([^\s_][\s\S]*?[^\s])_(?!_)|^\*([^\s"<\[][\s\S]*?[^\s*])\*(?!\*)|^\*([^\s*"<\[][\s\S]*?[^\s])\*(?!\*)/, + code: /^(`+)\s*([\s\S]*?[^`]?)\s*\1(?!`)/, + br: /^( {2,}|\\)\n(?!\s*$)/, del: noop, text: /^[\s\S]+?(?=[\\?@\[\]\\^_`{|}~])/g; + inline._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/; inline._email = /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/; +inline.autolink = edit(inline.autolink) + .replace('scheme', inline._scheme) + .replace('email', inline._email) + .getRegex(); -inline.autolink = replace(inline.autolink) - ('scheme', inline._scheme) - ('email', inline._email) - () +inline._attribute = /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/; -inline._inside = /(?:\[[^\]]*\]|\\[\[\]]|[^\[\]]|\](?=[^\[]*\]))*/; -inline._href = /\s*?(?:\s+['"]([\s\S]*?)['"])?\s*/; +inline.tag = edit(inline.tag) + .replace('comment', block._comment) + .replace('attribute', inline._attribute) + .getRegex(); -inline.link = replace(inline.link) - ('inside', inline._inside) - ('href', inline._href) - (); +inline._label = /(?:\[[^\[\]]*\]|\\[\[\]]?|`[^`]*`|[^\[\]\\])*?/; +inline._href = /\s*(<(?:\\[<>]?|[^\s<>\\])*>|(?:\\[()]?|\([^\s\x00-\x1f\\]*\)|[^\s\x00-\x1f()\\])*?)/; +inline._title = /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/; -inline.reflink = replace(inline.reflink) - ('inside', inline._inside) - (); +inline.link = edit(inline.link) + .replace('label', inline._label) + .replace('href', inline._href) + .replace('title', inline._title) + .getRegex(); + +inline.reflink = edit(inline.reflink) + .replace('label', inline._label) + .getRegex(); /** * Normal Inline Grammar @@ -506,7 +590,13 @@ inline.normal = merge({}, inline); inline.pedantic = merge({}, inline.normal, { strong: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/, - em: /^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/ + em: /^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/, + link: edit(/^!?\[(label)\]\((.*?)\)/) + .replace('label', inline._label) + .getRegex(), + reflink: edit(/^!?\[(label)\]\s*\[([^\]]*)\]/) + .replace('label', inline._label) + .getRegex() }); /** @@ -514,16 +604,16 @@ inline.pedantic = merge({}, inline.normal, { */ inline.gfm = merge({}, inline.normal, { - escape: replace(inline.escape)('])', '~|])')(), - url: replace(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/) - ('email', inline._email) - (), + escape: edit(inline.escape).replace('])', '~|])').getRegex(), + url: edit(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/) + .replace('email', inline._email) + .getRegex(), _backpedal: /(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/, - del: /^~~(?=\S)([\s\S]*?\S)~~/, - text: replace(inline.text) - (']|', '~]|') - ('|', '|https?://|ftp://|www\\.|[a-zA-Z0-9.!#$%&\'*+/=?^_`{\\|}~-]+@|') - () + del: /^~+(?=\S)([\s\S]*?\S)~+/, + text: edit(inline.text) + .replace(']|', '~]|') + .replace('|', '|https?://|ftp://|www\\.|[a-zA-Z0-9.!#$%&\'*+/=?^_`{\\|}~-]+@|') + .getRegex() }); /** @@ -531,8 +621,8 @@ inline.gfm = merge({}, inline.normal, { */ inline.breaks = merge({}, inline.gfm, { - br: replace(inline.br)('{2,}', '*')(), - text: replace(inline.gfm.text)('{2,}', '*')() + br: edit(inline.br).replace('{2,}', '*').getRegex(), + text: edit(inline.gfm.text).replace('{2,}', '*').getRegex() }); /** @@ -543,22 +633,21 @@ function InlineLexer(links, options) { this.options = options || marked.defaults; this.links = links; this.rules = inline.normal; - this.renderer = this.options.renderer || new Renderer; + this.renderer = this.options.renderer || new Renderer(); this.renderer.options = this.options; if (!this.links) { - throw new - Error('Tokens array requires a `links` property.'); + throw new Error('Tokens array requires a `links` property.'); } - if (this.options.gfm) { + if (this.options.pedantic) { + this.rules = inline.pedantic; + } else if (this.options.gfm) { if (this.options.breaks) { this.rules = inline.breaks; } else { this.rules = inline.gfm; } - } else if (this.options.pedantic) { - this.rules = inline.pedantic; } } @@ -582,11 +671,13 @@ InlineLexer.output = function(src, links, options) { */ InlineLexer.prototype.output = function(src) { - var out = '' - , link - , text - , href - , cap; + var out = '', + link, + text, + href, + title, + cap, + prevCapZero; while (src) { // escape @@ -612,7 +703,10 @@ InlineLexer.prototype.output = function(src) { // url (gfm) if (!this.inLink && (cap = this.rules.url.exec(src))) { - cap[0] = this.rules._backpedal.exec(cap[0])[0]; + do { + prevCapZero = cap[0]; + cap[0] = this.rules._backpedal.exec(cap[0])[0]; + } while (prevCapZero !== cap[0]); src = src.substring(cap[0].length); if (cap[2] === '@') { text = escape(cap[0]); @@ -649,9 +743,23 @@ InlineLexer.prototype.output = function(src) { if (cap = this.rules.link.exec(src)) { src = src.substring(cap[0].length); this.inLink = true; + href = cap[2]; + if (this.options.pedantic) { + link = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(href); + + if (link) { + href = link[1]; + title = link[3]; + } else { + title = ''; + } + } else { + title = cap[3] ? cap[3].slice(1, -1) : ''; + } + href = href.trim().replace(/^<([\s\S]*)>$/, '$1'); out += this.outputLink(cap, { - href: cap[2], - title: cap[3] + href: InlineLexer.escapes(href), + title: InlineLexer.escapes(title) }); this.inLink = false; continue; @@ -677,21 +785,21 @@ InlineLexer.prototype.output = function(src) { // strong if (cap = this.rules.strong.exec(src)) { src = src.substring(cap[0].length); - out += this.renderer.strong(this.output(cap[2] || cap[1])); + out += this.renderer.strong(this.output(cap[4] || cap[3] || cap[2] || cap[1])); continue; } // em if (cap = this.rules.em.exec(src)) { src = src.substring(cap[0].length); - out += this.renderer.em(this.output(cap[2] || cap[1])); + out += this.renderer.em(this.output(cap[6] || cap[5] || cap[4] || cap[3] || cap[2] || cap[1])); continue; } // code if (cap = this.rules.code.exec(src)) { src = src.substring(cap[0].length); - out += this.renderer.codespan(escape(cap[3].trim(), true)); + out += this.renderer.codespan(escape(cap[2].trim(), true)); continue; } @@ -717,21 +825,24 @@ InlineLexer.prototype.output = function(src) { } if (src) { - throw new - Error('Infinite loop on byte: ' + src.charCodeAt(0)); + throw new Error('Infinite loop on byte: ' + src.charCodeAt(0)); } } return out; }; +InlineLexer.escapes = function(text) { + return text ? text.replace(InlineLexer.rules._escapes, '$1') : text; +} + /** * Compile Link */ InlineLexer.prototype.outputLink = function(cap, link) { - var href = escape(link.href) - , title = link.title ? escape(link.title) : null; + var href = link.href, + title = link.title ? escape(link.title) : null; return cap[0].charAt(0) !== '!' ? this.renderer.link(href, title, this.output(cap[1])) @@ -767,10 +878,10 @@ InlineLexer.prototype.smartypants = function(text) { InlineLexer.prototype.mangle = function(text) { if (!this.options.mangle) return text; - var out = '' - , l = text.length - , i = 0 - , ch; + var out = '', + l = text.length, + i = 0, + ch; for (; i < l; i++) { ch = text.charCodeAt(i); @@ -788,7 +899,7 @@ InlineLexer.prototype.mangle = function(text) { */ function Renderer(options) { - this.options = options || {}; + this.options = options || marked.defaults; } Renderer.prototype.code = function(code, lang, escaped) { @@ -803,7 +914,7 @@ Renderer.prototype.code = function(code, lang, escaped) { if (!lang) { return '
'
       + (escaped ? code : escape(code, true))
-      + '\n
'; + + '
'; } return '
'
     + (escaped ? code : escape(code, true))
-    + '\n
\n'; + + '\n'; }; Renderer.prototype.blockquote = function(quote) { @@ -823,43 +934,56 @@ Renderer.prototype.html = function(html) { }; Renderer.prototype.heading = function(text, level, raw) { - return '' - + text - + '\n'; + if (this.options.headerIds) { + return '' + + text + + '\n'; + } + // ignore IDs + return '' + text + '\n'; }; Renderer.prototype.hr = function() { return this.options.xhtml ? '
\n' : '
\n'; }; -Renderer.prototype.list = function(body, ordered) { - var type = ordered ? 'ol' : 'ul'; - return '<' + type + '>\n' + body + '\n'; +Renderer.prototype.list = function(body, ordered, start) { + var type = ordered ? 'ol' : 'ul', + startatt = (ordered && start !== 1) ? (' start="' + start + '"') : ''; + return '<' + type + startatt + '>\n' + body + '\n'; }; Renderer.prototype.listitem = function(text) { return '
  • ' + text + '
  • \n'; }; +Renderer.prototype.checkbox = function(checked) { + return ' '; +} + Renderer.prototype.paragraph = function(text) { return '

    ' + text + '

    \n'; }; Renderer.prototype.table = function(header, body) { + if (body) body = '' + body + ''; + return '\n' + '\n' + header + '\n' - + '\n' + body - + '\n' + '
    \n'; }; @@ -870,7 +994,7 @@ Renderer.prototype.tablerow = function(content) { Renderer.prototype.tablecell = function(content, flags) { var type = flags.header ? 'th' : 'td'; var tag = flags.align - ? '<' + type + ' style="text-align:' + flags.align + '">' + ? '<' + type + ' align="' + flags.align + '">' : '<' + type + '>'; return tag + content + '\n'; }; @@ -912,7 +1036,12 @@ Renderer.prototype.link = function(href, title, text) { if (this.options.baseUrl && !originIndependentUrl.test(href)) { href = resolveUrl(this.options.baseUrl, href); } - var out = '= 0 && str[curr] === '\\') escaped = !escaped; + if (escaped) { + // odd number of slashes means | is escaped + // so we leave it alone + return '|'; + } else { + // add space before unescaped | + return ' |'; + } + }), + cells = row.split(/ \|/), + i = 0; + + if (cells.length > count) { + cells.splice(count); + } else { + while (cells.length < count) cells.push(''); + } + + for (; i < cells.length; i++) { + // leading or trailing whitespace is ignored per the gfm spec + cells[i] = cells[i].trim().replace(/\\\|/g, '|'); + } + return cells; +} + +// Remove trailing 'c's. Equivalent to str.replace(/c*$/, ''). +// /c*$/ is vulnerable to REDOS. +// invert: Remove suffix of non-c chars instead. Default falsey. +function rtrim(str, c, invert) { + if (str.length === 0) { + return ''; + } + + // Length of suffix matching the invert condition. + var suffLen = 0; + + // Step left until we fail to match the invert condition. + while (suffLen < str.length) { + var currChar = str.charAt(str.length - suffLen - 1); + if (currChar === c && !invert) { + suffLen++; + } else if (currChar !== c && invert) { + suffLen++; + } else { + break; + } + } + + return str.substr(0, str.length - suffLen); +} /** * Marked @@ -1232,12 +1420,13 @@ function merge(obj) { function marked(src, opt, callback) { // throw error in case of non string input - if (typeof src == 'undefined' || src === null) + if (typeof src === 'undefined' || src === null) { throw new Error('marked(): input parameter is undefined or null'); - if (typeof src != 'string') - throw new Error('marked(): input parameter is of type ' + - Object.prototype.toString.call(src) + ', string expected'); - + } + if (typeof src !== 'string') { + throw new Error('marked(): input parameter is of type ' + + Object.prototype.toString.call(src) + ', string expected'); + } if (callback || typeof opt === 'function') { if (!callback) { @@ -1247,10 +1436,10 @@ function marked(src, opt, callback) { opt = merge({}, marked.defaults, opt || {}); - var highlight = opt.highlight - , tokens - , pending - , i = 0; + var highlight = opt.highlight, + tokens, + pending, + i = 0; try { tokens = Lexer.lex(src, opt) @@ -1312,7 +1501,7 @@ function marked(src, opt, callback) { if (opt) opt = merge({}, marked.defaults, opt); return Parser.parse(Lexer.lex(src, opt), opt); } catch (e) { - e.message += '\nPlease report this to https://github.com/chjj/marked.'; + e.message += '\nPlease report this to https://github.com/markedjs/marked.'; if ((opt || marked.defaults).silent) { return '

    An error occurred:

    '
             + escape(e.message + '', true)
    @@ -1332,24 +1521,29 @@ marked.setOptions = function(opt) {
       return marked;
     };
     
    -marked.defaults = {
    -  gfm: true,
    -  tables: true,
    -  breaks: false,
    -  pedantic: false,
    -  sanitize: false,
    -  sanitizer: null,
    -  mangle: true,
    -  smartLists: false,
    -  silent: false,
    -  highlight: null,
    -  langPrefix: 'lang-',
    -  smartypants: false,
    -  headerPrefix: '',
    -  renderer: new Renderer,
    -  xhtml: false,
    -  baseUrl: null
    -};
    +marked.getDefaults = function () {
    +  return {
    +    baseUrl: null,
    +    breaks: false,
    +    gfm: true,
    +    headerIds: true,
    +    headerPrefix: '',
    +    highlight: null,
    +    langPrefix: 'language-',
    +    mangle: true,
    +    pedantic: false,
    +    renderer: new Renderer(),
    +    sanitize: false,
    +    sanitizer: null,
    +    silent: false,
    +    smartLists: false,
    +    smartypants: false,
    +    tables: true,
    +    xhtml: false
    +  };
    +}
    +
    +marked.defaults = marked.getDefaults();
     
     /**
      * Expose
    @@ -1374,9 +1568,6 @@ if (typeof module !== 'undefined' && typeof exports === 'object') {
     } else if (typeof define === 'function' && define.amd) {
       define(function() { return marked; });
     } else {
    -  this.marked = marked;
    +  root.marked = marked;
     }
    -
    -}).call(function() {
    -  return this || (typeof window !== 'undefined' ? window : global);
    -}());
    +})(this || (typeof window !== 'undefined' ? window : global));
    diff --git a/man/marked.1 b/man/marked.1
    index b9bdc8c2..a8e41b50 100644
    --- a/man/marked.1
    +++ b/man/marked.1
    @@ -23,7 +23,7 @@ cat in.md | marked > out.html
     .TP
     echo "hello *world*" | marked
     .TP
    -marked \-o out.html in.md \-\-gfm
    +marked \-o out.html \-i in.md \-\-gfm
     .TP
     marked \-\-output="hello world.html" \-i in.md \-\-no-breaks
     
    @@ -81,7 +81,7 @@ For configuring and running programmatically.
         require('marked')('*foo*', { gfm: true });
     
     .SH BUGS
    -Please report any bugs to https://github.com/chjj/marked.
    +Please report any bugs to https://github.com/markedjs/marked.
     
     .SH LICENSE
     Copyright (c) 2011-2014, Christopher Jeffrey (MIT License).
    diff --git a/man/marked.1.txt b/man/marked.1.txt
    index 7f604192..fd9b37ef 100644
    --- a/man/marked.1.txt
    +++ b/man/marked.1.txt
    @@ -22,7 +22,7 @@ EXAMPLES
     
            echo "hello *world*" | marked
     
    -       marked -o out.html in.md --gfm
    +       marked -o out.html -i in.md --gfm
     
            marked --output="hello world.html" -i in.md --no-breaks
     
    diff --git a/marked.min.js b/marked.min.js
    index da806f0f..59b15403 100644
    --- a/marked.min.js
    +++ b/marked.min.js
    @@ -1,6 +1,6 @@
     /**
      * marked - a markdown parser
    - * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed)
    - * https://github.com/chjj/marked
    + * Copyright (c) 2011-2018, Christopher Jeffrey. (MIT Licensed)
    + * https://github.com/markedjs/marked
      */
    -(function(){"use strict";var e={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:g,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:g,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:g,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,paragraph:/^([^\n]+(?:\n?(?!hr|heading|lheading| {0,3}>|tag)[^\n]+)+)/,text:/^[^\n]+/};function t(t){this.tokens=[],this.tokens.links={},this.options=t||d.defaults,this.rules=e.normal,this.options.gfm&&(this.options.tables?this.rules=e.tables:this.rules=e.gfm)}e._label=/(?:\\[\[\]]|[^\[\]])+/,e._title=/(?:"(?:\\"|[^"]|"[^"\n]*")*"|'\n?(?:[^'\n]+\n?)*'|\([^()]*\))/,e.def=a(e.def)("label",e._label)("title",e._title)(),e.bullet=/(?:[*+-]|\d+\.)/,e.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,e.item=a(e.item,"gm")(/bull/g,e.bullet)(),e.list=a(e.list)(/bull/g,e.bullet)("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))")("def","\\n+(?="+e.def.source+")")(),e._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b",e.html=a(e.html)("comment",//)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/]*)*?\/?>/)(/tag/g,e._tag)(),e.paragraph=a(e.paragraph)("hr",e.hr)("heading",e.heading)("lheading",e.lheading)("tag","<"+e._tag)(),e.blockquote=a(e.blockquote)("paragraph",e.paragraph)(),e.normal=f({},e),e.gfm=f({},e.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\n? *\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),e.gfm.paragraph=a(e.paragraph)("(?!","(?!"+e.gfm.fences.source.replace("\\1","\\2")+"|"+e.list.source.replace("\\1","\\3")+"|")(),e.tables=f({},e.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),t.rules=e,t.lex=function(e,n){return new t(n).lex(e)},t.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g,"    ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},t.prototype.token=function(t,n){var r,s,i,l,o,h,a,p,u,c;for(t=t.replace(/^ +$/gm,"");t;)if((i=this.rules.newline.exec(t))&&(t=t.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.code.exec(t))t=t.substring(i[0].length),i=i[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?i:i.replace(/\n+$/,"")});else if(i=this.rules.fences.exec(t))t=t.substring(i[0].length),this.tokens.push({type:"code",lang:i[2],text:i[3]||""});else if(i=this.rules.heading.exec(t))t=t.substring(i[0].length),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if(n&&(i=this.rules.nptable.exec(t))){for(t=t.substring(i[0].length),h={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/\n$/,"").split("\n")},p=0;p ?/gm,""),this.token(i,n),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.list.exec(t)){for(t=t.substring(i[0].length),l=i[2],this.tokens.push({type:"list_start",ordered:l.length>1}),r=!1,c=(i=i[0].match(this.rules.item)).length,p=0;p1&&o.length>1||(t=i.slice(p+1).join("\n")+t,p=c-1)),s=r||/\n\n(?!\s*$)/.test(h),p!==c-1&&(r="\n"===h.charAt(h.length-1),s||(s=r)),this.tokens.push({type:s?"loose_item_start":"list_item_start"}),this.token(h,!1),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(i=this.rules.html.exec(t))t=t.substring(i[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===i[1]||"script"===i[1]||"style"===i[1]),text:i[0]});else if(n&&(i=this.rules.def.exec(t)))t=t.substring(i[0].length),i[3]&&(i[3]=i[3].substring(1,i[3].length-1)),u=i[1].toLowerCase(),this.tokens.links[u]||(this.tokens.links[u]={href:i[2],title:i[3]});else if(n&&(i=this.rules.table.exec(t))){for(t=t.substring(i[0].length),h={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/(?: *\| *)?\n$/,"").split("\n")},p=0;p])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:g,tag:/^|^<\/?[a-zA-Z0-9\-]+(?:"[^"]*"|'[^']*'|\s[^<'">\/]*)*?\/?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|\\[\[\]]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^_([^\s_](?:[^_]|__)+?[^\s_])_\b|^\*((?:\*\*|[^*])+?)\*(?!\*)/,code:/^(`+)(\s*)([\s\S]*?[^`]?)\2\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:g,text:/^[\s\S]+?(?=[\\/g,">").replace(/"/g,""").replace(/'/g,"'")}function h(e){return e.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function a(e,t){return e=e.source,t=t||"",function n(r,s){return r?(s=(s=s.source||s).replace(/(^|[^\[])\^/g,"$1"),e=e.replace(r,s),n):new RegExp(e,t)}}function p(e,t){return u[" "+e]||(/^[^:]+:\/*[^/]*$/.test(e)?u[" "+e]=e+"/":u[" "+e]=e.replace(/[^/]*$/,"")),e=u[" "+e],"//"===t.slice(0,2)?e.replace(/:[\s\S]*/,":")+t:"/"===t.charAt(0)?e.replace(/(:\/*[^/]*)[\s\S]*/,"$1")+t:e+t}n._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,n._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,n.autolink=a(n.autolink)("scheme",n._scheme)("email",n._email)(),n._inside=/(?:\[[^\]]*\]|\\[\[\]]|[^\[\]]|\](?=[^\[]*\]))*/,n._href=/\s*?(?:\s+['"]([\s\S]*?)['"])?\s*/,n.link=a(n.link)("inside",n._inside)("href",n._href)(),n.reflink=a(n.reflink)("inside",n._inside)(),n.normal=f({},n),n.pedantic=f({},n.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),n.gfm=f({},n.normal,{escape:a(n.escape)("])","~|])")(),url:a(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/)("email",n._email)(),_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:a(n.text)("]|","~]|")("|","|https?://|ftp://|www\\.|[a-zA-Z0-9.!#$%&'*+/=?^_`{\\|}~-]+@|")()}),n.breaks=f({},n.gfm,{br:a(n.br)("{2,}","*")(),text:a(n.gfm.text)("{2,}","*")()}),r.rules=n,r.output=function(e,t,n){return new r(t,n).output(e)},r.prototype.output=function(e){for(var t,n,r,s,i="";e;)if(s=this.rules.escape.exec(e))e=e.substring(s[0].length),i+=s[1];else if(s=this.rules.autolink.exec(e))e=e.substring(s[0].length),r="@"===s[2]?"mailto:"+(n=o(this.mangle(s[1]))):n=o(s[1]),i+=this.renderer.link(r,null,n);else if(this.inLink||!(s=this.rules.url.exec(e))){if(s=this.rules.tag.exec(e))!this.inLink&&/^/i.test(s[0])&&(this.inLink=!1),e=e.substring(s[0].length),i+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(s[0]):o(s[0]):s[0];else if(s=this.rules.link.exec(e))e=e.substring(s[0].length),this.inLink=!0,i+=this.outputLink(s,{href:s[2],title:s[3]}),this.inLink=!1;else if((s=this.rules.reflink.exec(e))||(s=this.rules.nolink.exec(e))){if(e=e.substring(s[0].length),t=(s[2]||s[1]).replace(/\s+/g," "),!(t=this.links[t.toLowerCase()])||!t.href){i+=s[0].charAt(0),e=s[0].substring(1)+e;continue}this.inLink=!0,i+=this.outputLink(s,t),this.inLink=!1}else if(s=this.rules.strong.exec(e))e=e.substring(s[0].length),i+=this.renderer.strong(this.output(s[2]||s[1]));else if(s=this.rules.em.exec(e))e=e.substring(s[0].length),i+=this.renderer.em(this.output(s[2]||s[1]));else if(s=this.rules.code.exec(e))e=e.substring(s[0].length),i+=this.renderer.codespan(o(s[3].trim(),!0));else if(s=this.rules.br.exec(e))e=e.substring(s[0].length),i+=this.renderer.br();else if(s=this.rules.del.exec(e))e=e.substring(s[0].length),i+=this.renderer.del(this.output(s[1]));else if(s=this.rules.text.exec(e))e=e.substring(s[0].length),i+=this.renderer.text(o(this.smartypants(s[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else s[0]=this.rules._backpedal.exec(s[0])[0],e=e.substring(s[0].length),"@"===s[2]?r="mailto:"+(n=o(s[0])):(n=o(s[0]),r="www."===s[1]?"http://"+n:n),i+=this.renderer.link(r,null,n);return i},r.prototype.outputLink=function(e,t){var n=o(t.href),r=t.title?o(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,o(e[1]))},r.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},r.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,s=0;s.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},s.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'
    '+(n?e:o(e,!0))+"\n
    \n":"
    "+(n?e:o(e,!0))+"\n
    "},s.prototype.blockquote=function(e){return"
    \n"+e+"
    \n"},s.prototype.html=function(e){return e},s.prototype.heading=function(e,t,n){return"'+e+"\n"},s.prototype.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},s.prototype.list=function(e,t){var n=t?"ol":"ul";return"<"+n+">\n"+e+"\n"},s.prototype.listitem=function(e){return"
  • "+e+"
  • \n"},s.prototype.paragraph=function(e){return"

    "+e+"

    \n"},s.prototype.table=function(e,t){return"\n\n"+e+"\n\n"+t+"\n
    \n"},s.prototype.tablerow=function(e){return"\n"+e+"\n"},s.prototype.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">")+e+"\n"},s.prototype.strong=function(e){return""+e+""},s.prototype.em=function(e){return""+e+""},s.prototype.codespan=function(e){return""+e+""},s.prototype.br=function(){return this.options.xhtml?"
    ":"
    "},s.prototype.del=function(e){return""+e+""},s.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(h(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return n}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return n}this.options.baseUrl&&!c.test(e)&&(e=p(this.options.baseUrl,e));var s='
    "},s.prototype.image=function(e,t,n){this.options.baseUrl&&!c.test(e)&&(e=p(this.options.baseUrl,e));var r=''+n+'":">"},s.prototype.text=function(e){return e},i.prototype.strong=i.prototype.em=i.prototype.codespan=i.prototype.del=i.prototype.text=function(e){return e},i.prototype.link=i.prototype.image=function(e,t,n){return""+n},i.prototype.br=function(){return""},l.parse=function(e,t){return new l(t).parse(e)},l.prototype.parse=function(e){this.inline=new r(e.links,this.options),this.inlineText=new r(e.links,f({},this.options,{renderer:new i})),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},l.prototype.next=function(){return this.token=this.tokens.pop()},l.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},l.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},l.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,h(this.inlineText.output(this.token.text)));case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,s="",i="";for(n="",e=0;eAn error occurred:

    "+o(e.message+"",!0)+"
    ";throw e}}g.exec=g,d.options=d.setOptions=function(e){return f(d.defaults,e),d},d.defaults={gfm:!0,tables:!0,breaks:!1,pedantic:!1,sanitize:!1,sanitizer:null,mangle:!0,smartLists:!1,silent:!1,highlight:null,langPrefix:"lang-",smartypants:!1,headerPrefix:"",renderer:new s,xhtml:!1,baseUrl:null},d.Parser=l,d.parser=l.parse,d.Renderer=s,d.TextRenderer=i,d.Lexer=t,d.lexer=t.lex,d.InlineLexer=r,d.inlineLexer=r.output,d.parse=d,"undefined"!=typeof module&&"object"==typeof exports?module.exports=d:"function"==typeof define&&define.amd?define(function(){return d}):this.marked=d}).call(function(){return this||("undefined"!=typeof window?window:global)}()); \ No newline at end of file +!function(e){"use strict";var t={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:f,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,nptable:f,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$)|(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:f,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading| {0,3}>|<\/?(?:tag)(?: +|\n|\/?>)|<(?:script|pre|style|!--))[^\n]+)*)/,text:/^[^\n]+/};function n(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||k.defaults,this.rules=t.normal,this.options.pedantic?this.rules=t.pedantic:this.options.gfm&&(this.options.tables?this.rules=t.tables:this.rules=t.gfm)}t._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,t._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,t.def=p(t.def).replace("label",t._label).replace("title",t._title).getRegex(),t.bullet=/(?:[*+-]|\d+\.)/,t.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,t.item=p(t.item,"gm").replace(/bull/g,t.bullet).getRegex(),t.list=p(t.list).replace(/bull/g,t.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+t.def.source+")").getRegex(),t._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",t._comment=//,t.html=p(t.html,"i").replace("comment",t._comment).replace("tag",t._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),t.paragraph=p(t.paragraph).replace("hr",t.hr).replace("heading",t.heading).replace("lheading",t.lheading).replace("tag",t._tag).getRegex(),t.blockquote=p(t.blockquote).replace("paragraph",t.paragraph).getRegex(),t.normal=d({},t),t.gfm=d({},t.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\n? *\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),t.gfm.paragraph=p(t.paragraph).replace("(?!","(?!"+t.gfm.fences.source.replace("\\1","\\2")+"|"+t.list.source.replace("\\1","\\3")+"|").getRegex(),t.tables=d({},t.gfm,{nptable:/^ *([^|\n ].*\|.*)\n *([-:]+ *\|[-| :]*)(?:\n((?:.*[^>\n ].*(?:\n|$))*)\n*|$)/,table:/^ *\|(.+)\n *\|?( *[-:]+[-| :]*)(?:\n((?: *[^>\n ].*(?:\n|$))*)\n*|$)/}),t.pedantic=d({},t.normal,{html:p("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",t._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/}),n.rules=t,n.lex=function(e,t){return new n(t).lex(e)},n.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},n.prototype.token=function(e,n){var r,s,i,l,o,a,h,p,u,c,g,f,d,k,x,y;for(e=e.replace(/^ +$/gm,"");e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.code.exec(e))e=e.substring(i[0].length),i=i[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?i:m(i,"\n")});else if(i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2],text:i[3]||""});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if(n&&(i=this.rules.nptable.exec(e))&&(a={type:"table",header:b(i[1].replace(/^ *| *\| *$/g,"")),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3]?i[3].replace(/\n$/,"").split("\n"):[]}).header.length===a.align.length){for(e=e.substring(i[0].length),g=0;g ?/gm,""),this.token(i,n),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.list.exec(e)){for(e=e.substring(i[0].length),h={type:"list_start",ordered:k=(l=i[2]).length>1,start:k?+l:"",loose:!1},this.tokens.push(h),p=[],r=!1,d=(i=i[0].match(this.rules.item)).length,g=0;g1&&o.length>1||(e=i.slice(g+1).join("\n")+e,g=d-1)),s=r||/\n\n(?!\s*$)/.test(a),g!==d-1&&(r="\n"===a.charAt(a.length-1),s||(s=r)),s&&(h.loose=!0),y=void 0,(x=/^\[[ xX]\] /.test(a))&&(y=" "!==a[1],a=a.replace(/^\[[ xX]\] +/,"")),u={type:"list_item_start",task:x,checked:y,loose:s},p.push(u),this.tokens.push(u),this.token(a,!1),this.tokens.push({type:"list_item_end"});if(h.loose)for(d=p.length,g=0;g?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:f,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(href(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,strong:/^__([^\s])__(?!_)|^\*\*([^\s])\*\*(?!\*)|^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)/,em:/^_([^\s_])_(?!_)|^\*([^\s*"<\[])\*(?!\*)|^_([^\s][\s\S]*?[^\s_])_(?!_)|^_([^\s_][\s\S]*?[^\s])_(?!_)|^\*([^\s"<\[][\s\S]*?[^\s*])\*(?!\*)|^\*([^\s*"<\[][\s\S]*?[^\s])\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`]?)\s*\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:f,text:/^[\s\S]+?(?=[\\/g,">").replace(/"/g,""").replace(/'/g,"'")}function h(e){return e.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function p(e,t){return e=e.source||e,t=t||"",{replace:function(t,n){return n=(n=n.source||n).replace(/(^|[^\[])\^/g,"$1"),e=e.replace(t,n),this},getRegex:function(){return new RegExp(e,t)}}}function u(e,t){return c[" "+e]||(/^[^:]+:\/*[^/]*$/.test(e)?c[" "+e]=e+"/":c[" "+e]=m(e,"/",!0)),e=c[" "+e],"//"===t.slice(0,2)?e.replace(/:[\s\S]*/,":")+t:"/"===t.charAt(0)?e.replace(/(:\/*[^/]*)[\s\S]*/,"$1")+t:e+t}r._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,r._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,r._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,r.autolink=p(r.autolink).replace("scheme",r._scheme).replace("email",r._email).getRegex(),r._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,r.tag=p(r.tag).replace("comment",t._comment).replace("attribute",r._attribute).getRegex(),r._label=/(?:\[[^\[\]]*\]|\\[\[\]]?|`[^`]*`|[^\[\]\\])*?/,r._href=/\s*(<(?:\\[<>]?|[^\s<>\\])*>|(?:\\[()]?|\([^\s\x00-\x1f\\]*\)|[^\s\x00-\x1f()\\])*?)/,r._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,r.link=p(r.link).replace("label",r._label).replace("href",r._href).replace("title",r._title).getRegex(),r.reflink=p(r.reflink).replace("label",r._label).getRegex(),r.normal=d({},r),r.pedantic=d({},r.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/,link:p(/^!?\[(label)\]\((.*?)\)/).replace("label",r._label).getRegex(),reflink:p(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",r._label).getRegex()}),r.gfm=d({},r.normal,{escape:p(r.escape).replace("])","~|])").getRegex(),url:p(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("email",r._email).getRegex(),_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:p(r.text).replace("]|","~]|").replace("|","|https?://|ftp://|www\\.|[a-zA-Z0-9.!#$%&'*+/=?^_`{\\|}~-]+@|").getRegex()}),r.breaks=d({},r.gfm,{br:p(r.br).replace("{2,}","*").getRegex(),text:p(r.gfm.text).replace("{2,}","*").getRegex()}),s.rules=r,s.output=function(e,t,n){return new s(t,n).output(e)},s.prototype.output=function(e){for(var t,n,r,i,l,o,h="";e;)if(l=this.rules.escape.exec(e))e=e.substring(l[0].length),h+=l[1];else if(l=this.rules.autolink.exec(e))e=e.substring(l[0].length),r="@"===l[2]?"mailto:"+(n=a(this.mangle(l[1]))):n=a(l[1]),h+=this.renderer.link(r,null,n);else if(this.inLink||!(l=this.rules.url.exec(e))){if(l=this.rules.tag.exec(e))!this.inLink&&/^
    /i.test(l[0])&&(this.inLink=!1),e=e.substring(l[0].length),h+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(l[0]):a(l[0]):l[0];else if(l=this.rules.link.exec(e))e=e.substring(l[0].length),this.inLink=!0,r=l[2],this.options.pedantic?(t=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r))?(r=t[1],i=t[3]):i="":i=l[3]?l[3].slice(1,-1):"",r=r.trim().replace(/^<([\s\S]*)>$/,"$1"),h+=this.outputLink(l,{href:s.escapes(r),title:s.escapes(i)}),this.inLink=!1;else if((l=this.rules.reflink.exec(e))||(l=this.rules.nolink.exec(e))){if(e=e.substring(l[0].length),t=(l[2]||l[1]).replace(/\s+/g," "),!(t=this.links[t.toLowerCase()])||!t.href){h+=l[0].charAt(0),e=l[0].substring(1)+e;continue}this.inLink=!0,h+=this.outputLink(l,t),this.inLink=!1}else if(l=this.rules.strong.exec(e))e=e.substring(l[0].length),h+=this.renderer.strong(this.output(l[4]||l[3]||l[2]||l[1]));else if(l=this.rules.em.exec(e))e=e.substring(l[0].length),h+=this.renderer.em(this.output(l[6]||l[5]||l[4]||l[3]||l[2]||l[1]));else if(l=this.rules.code.exec(e))e=e.substring(l[0].length),h+=this.renderer.codespan(a(l[2].trim(),!0));else if(l=this.rules.br.exec(e))e=e.substring(l[0].length),h+=this.renderer.br();else if(l=this.rules.del.exec(e))e=e.substring(l[0].length),h+=this.renderer.del(this.output(l[1]));else if(l=this.rules.text.exec(e))e=e.substring(l[0].length),h+=this.renderer.text(a(this.smartypants(l[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else{do{o=l[0],l[0]=this.rules._backpedal.exec(l[0])[0]}while(o!==l[0]);e=e.substring(l[0].length),"@"===l[2]?r="mailto:"+(n=a(l[0])):(n=a(l[0]),r="www."===l[1]?"http://"+n:n),h+=this.renderer.link(r,null,n)}return h},s.escapes=function(e){return e?e.replace(s.rules._escapes,"$1"):e},s.prototype.outputLink=function(e,t){var n=t.href,r=t.title?a(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,a(e[1]))},s.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},s.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,s=0;s.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},i.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'
    '+(n?e:a(e,!0))+"
    \n":"
    "+(n?e:a(e,!0))+"
    "},i.prototype.blockquote=function(e){return"
    \n"+e+"
    \n"},i.prototype.html=function(e){return e},i.prototype.heading=function(e,t,n){return this.options.headerIds?"'+e+"\n":""+e+"\n"},i.prototype.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},i.prototype.list=function(e,t,n){var r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"\n"},i.prototype.listitem=function(e){return"
  • "+e+"
  • \n"},i.prototype.checkbox=function(e){return" "},i.prototype.paragraph=function(e){return"

    "+e+"

    \n"},i.prototype.table=function(e,t){return t&&(t=""+t+""),"\n\n"+e+"\n"+t+"
    \n"},i.prototype.tablerow=function(e){return"\n"+e+"\n"},i.prototype.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' align="'+t.align+'">':"<"+n+">")+e+"\n"},i.prototype.strong=function(e){return""+e+""},i.prototype.em=function(e){return""+e+""},i.prototype.codespan=function(e){return""+e+""},i.prototype.br=function(){return this.options.xhtml?"
    ":"
    "},i.prototype.del=function(e){return""+e+""},i.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(h(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return n}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return n}this.options.baseUrl&&!g.test(e)&&(e=u(this.options.baseUrl,e));try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return n}var s='
    "},i.prototype.image=function(e,t,n){this.options.baseUrl&&!g.test(e)&&(e=u(this.options.baseUrl,e));var r=''+n+'":">"},i.prototype.text=function(e){return e},l.prototype.strong=l.prototype.em=l.prototype.codespan=l.prototype.del=l.prototype.text=function(e){return e},l.prototype.link=l.prototype.image=function(e,t,n){return""+n},l.prototype.br=function(){return""},o.parse=function(e,t){return new o(t).parse(e)},o.prototype.parse=function(e){this.inline=new s(e.links,this.options),this.inlineText=new s(e.links,d({},this.options,{renderer:new l})),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},o.prototype.next=function(){return this.token=this.tokens.pop()},o.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},o.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},o.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,h(this.inlineText.output(this.token.text)));case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,s="",i="";for(n="",e=0;e=0&&"\\"===n[s];)r=!r;return r?"|":" |"}).split(/ \|/),r=0;if(n.length>t)n.splice(t);else for(;n.lengthAn error occurred:

    "+a(e.message+"",!0)+"
    ";throw e}}f.exec=f,k.options=k.setOptions=function(e){return d(k.defaults,e),k},k.getDefaults=function(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:new i,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tables:!0,xhtml:!1}},k.defaults=k.getDefaults(),k.Parser=o,k.parser=o.parse,k.Renderer=i,k.TextRenderer=l,k.Lexer=n,k.lexer=n.lex,k.InlineLexer=s,k.inlineLexer=s.output,k.parse=k,"undefined"!=typeof module&&"object"==typeof exports?module.exports=k:"function"==typeof define&&define.amd?define(function(){return k}):e.marked=k}(this||("undefined"!=typeof window?window:global)); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 1ad5c8ca..9e0d4e7a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,22 +1,277 @@ { "name": "marked", - "version": "0.3.12", + "version": "0.5.0", "lockfileVersion": 1, "requires": true, "dependencies": { + "@types/concat-stream": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@types/concat-stream/-/concat-stream-1.6.0.tgz", + "integrity": "sha1-OU2+C7X+5Gs42JZzXoto7yOQ0A0=", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/form-data": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/@types/form-data/-/form-data-0.0.33.tgz", + "integrity": "sha1-yayFsqX9GENbjIXZ7LUObWyJP/g=", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/node": { + "version": "9.6.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-9.6.5.tgz", + "integrity": "sha512-NOLEgsT6UiDTjnWG5Hd2Mg25LRyz/oe8ql3wbjzgSFeRzRROhPmtlsvIrei4B46UjERF0td9SZ1ZXPLOdcrBHg==", + "dev": true + }, + "@types/qs": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.5.1.tgz", + "integrity": "sha512-mNhVdZHdtKHMMxbqzNK3RzkBcN1cux3AvuCYGTvjEIQT2uheH3eCAyYsbMbh2Bq8nXkeOWs1kyDiF7geWRFQ4Q==", + "dev": true + }, "abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", "dev": true }, + "acorn": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.4.1.tgz", + "integrity": "sha512-XLmq3H/BVvW6/GbxKryGxWORz1ebilSsUDlyC27bXhWGWAZWkGwS6FLHjOlwFXNFoWFQEO/Df4u0YYd0K3BQgQ==", + "dev": true + }, + "acorn-jsx": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", + "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=", + "dev": true, + "requires": { + "acorn": "^3.0.4" + }, + "dependencies": { + "acorn": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", + "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=", + "dev": true + } + } + }, + "ajv": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", + "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "dev": true, + "requires": { + "co": "^4.6.0", + "fast-deep-equal": "^1.0.0", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.3.0" + } + }, + "ajv-keywords": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.1.tgz", + "integrity": "sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I=", + "dev": true + }, + "ansi-escapes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.0.0.tgz", + "integrity": "sha512-O/klc27mWNUigtv0F8NJWbLF00OcegQalkqKURWdosW08YZKi4m6CnSUSvIZG1otNJbTWhN01Hhz389DW7mvDQ==", + "dev": true + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, "argparse": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.9.tgz", "integrity": "sha1-c9g7wmP4bpf4zE9rrhsOkKfSLIY=", "dev": true, "requires": { - "sprintf-js": "1.0.3" + "sprintf-js": "~1.0.2" + } + }, + "array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "dev": true, + "requires": { + "array-uniq": "^1.0.1" + } + }, + "array-uniq": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", + "dev": true + }, + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true + }, + "asap": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", + "integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=", + "dev": true + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true + }, + "babel-code-frame": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", + "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", + "dev": true, + "requires": { + "chalk": "^1.1.3", + "esutils": "^2.0.2", + "js-tokens": "^3.0.2" + } + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "brace-expansion": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", + "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "dev": true + }, + "caller-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", + "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=", + "dev": true, + "requires": { + "callsites": "^0.2.0" + } + }, + "callsites": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", + "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=", + "dev": true + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "chardet": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz", + "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=", + "dev": true + }, + "circular-json": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", + "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", + "dev": true + }, + "cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "dev": true, + "requires": { + "restore-cursor": "^2.0.0" + } + }, + "cli-width": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", + "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", + "dev": true + }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "dev": true + }, + "coa": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/coa/-/coa-0.4.0.tgz", + "integrity": "sha1-JSvBvpdArxXYJuSQ6LE5PC/ioGI=", + "dev": true, + "requires": { + "q": "~0.9.6" + } + }, + "color-convert": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.1.tgz", + "integrity": "sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==", + "dev": true, + "requires": { + "color-name": "^1.1.1" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "combined-stream": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", + "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", + "dev": true, + "requires": { + "delayed-stream": "~1.0.0" } }, "commander": { @@ -31,10 +286,153 @@ "integrity": "sha1-Buq41SM4uDn6Gi11rwCF7tGxvq4=", "dev": true, "requires": { - "entities": "1.1.1", - "mdurl": "1.0.1", - "minimist": "1.2.0", - "string.prototype.repeat": "0.2.0" + "entities": "~ 1.1.1", + "mdurl": "~ 1.0.1", + "minimist": "~ 1.2.0", + "string.prototype.repeat": "^0.2.0" + } + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "concat-stream": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.0.tgz", + "integrity": "sha1-CqxmL9Ur54lk1VMvaUeE5wEQrPc=", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "readable-stream": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", + "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~1.0.6", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.0.3", + "util-deprecate": "~1.0.1" + } + }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "contains-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", + "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=", + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "cross-spawn": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "dev": true, + "requires": { + "lru-cache": "^4.0.1", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + }, + "dependencies": { + "lru-cache": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.1.tgz", + "integrity": "sha512-q4spe4KTfsAS1SUHLO0wz8Qiyf1+vMIAgpRYioFYDMNqKfHQbg+AVDH3i4fvpl71/P1L0dBl+fQi+P37UYf0ew==", + "dev": true, + "requires": { + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" + } + } + } + }, + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, + "del": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/del/-/del-2.2.2.tgz", + "integrity": "sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag=", + "dev": true, + "requires": { + "globby": "^5.0.0", + "is-path-cwd": "^1.0.0", + "is-path-in-cwd": "^1.0.0", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "rimraf": "^2.2.8" + }, + "dependencies": { + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + } + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true + }, + "diff": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/diff/-/diff-1.0.8.tgz", + "integrity": "sha1-NDJ2MI7Jkbe8giZ+1VvBQR+XFmY=", + "dev": true + }, + "doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "requires": { + "esutils": "^2.0.2" } }, "entities": { @@ -43,19 +441,518 @@ "integrity": "sha1-blwtClYhtdra7O+AuQ7ftc13cvA=", "dev": true }, + "error-ex": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz", + "integrity": "sha1-+FWobOYa3E6GIcPNoh56dhLDqNw=", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "eslint": { + "version": "4.17.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.17.0.tgz", + "integrity": "sha512-AyxBUCANU/o/xC0ijGMKavo5Ls3oK6xykiOITlMdjFjrKOsqLrA7Nf5cnrDgcKrHzBirclAZt63XO7YZlVUPwA==", + "dev": true, + "requires": { + "ajv": "^5.3.0", + "babel-code-frame": "^6.22.0", + "chalk": "^2.1.0", + "concat-stream": "^1.6.0", + "cross-spawn": "^5.1.0", + "debug": "^3.1.0", + "doctrine": "^2.1.0", + "eslint-scope": "^3.7.1", + "eslint-visitor-keys": "^1.0.0", + "espree": "^3.5.2", + "esquery": "^1.0.0", + "esutils": "^2.0.2", + "file-entry-cache": "^2.0.0", + "functional-red-black-tree": "^1.0.1", + "glob": "^7.1.2", + "globals": "^11.0.1", + "ignore": "^3.3.3", + "imurmurhash": "^0.1.4", + "inquirer": "^3.0.6", + "is-resolvable": "^1.0.0", + "js-yaml": "^3.9.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.3.0", + "lodash": "^4.17.4", + "minimatch": "^3.0.2", + "mkdirp": "^0.5.1", + "natural-compare": "^1.4.0", + "optionator": "^0.8.2", + "path-is-inside": "^1.0.2", + "pluralize": "^7.0.0", + "progress": "^2.0.0", + "require-uncached": "^1.0.3", + "semver": "^5.3.0", + "strip-ansi": "^4.0.0", + "strip-json-comments": "~2.0.1", + "table": "^4.0.1", + "text-table": "~0.2.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", + "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", + "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "dev": true, + "requires": { + "ansi-styles": "^3.1.0", + "escape-string-regexp": "^1.0.5", + "supports-color": "^4.0.0" + } + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "lodash": { + "version": "4.17.5", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.5.tgz", + "integrity": "sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw==", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "semver": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", + "dev": true + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + }, + "supports-color": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", + "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "dev": true, + "requires": { + "has-flag": "^2.0.0" + } + } + } + }, + "eslint-config-standard": { + "version": "11.0.0-beta.0", + "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-11.0.0-beta.0.tgz", + "integrity": "sha512-f+vs5HAHQo7NRZ3hVe+UVdT5DbebMNaFTWFp95orJ0LUdYPoWdM8xw/bMeO/IZMvHOPmIteGKGc2QOhSXd5nRg==", + "dev": true + }, + "eslint-import-resolver-node": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz", + "integrity": "sha512-sfmTqJfPSizWu4aymbPr4Iidp5yKm8yDkHp+Ir3YiTHiiDfxh69mOUsmiqW6RZ9zRXFaF64GtYmN7e+8GHBv6Q==", + "dev": true, + "requires": { + "debug": "^2.6.9", + "resolve": "^1.5.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + } + } + }, + "eslint-module-utils": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.1.1.tgz", + "integrity": "sha512-jDI/X5l/6D1rRD/3T43q8Qgbls2nq5km5KSqiwlyUbGo5+04fXhMKdCPhjwbqAa6HXWaMxj8Q4hQDIh7IadJQw==", + "dev": true, + "requires": { + "debug": "^2.6.8", + "pkg-dir": "^1.0.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + } + } + }, + "eslint-plugin-import": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.8.0.tgz", + "integrity": "sha512-Rf7dfKJxZ16QuTgVv1OYNxkZcsu/hULFnC+e+w0Gzi6jMC3guQoWQgxYxc54IDRinlb6/0v5z/PxxIKmVctN+g==", + "dev": true, + "requires": { + "builtin-modules": "^1.1.1", + "contains-path": "^0.1.0", + "debug": "^2.6.8", + "doctrine": "1.5.0", + "eslint-import-resolver-node": "^0.3.1", + "eslint-module-utils": "^2.1.1", + "has": "^1.0.1", + "lodash.cond": "^4.3.0", + "minimatch": "^3.0.3", + "read-pkg-up": "^2.0.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "doctrine": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", + "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "isarray": "^1.0.0" + } + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + } + } + }, + "eslint-plugin-node": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-5.2.1.tgz", + "integrity": "sha512-xhPXrh0Vl/b7870uEbaumb2Q+LxaEcOQ3kS1jtIXanBAwpMre1l5q/l2l/hESYJGEFKuI78bp6Uw50hlpr7B+g==", + "dev": true, + "requires": { + "ignore": "^3.3.6", + "minimatch": "^3.0.4", + "resolve": "^1.3.3", + "semver": "5.3.0" + }, + "dependencies": { + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "semver": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", + "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=", + "dev": true + } + } + }, + "eslint-plugin-promise": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-3.6.0.tgz", + "integrity": "sha512-YQzM6TLTlApAr7Li8vWKR+K3WghjwKcYzY0d2roWap4SLK+kzuagJX/leTetIDWsFcTFnKNJXWupDCD6aZkP2Q==", + "dev": true + }, + "eslint-plugin-standard": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-standard/-/eslint-plugin-standard-3.0.1.tgz", + "integrity": "sha1-NNDJFbRe3G8BA5PH7vOCOwhWXPI=", + "dev": true + }, + "eslint-plugin-vuln-regex-detector": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/eslint-plugin-vuln-regex-detector/-/eslint-plugin-vuln-regex-detector-1.0.4.tgz", + "integrity": "sha512-MlGNEvfk/lmHrbp6gIXKP2NPedA+wX2+KwezolXLE6t9q0pcmohkYm2EKmgL9z5n57CAIYFJ/I4SSI3ANWyl/A==", + "dev": true, + "requires": { + "requireindex": "~1.1.0", + "vuln-regex-detector": "^1.3.0" + } + }, + "eslint-scope": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.1.tgz", + "integrity": "sha1-PWPD7f2gLgbgGkUq2IyqzHzctug=", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "eslint-visitor-keys": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", + "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==", + "dev": true + }, + "espree": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.3.tgz", + "integrity": "sha512-Zy3tAJDORxQZLl2baguiRU1syPERAIg0L+JB2MWorORgTu/CplzvxS9WWA7Xh4+Q+eOQihNs/1o1Xep8cvCxWQ==", + "dev": true, + "requires": { + "acorn": "^5.4.0", + "acorn-jsx": "^3.0.0" + } + }, "esprima": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", "dev": true }, + "esquery": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.0.tgz", + "integrity": "sha1-z7qLV9f7qT8XKYqKAGoEzaE9gPo=", + "dev": true, + "requires": { + "estraverse": "^4.0.0" + } + }, + "esrecurse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.0.tgz", + "integrity": "sha1-+pVo2Y04I/mkHZHpAtyrnqblsWM=", + "dev": true, + "requires": { + "estraverse": "^4.1.0", + "object-assign": "^4.0.1" + }, + "dependencies": { + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + } + } + }, + "estraverse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "dev": true + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true + }, + "external-editor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.1.0.tgz", + "integrity": "sha512-E44iT5QVOUJBKij4IIV3uvxuNlbKS38Tw1HiupxEIHPv9qtC2PrDYohbXV5U+1jnfIXttny8gUhj+oZvflFlzA==", + "dev": true, + "requires": { + "chardet": "^0.4.0", + "iconv-lite": "^0.4.17", + "tmp": "^0.0.33" + } + }, + "fast-deep-equal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz", + "integrity": "sha1-liVqO8l1WV6zbYLpkp0GDYk0Of8=", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5" + } + }, + "file-entry-cache": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz", + "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=", + "dev": true, + "requires": { + "flat-cache": "^1.2.1", + "object-assign": "^4.0.1" + }, + "dependencies": { + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + } + } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "flat-cache": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.0.tgz", + "integrity": "sha1-0wMLMrOBVPTjt+nHCfSQ9++XxIE=", + "dev": true, + "requires": { + "circular-json": "^0.3.1", + "del": "^2.0.2", + "graceful-fs": "^4.1.2", + "write": "^0.2.1" + }, + "dependencies": { + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "dev": true + } + } + }, + "form-data": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", + "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "1.0.6", + "mime-types": "^2.1.12" + } + }, "front-matter": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/front-matter/-/front-matter-2.3.0.tgz", "integrity": "sha1-cgOviWzjV+4E4qpFFp6pHtf2dQQ=", "dev": true, "requires": { - "js-yaml": "3.10.0" + "js-yaml": "^3.10.0" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, + "get-port": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/get-port/-/get-port-3.2.0.tgz", + "integrity": "sha1-3Xzn3hh8Bsi/NTeWrHHgmfCYDrw=", + "dev": true + }, + "get-stdin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", + "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", + "dev": true + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, "glob-to-regexp": { @@ -64,14 +961,394 @@ "integrity": "sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs=", "dev": true }, + "globals": { + "version": "11.3.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.3.0.tgz", + "integrity": "sha512-kkpcKNlmQan9Z5ZmgqKH/SMbSmjxQ7QjyNqfXVc8VJcoBV2UEg+sxQD15GQofGRh2hfpwUb70VC31DR7Rq5Hdw==", + "dev": true + }, + "globby": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz", + "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=", + "dev": true, + "requires": { + "array-union": "^1.0.1", + "arrify": "^1.0.0", + "glob": "^7.0.3", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + }, + "dependencies": { + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + } + } + }, + "has": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.1.tgz", + "integrity": "sha1-hGFzP1OLCDfJNh45qauelwTcLyg=", + "dev": true, + "requires": { + "function-bind": "^1.0.2" + } + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "has-flag": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", + "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "dev": true + }, + "hosted-git-info": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.5.0.tgz", + "integrity": "sha512-pNgbURSuab90KbTqvRPsseaTxOJCZBD0a7t+haSN33piP9cCM4l0CqdzAif2hUqm716UovKB2ROmiabGAKVXyg==", + "dev": true + }, + "html-differ": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/html-differ/-/html-differ-1.3.4.tgz", + "integrity": "sha1-n0e66XV9JRPR7a2Cc8xeQ/wAbMY=", + "dev": true, + "requires": { + "chalk": "1.0.0", + "coa": "0.4.0", + "diff": "1.0.8", + "lodash": "2.4.1", + "parse5": "1.1.3", + "vow": "0.4.3", + "vow-fs": "0.3.1" + }, + "dependencies": { + "ansi-regex": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-1.1.1.tgz", + "integrity": "sha1-QchHGUZGN15qGl0Qw8oFTvn8mA0=", + "dev": true + }, + "chalk": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.0.0.tgz", + "integrity": "sha1-s89O0P9Tl8mcdbj2edsvUoMfltw=", + "dev": true, + "requires": { + "ansi-styles": "^2.0.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^1.0.3", + "strip-ansi": "^2.0.1", + "supports-color": "^1.3.0" + } + }, + "has-ansi": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-1.0.3.tgz", + "integrity": "sha1-wLWxYV2eOCsP9nFp2We0JeSMpTg=", + "dev": true, + "requires": { + "ansi-regex": "^1.1.0", + "get-stdin": "^4.0.1" + } + }, + "strip-ansi": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-2.0.1.tgz", + "integrity": "sha1-32LBqpTtLxFOHQ8h/R1QSCt5pg4=", + "dev": true, + "requires": { + "ansi-regex": "^1.0.0" + } + }, + "supports-color": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-1.3.1.tgz", + "integrity": "sha1-FXWN8J2P87SswwdTn6vicJXhBC0=", + "dev": true + } + } + }, + "http-basic": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/http-basic/-/http-basic-7.0.0.tgz", + "integrity": "sha1-gvClBr6UJzLsje6+6A50bvVzbbo=", + "dev": true, + "requires": { + "@types/concat-stream": "^1.6.0", + "@types/node": "^9.4.1", + "caseless": "~0.12.0", + "concat-stream": "^1.4.6", + "http-response-object": "^3.0.1", + "parse-cache-control": "^1.0.1" + } + }, + "http-response-object": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/http-response-object/-/http-response-object-3.0.1.tgz", + "integrity": "sha512-6L0Fkd6TozA8kFSfh9Widst0wfza3U1Ex2RjJ6zNDK0vR1U1auUR6jY4Nn2Xl7CCy0ikFmxW1XcspVpb9RvwTg==", + "dev": true, + "requires": { + "@types/node": "^9.3.0" + } + }, + "iconv-lite": { + "version": "0.4.19", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", + "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==", + "dev": true + }, + "ignore": { + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.7.tgz", + "integrity": "sha512-YGG3ejvBNHRqu0559EOxxNFihD0AjpvHlC/pdGKd3X3ofe+CoJkYazwNJYTNebqpPKN+VVQbh4ZFn1DivMNuHA==", + "dev": true + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "inquirer": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz", + "integrity": "sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==", + "dev": true, + "requires": { + "ansi-escapes": "^3.0.0", + "chalk": "^2.0.0", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^2.0.4", + "figures": "^2.0.0", + "lodash": "^4.3.0", + "mute-stream": "0.0.7", + "run-async": "^2.2.0", + "rx-lite": "^4.0.8", + "rx-lite-aggregates": "^4.0.8", + "string-width": "^2.1.0", + "strip-ansi": "^4.0.0", + "through": "^2.3.6" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", + "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", + "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "dev": true, + "requires": { + "ansi-styles": "^3.1.0", + "escape-string-regexp": "^1.0.5", + "supports-color": "^4.0.0" + } + }, + "lodash": { + "version": "4.17.5", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.5.tgz", + "integrity": "sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw==", + "dev": true + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + }, + "supports-color": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", + "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "dev": true, + "requires": { + "has-flag": "^2.0.0" + } + } + } + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-builtin-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", + "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", + "dev": true, + "requires": { + "builtin-modules": "^1.0.0" + } + }, + "is-path-cwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz", + "integrity": "sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0=", + "dev": true + }, + "is-path-in-cwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz", + "integrity": "sha1-ZHdYK4IU1gI0YJRWcAO+ip6sBNw=", + "dev": true, + "requires": { + "is-path-inside": "^1.0.0" + } + }, + "is-path-inside": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", + "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", + "dev": true, + "requires": { + "path-is-inside": "^1.0.1" + } + }, + "is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", + "dev": true + }, + "is-resolvable": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", + "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "jasmine": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jasmine/-/jasmine-3.1.0.tgz", + "integrity": "sha1-K9Wf1+xuwOistk4J9Fpo7SrRlSo=", + "dev": true, + "requires": { + "glob": "^7.0.6", + "jasmine-core": "~3.1.0" + } + }, + "jasmine-core": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-3.1.0.tgz", + "integrity": "sha1-pHheE11d9lAk38kiSVPfWFvSdmw=", + "dev": true + }, + "jasmine2-custom-message": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/jasmine2-custom-message/-/jasmine2-custom-message-0.9.0.tgz", + "integrity": "sha512-HQMYCNaieAwVkt3KLNNcZz7ONpqMEJCtdAJFebTjD46GS20GZMppE7fYZY0qCd6fr0TjIFWtZcPz7vMc2VOtRg==", + "dev": true + }, + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "dev": true + }, "js-yaml": { "version": "3.10.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.10.0.tgz", "integrity": "sha512-O2v52ffjLa9VeM43J4XocZE//WT9N0IiwDa3KSHH7Tu8CtH+1qM8SIZvnsTh6v+4yFy5KUY3BHUVwjpfAWsjIA==", "dev": true, "requires": { - "argparse": "1.0.9", - "esprima": "4.0.0" + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "json-schema-traverse": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", + "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", + "dev": true + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" } }, "linkify-it": { @@ -80,16 +1357,70 @@ "integrity": "sha1-2UpGSPmxwXnWT6lykSaL22zpQ08=", "dev": true, "requires": { - "uc.micro": "1.0.3" + "uc.micro": "^1.0.1" } }, + "load-json-file": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "strip-bom": "^3.0.0" + }, + "dependencies": { + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "dev": true + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + } + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "lodash": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.1.tgz", + "integrity": "sha1-W3cjA03aTSYuWkb7LFjXzCL3FCA=", + "dev": true + }, + "lodash.cond": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/lodash.cond/-/lodash.cond-4.5.2.tgz", + "integrity": "sha1-9HGh2khr5g9quVXRcRVSPdHSVdU=", + "dev": true + }, + "lru-cache": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz", + "integrity": "sha1-bUUk6LlV+V1PW1iFHOId1y+06VI=", + "dev": true + }, "markdown": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/markdown/-/markdown-0.5.0.tgz", "integrity": "sha1-KCBbVlqK51kt4gdGPWY33BgnIrI=", "dev": true, "requires": { - "nopt": "2.1.2" + "nopt": "~2.1.1" } }, "markdown-it": { @@ -98,11 +1429,11 @@ "integrity": "sha512-tNuOCCfunY5v5uhcO2AUMArvKAyKMygX8tfup/JrgnsDqcCATQsAExBq7o5Ml9iMmO82bk6jYNLj6khcrl0JGA==", "dev": true, "requires": { - "argparse": "1.0.9", - "entities": "1.1.1", - "linkify-it": "2.0.3", - "mdurl": "1.0.1", - "uc.micro": "1.0.3" + "argparse": "^1.0.7", + "entities": "~1.1.1", + "linkify-it": "^2.0.0", + "mdurl": "^1.0.1", + "uc.micro": "^1.0.3" } }, "mdurl": { @@ -111,19 +1442,487 @@ "integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=", "dev": true }, + "mime-db": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz", + "integrity": "sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==", + "dev": true + }, + "mime-types": { + "version": "2.1.18", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz", + "integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==", + "dev": true, + "requires": { + "mime-db": "~1.33.0" + } + }, + "mimic-fn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.1.0.tgz", + "integrity": "sha1-5md4PZLonb00KBi1IwudYqZyrRg=", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, "minimist": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + }, + "dependencies": { + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + } + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "mute-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", + "dev": true + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "node-uuid": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.0.tgz", + "integrity": "sha1-B/myM3Vy/2J1x3Xh1IUT86RdemU=", + "dev": true + }, "nopt": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/nopt/-/nopt-2.1.2.tgz", "integrity": "sha1-bMzZd7gBMqB3MdbozljCyDA8+a8=", "dev": true, "requires": { - "abbrev": "1.1.1" + "abbrev": "1" + } + }, + "normalize-package-data": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", + "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "is-builtin-module": "^1.0.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "once": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/once/-/once-1.3.3.tgz", + "integrity": "sha1-suJhVXzkwxTsgwTz+oJmPkKXyiA=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "dev": true, + "requires": { + "mimic-fn": "^1.0.0" + } + }, + "optionator": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", + "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "dev": true, + "requires": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.4", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "wordwrap": "~1.0.0" + } + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, + "p-limit": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.1.0.tgz", + "integrity": "sha1-sH/y2aXYi+yAYDWJWiurZqJ5iLw=", + "dev": true + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "parse-cache-control": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parse-cache-control/-/parse-cache-control-1.0.1.tgz", + "integrity": "sha1-juqz5U+laSD+Fro493+iGqzC104=", + "dev": true + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "^1.2.0" + } + }, + "parse5": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-1.1.3.tgz", + "integrity": "sha1-i6tY0GUl8A5ON9dVEW64LnJB8UI=", + "dev": true + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-is-inside": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", + "dev": true + }, + "path-parse": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", + "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=", + "dev": true + }, + "path-type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", + "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", + "dev": true, + "requires": { + "pify": "^2.0.0" + } + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "^2.0.0" + } + }, + "pkg-dir": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-1.0.0.tgz", + "integrity": "sha1-ektQio1bstYp1EcFb/TpyTFM89Q=", + "dev": true, + "requires": { + "find-up": "^1.0.0" + }, + "dependencies": { + "find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "dev": true, + "requires": { + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "dev": true, + "requires": { + "pinkie-promise": "^2.0.0" + } + } + } + }, + "pluralize": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", + "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==", + "dev": true + }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true + }, + "process-nextick-args": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", + "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", + "dev": true + }, + "progress": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.0.tgz", + "integrity": "sha1-ihvjZr+Pwj2yvSPxDG/pILQ4nR8=", + "dev": true + }, + "promise": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/promise/-/promise-8.0.1.tgz", + "integrity": "sha1-5F1osAoXZHttpxG/he1u1HII9FA=", + "dev": true, + "requires": { + "asap": "~2.0.3" + } + }, + "pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", + "dev": true + }, + "q": { + "version": "0.9.7", + "resolved": "https://registry.npmjs.org/q/-/q-0.9.7.tgz", + "integrity": "sha1-TeLmyzspCIyeTLwDv51C+5bOL3U=", + "dev": true + }, + "qs": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", + "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==", + "dev": true + }, + "read-pkg": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", + "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", + "dev": true, + "requires": { + "load-json-file": "^2.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^2.0.0" + } + }, + "read-pkg-up": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", + "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", + "dev": true, + "requires": { + "find-up": "^2.0.0", + "read-pkg": "^2.0.0" + } + }, + "require-uncached": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", + "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", + "dev": true, + "requires": { + "caller-path": "^0.1.0", + "resolve-from": "^1.0.0" + } + }, + "requireindex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/requireindex/-/requireindex-1.1.0.tgz", + "integrity": "sha1-5UBLgVV+91225JxacgBIk/4D4WI=", + "dev": true + }, + "resolve": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.5.0.tgz", + "integrity": "sha512-hgoSGrc3pjzAPHNBg+KnFcK2HwlHTs/YrAGUr6qgTVUZmXv1UEXXl0bZNBKMA9fud6lRYFdPGz0xXxycPzmmiw==", + "dev": true, + "requires": { + "path-parse": "^1.0.5" + } + }, + "resolve-from": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", + "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=", + "dev": true + }, + "restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "dev": true, + "requires": { + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" + } + }, + "rimraf": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "dev": true, + "requires": { + "glob": "^7.0.5" + }, + "dependencies": { + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + } + } + }, + "run-async": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", + "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", + "dev": true, + "requires": { + "is-promise": "^2.1.0" + } + }, + "rx-lite": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz", + "integrity": "sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ=", + "dev": true + }, + "rx-lite-aggregates": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz", + "integrity": "sha1-dTuHqJoRyVRnxKwWJsTvxOBcZ74=", + "dev": true, + "requires": { + "rx-lite": "*" + } + }, + "safe-buffer": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", + "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", + "dev": true + }, + "semver": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/semver/-/semver-4.3.6.tgz", + "integrity": "sha1-MAvG4OhjdPe6YQaLWx7NV/xlMto=", + "dev": true + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "sigmund": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", + "integrity": "sha1-P/IfGYytIXX587eBhT/ZTQ0ZtZA=", + "dev": true + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true + }, + "slice-ansi": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz", + "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0" + }, + "dependencies": { + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + } } }, "source-map": { @@ -132,18 +1931,227 @@ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true }, + "spdx-correct": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-1.0.2.tgz", + "integrity": "sha1-SzBz2TP/UfORLwOsVRlJikFQ20A=", + "dev": true, + "requires": { + "spdx-license-ids": "^1.0.2" + } + }, + "spdx-expression-parse": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz", + "integrity": "sha1-m98vIOH0DtRH++JzJmGR/O1RYmw=", + "dev": true + }, + "spdx-license-ids": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz", + "integrity": "sha1-yd96NCRZSt5r0RkA1ZZpbcBrrFc=", + "dev": true + }, "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", "dev": true }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } + } + }, "string.prototype.repeat": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/string.prototype.repeat/-/string.prototype.repeat-0.2.0.tgz", "integrity": "sha1-q6Nt4I3O5qWjN9SbLqHaGyj8Ds8=", "dev": true }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + }, + "sync-request": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/sync-request/-/sync-request-6.0.0.tgz", + "integrity": "sha512-jGNIAlCi9iU4X3Dm4oQnNQshDD3h0/1A7r79LyqjbjUnj69sX6mShAXlhRXgImsfVKtTcnra1jfzabdZvp+Lmw==", + "dev": true, + "requires": { + "http-response-object": "^3.0.1", + "sync-rpc": "^1.2.1", + "then-request": "^6.0.0" + } + }, + "sync-rpc": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/sync-rpc/-/sync-rpc-1.3.3.tgz", + "integrity": "sha512-xtTZUAeFaescZALim6yqjMDsVQD7mKAkdZ0/FOvVjlrr4uQqrARlWxs4P7bKV2ZPnvOyTVyHyyxqztxtBF4iIw==", + "dev": true, + "requires": { + "get-port": "^3.1.0" + } + }, + "table": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/table/-/table-4.0.2.tgz", + "integrity": "sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA==", + "dev": true, + "requires": { + "ajv": "^5.2.3", + "ajv-keywords": "^2.1.0", + "chalk": "^2.1.0", + "lodash": "^4.17.4", + "slice-ansi": "1.0.0", + "string-width": "^2.1.1" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", + "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", + "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "dev": true, + "requires": { + "ansi-styles": "^3.1.0", + "escape-string-regexp": "^1.0.5", + "supports-color": "^4.0.0" + } + }, + "lodash": { + "version": "4.17.5", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.5.tgz", + "integrity": "sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw==", + "dev": true + }, + "supports-color": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", + "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "dev": true, + "requires": { + "has-flag": "^2.0.0" + } + } + } + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "then-request": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/then-request/-/then-request-6.0.0.tgz", + "integrity": "sha512-xA+7uEMc+jsQIoyySJ93Ad08Kuqnik7u6jLS5hR91Z3smAoCfL3M8/MqMlobAa9gzBfO9pA88A/AntfepkkMJQ==", + "dev": true, + "requires": { + "@types/concat-stream": "^1.6.0", + "@types/form-data": "0.0.33", + "@types/node": "^8.0.0", + "@types/qs": "^6.2.31", + "caseless": "~0.12.0", + "concat-stream": "^1.6.0", + "form-data": "^2.2.0", + "http-basic": "^7.0.0", + "http-response-object": "^3.0.1", + "promise": "^8.0.0", + "qs": "^6.4.0" + }, + "dependencies": { + "@types/node": { + "version": "8.10.8", + "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.8.tgz", + "integrity": "sha512-BvcUxNZe9JgiiUVivtiQt3NrPVu9OAQzkxR1Ko9ESftCYU7V6Np5kpDzQwxd+34lsop7SNRdL292Flv52OvCaw==", + "dev": true + } + } + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "requires": { + "os-tmpdir": "~1.0.2" + } + }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2" + } + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true + }, "uc.micro": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.3.tgz", @@ -156,9 +2164,115 @@ "integrity": "sha512-dNib7aUDNZFJNTXFyq0CDmLRVOsnY1F+IQgt2FAOdZFx2+LvKVLbbIb/fL+BYKCv3YH3bPCE/6M/JaxChtQLHQ==", "dev": true, "requires": { - "commander": "2.14.1", - "source-map": "0.6.1" + "commander": "~2.14.1", + "source-map": "~0.6.1" } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "validate-npm-package-license": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz", + "integrity": "sha1-KAS6vnEq0zeUWaz74kdGqywwP7w=", + "dev": true, + "requires": { + "spdx-correct": "~1.0.0", + "spdx-expression-parse": "~1.0.0" + } + }, + "vow": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/vow/-/vow-0.4.3.tgz", + "integrity": "sha1-1cOU1PHoRMmIEAtXtUCVbEoAW6Y=", + "dev": true + }, + "vow-fs": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/vow-fs/-/vow-fs-0.3.1.tgz", + "integrity": "sha1-G3/GTXJzp8EmkAIWdMGpBM6rjK8=", + "dev": true, + "requires": { + "glob": "3.2.8", + "node-uuid": "1.4.0", + "vow-queue": "0.1.0" + }, + "dependencies": { + "glob": { + "version": "3.2.8", + "resolved": "https://registry.npmjs.org/glob/-/glob-3.2.8.tgz", + "integrity": "sha1-VQb0MRchvMYYx9jboUQYh1AwcHM=", + "dev": true, + "requires": { + "inherits": "2", + "minimatch": "~0.2.11" + } + }, + "minimatch": { + "version": "0.2.14", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz", + "integrity": "sha1-x054BXT2PG+aCQ6Q775u9TpqdWo=", + "dev": true, + "requires": { + "lru-cache": "2", + "sigmund": "~1.0.0" + } + } + } + }, + "vow-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/vow-queue/-/vow-queue-0.1.0.tgz", + "integrity": "sha1-qbVhR3x+pdVjsMqqUuQOZo3gwjg=", + "dev": true + }, + "vuln-regex-detector": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/vuln-regex-detector/-/vuln-regex-detector-1.3.0.tgz", + "integrity": "sha512-QWm8buVznZjdcfMuFHYsiNfHd0YQ7dO41G0iEGVPlUng5eZUo8uy+QsVCmbgVZ2b96xprY1Tz9dQD7QtvbFHXw==", + "dev": true, + "requires": { + "sync-request": "^6.0.0" + } + }, + "which": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", + "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "write": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", + "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", + "dev": true, + "requires": { + "mkdirp": "^0.5.1" + } + }, + "yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", + "dev": true } } } diff --git a/package.json b/package.json index 3b73c144..b2230241 100644 --- a/package.json +++ b/package.json @@ -2,14 +2,14 @@ "name": "marked", "description": "A markdown parser built for speed", "author": "Christopher Jeffrey", - "version": "0.3.12", + "version": "0.5.0", "main": "./lib/marked.js", "bin": "./bin/marked", "man": "./man/marked.1", - "repository": "git://github.com/chjj/marked.git", - "homepage": "https://github.com/chjj/marked", + "repository": "git://github.com/markedjs/marked.git", + "homepage": "https://marked.js.org", "bugs": { - "url": "http://github.com/chjj/marked/issues" + "url": "http://github.com/markedjs/marked/issues" }, "license": "MIT", "keywords": [ @@ -23,16 +23,39 @@ "html" ], "devDependencies": { - "markdown": "0.x", - "markdown-it": "8.x", "commonmark": "0.x", + "eslint": "^4.15.0", + "eslint-config-standard": "^11.0.0-beta.0", + "eslint-plugin-import": "^2.8.0", + "eslint-plugin-node": "^5.2.1", + "eslint-plugin-promise": "^3.6.0", + "eslint-plugin-standard": "^3.0.1", + "eslint-plugin-vuln-regex-detector": "^1.0.4", "front-matter": "^2.3.0", "glob-to-regexp": "0.3.0", + "html-differ": "^1.3.4", + "jasmine": "^3.1.0", + "jasmine2-custom-message": "^0.9.0", + "markdown": "0.x", + "markdown-it": "8.x", "uglify-js": "^3.3.10" }, "scripts": { - "test": "node test", + "test": "jasmine --config=jasmine.json", + "test:unit": "npm test -- test/unit/**/*-spec.js", + "test:specs": "npm test -- test/specs/**/*-spec.js", + "test:cm": "npm test -- test/specs/commonmark/**/*-spec.js", + "test:gfm": "npm test -- test/specs/gfm/**/*-spec.js", + "test:marked": "npm test -- test/specs/marked/**/*-spec.js", + "test:old": "node test", + "test:lint": "eslint bin/marked .", + "test:redos": "eslint --plugin vuln-regex-detector --rule '\"vuln-regex-detector/no-vuln-regex\": 2' lib/marked.js", "bench": "node test --bench", - "build": "uglifyjs lib/marked.js -cm --comments /Copyright/ -o marked.min.js" + "lint": "eslint --fix bin/marked .", + "build": "uglifyjs lib/marked.js -cm --comments /Copyright/ -o marked.min.js", + "preversion": "npm run build && (git diff --quiet || git commit -am 'minify')" + }, + "engines": { + "node": ">=0.10.0" } } diff --git a/test/browser/index.js b/test/browser/index.js index d5d7ee69..8208fa3f 100644 --- a/test/browser/index.js +++ b/test/browser/index.js @@ -1,11 +1,13 @@ -var fs = require('fs'); +var fs = require('fs'), + path = require('path'); -var test = require('../') - , runTests = test.runTests - , load = test.load; +var testMod = require('../'), + load = testMod.load; -var express = require('express') - , app = express(); +var express = require('express'), + app = express(); + +var files = load(); app.use(function(req, res, next) { var setHeader = res.setHeader; @@ -21,21 +23,17 @@ app.use(function(req, res, next) { next(); }); -var dir = __dirname + '/../tests' - , files = {}; - app.get('/test.js', function(req, res, next) { - var test = fs.readFileSync(__dirname + '/test.js', 'utf8') - , files = load(); - - test = test.replace('__TESTS__', JSON.stringify(files)); - test = test.replace('__MAIN__', runTests + ''); + var test = fs.readFileSync(path.join(__dirname, 'test.js'), 'utf8'); + var testScript = test.replace('__TESTS__', JSON.stringify(files)) + .replace('__MAIN__', testMod.runTests + '') + .replace('__LIBS__', testMod.testFile + ''); res.contentType('.js'); - res.send(test); + res.send(testScript); }); -app.use(express.static(__dirname + '/../../lib')); +app.use(express.static(path.join(__dirname, '/../../lib'))); app.use(express.static(__dirname)); app.listen(8080); diff --git a/test/browser/test.js b/test/browser/test.js index cef9e376..59917dd4 100644 --- a/test/browser/test.js +++ b/test/browser/test.js @@ -1,62 +1,66 @@ + ;(function() { + var console = {}, + files = __TESTS__; // eslint-disable-line no-undef -var console = {} - , files = __TESTS__; + console.log = function(text) { + var args = Array.prototype.slice.call(arguments, 1), + i = 0; -console.log = function(text) { - var args = Array.prototype.slice.call(arguments, 1) - , i = 0; + text = text.replace(/%\w/g, function() { + return args[i++] || ''; + }); - text = text.replace(/%\w/g, function() { - return args[i++] || ''; - }); + if (window.console) window.console.log(text); + document.body.innerHTML += '
    ' + escape(text) + '
    '; + }; - if (window.console) window.console.log(text); - document.body.innerHTML += '
    ' + escape(text) + '
    '; -}; + if (!Object.keys) { + Object.keys = function(obj) { + var out = [], + key; -if (!Object.keys) { - Object.keys = function(obj) { - var out = [] - , key; - - for (key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - out.push(key); + for (key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + out.push(key); + } } - } - return out; - }; -} + return out; + }; + } -if (!Array.prototype.forEach) { - Array.prototype.forEach = function(callback, context) { - for (var i = 0; i < this.length; i++) { - callback.call(context || null, this[i], i, obj); - } - }; -} + if (!Array.prototype.forEach) { + // eslint-disable-next-line no-extend-native + Array.prototype.forEach = function(callback, context) { + for (var i = 0; i < this.length; i++) { + callback.call(context || null, this[i], i, this); + } + }; + } -if (!String.prototype.trim) { - String.prototype.trim = function() { - return this.replace(/^\s+|\s+$/g, ''); - }; -} + if (!String.prototype.trim) { + // eslint-disable-next-line no-extend-native + String.prototype.trim = function() { + return this.replace(/^\s+|\s+$/g, ''); + }; + } -function load() { - return files; -} + // eslint-disable-next-line no-unused-vars + function load() { + return files; + } -function escape(html, encode) { - return html - .replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&') - .replace(//g, '>') - .replace(/"/g, '"') - .replace(/'/g, '''); -} + function escape(html, encode) { + return html + .replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&') + .replace(//g, '>') + .replace(/"/g, '"') + .replace(/'/g, '''); + } -(__MAIN__)(); + __LIBS__; // eslint-disable-line no-undef, no-unused-expressions + (__MAIN__)(); // eslint-disable-line no-undef }).call(this); diff --git a/test/helpers/helpers.js b/test/helpers/helpers.js new file mode 100644 index 00000000..d9244a88 --- /dev/null +++ b/test/helpers/helpers.js @@ -0,0 +1,5 @@ +var marked = require('../../lib/marked.js'); + +beforeEach(function () { + marked.setOptions(marked.getDefaults()); +}); diff --git a/test/index.js b/test/index.js index 0fe6add2..f9277049 100644 --- a/test/index.js +++ b/test/index.js @@ -3,37 +3,35 @@ /** * marked tests * Copyright (c) 2011-2013, Christopher Jeffrey. (MIT Licensed) - * https://github.com/chjj/marked + * https://github.com/markedjs/marked */ /** * Modules */ -var fs = require('fs') - , path = require('path') - , fm = require('front-matter') - , g2r = require('glob-to-regexp') - , marked = require('../') - , markedMin = require('../marked.min.js'); +var fs = require('fs'), + path = require('path'), + fm = require('front-matter'), + g2r = require('glob-to-regexp'), + marked = require('../'), + markedMin = require('../marked.min.js'); /** * Load Tests */ function load(options) { - var dir = __dirname + '/compiled_tests' - , files = {} - , list - , file - , name - , content - , regex - , skip - , glob = g2r(options.glob || "*", { extended: true }) - , i - , j - , l; + options = options || {}; + var dir = path.join(__dirname, 'compiled_tests'), + files = {}, + list, + file, + name, + content, + glob = g2r(options.glob || '*', { extended: true }), + i, + l; list = fs .readdirSync(dir) @@ -45,7 +43,7 @@ function load(options) { l = list.length; for (i = 0; i < l; i++) { - name = path.basename(list[i], ".md"); + name = path.basename(list[i], '.md'); if (glob.test(name)) { file = path.join(dir, list[i]); content = fm(fs.readFileSync(file, 'utf8')); @@ -62,7 +60,7 @@ function load(options) { if (!options.glob) { // Change certain tests to allow // comparison to older benchmark times. - fs.readdirSync(__dirname + '/new').forEach(function(name) { + fs.readdirSync(path.join(__dirname, 'new')).forEach(function(name) { if (path.extname(name) === '.html') return; if (name === 'main.md') return; delete files[name]; @@ -93,112 +91,131 @@ function runTests(engine, options) { engine = null; } - var engine = engine || marked - , options = options || {} - , files = options.files || load(options) - , complete = 0 - , failed = 0 - , failures = [] - , keys = Object.keys(files) - , i = 0 - , len = keys.length - , filename - , file - , opts - , text - , html - , j - , l; + engine = engine || marked; + options = options || {}; + var succeeded = 0, + failed = 0, + files = options.files || load(options), + filenames = Object.keys(files), + len = filenames.length, + success, + i, + filename, + file; if (options.marked) { marked.setOptions(options.marked); } -main: - for (; i < len; i++) { - filename = keys[i]; + for (i = 0; i < len; i++) { + filename = filenames[i]; file = files[filename]; - opts = Object.keys(file.options); - if (marked._original) { - marked.defaults = marked._original; - delete marked._original; - } + success = testFile(engine, file, filename, i + 1); - if (opts.length) { - marked._original = marked.defaults; - marked.defaults = {}; - Object.keys(marked._original).forEach(function(key) { - marked.defaults[key] = marked._original[key]; - }); - opts.forEach(function(key) { - if (marked.defaults.hasOwnProperty(key)) { - marked.defaults[key] = file.options[key]; - } - }); - } - - try { - text = engine(file.text).replace(/\s/g, ''); - html = file.html.replace(/\s/g, ''); - } catch (e) { - console.log('%s failed.', filename); - throw e; - } - - j = 0; - l = html.length; - - for (; j < l; j++) { - if (text[j] !== html[j]) { - failed++; - failures.push(filename); - - text = text.substring( - Math.max(j - 30, 0), - Math.min(j + 30, text.length)); - - html = html.substring( - Math.max(j - 30, 0), - Math.min(j + 30, html.length)); - - console.log( - '\n#%d. %s failed at offset %d. Near: "%s".\n', - i + 1, filename, j, text); - - console.log('\nGot:\n%s\n', text.trim() || text); - console.log('\nExpected:\n%s\n', html.trim() || html); - - if (options.stop) { - break main; - } - - continue main; + if (success) { + succeeded++; + } else { + failed++; + if (options.stop) { + break; } } - - complete++; - console.log('#%d. %s completed.', i + 1, filename); } - console.log('%d/%d tests completed successfully.', complete, len); + console.log('%d/%d tests completed successfully.', succeeded, len); if (failed) console.log('%d/%d tests failed.', failed, len); return !failed; } +/** + * Test a file + */ + +function testFile(engine, file, filename, index) { + var opts = Object.keys(file.options), + text, + html, + j, + l, + before, + elapsed; + + if (marked._original) { + marked.defaults = marked._original; + delete marked._original; + } + + console.log('#%d. Test %s', index, filename); + + if (opts.length) { + marked._original = marked.defaults; + marked.defaults = {}; + Object.keys(marked._original).forEach(function(key) { + marked.defaults[key] = marked._original[key]; + }); + opts.forEach(function(key) { + if (marked.defaults.hasOwnProperty(key)) { + marked.defaults[key] = file.options[key]; + } + }); + } + + before = process.hrtime(); + try { + text = engine(file.text).replace(/\s/g, ''); + html = file.html.replace(/\s/g, ''); + } catch (e) { + elapsed = process.hrtime(before); + console.log(' failed in %dms', prettyElapsedTime(elapsed)); + throw e; + } + + elapsed = process.hrtime(before); + + l = html.length; + + for (j = 0; j < l; j++) { + if (text[j] !== html[j]) { + text = text.substring( + Math.max(j - 30, 0), + Math.min(j + 30, text.length)); + + html = html.substring( + Math.max(j - 30, 0), + Math.min(j + 30, l)); + + console.log(' failed in %dms at offset %d. Near: "%s".\n', prettyElapsedTime(elapsed), j, text); + + console.log('\nGot:\n%s\n', text.trim() || text); + console.log('\nExpected:\n%s\n', html.trim() || html); + + return false; + } + } + + if (elapsed[0] > 0) { + console.log(' failed because it took too long.\n\n passed in %dms', prettyElapsedTime(elapsed)); + return false; + } + + console.log(' passed in %dms', prettyElapsedTime(elapsed)); + return true; +} + /** * Benchmark a function */ function bench(name, files, func) { - var start = Date.now() - , times = 1000 - , keys = Object.keys(files) - , i - , l = keys.length - , filename - , file; + var start = Date.now(), + times = 1000, + keys = Object.keys(files), + i, + l = keys.length, + filename, + file; while (times--) { for (i = 0; i < l; i++) { @@ -216,8 +233,8 @@ function bench(name, files, func) { */ function runBench(options) { - var options = options || {} - , files = load(options); + options = options || {}; + var files = load(options); // Non-GFM, Non-pedantic marked.setOptions({ @@ -308,8 +325,8 @@ function runBench(options) { */ function time(options) { - var options = options || {} - , files = load(options); + options = options || {}; + var files = load(options); if (options.marked) { marked.setOptions(options.marked); } @@ -331,7 +348,7 @@ function time(options) { function fix() { ['compiled_tests', 'original', 'new'].forEach(function(dir) { try { - fs.mkdirSync(path.resolve(__dirname, dir), 0o755); + fs.mkdirSync(path.resolve(__dirname, dir)); } catch (e) { ; } @@ -344,23 +361,28 @@ function fix() { // cp -r original tests fs.readdirSync(path.resolve(__dirname, 'original')).forEach(function(file) { - var text = fs.readFileSync(path.resolve(__dirname, 'original', file)); + var text = fs.readFileSync(path.resolve(__dirname, 'original', file), 'utf8'); if (path.extname(file) === '.md') { - text = '---\ngfm: false\n---\n' + text; + if (fm.test(text)) { + text = fm(text); + text = '---\n' + text.frontmatter + '\ngfm: false\n---\n' + text.body; + } else { + text = '---\ngfm: false\n---\n' + text; + } } fs.writeFileSync(path.resolve(__dirname, 'compiled_tests', file), text); }); // node fix.js - var dir = __dirname + '/compiled_tests'; + var dir = path.join(__dirname, 'compiled_tests'); fs.readdirSync(dir).filter(function(file) { return path.extname(file) === '.html'; }).forEach(function(file) { - var file = path.join(dir, file) - , html = fs.readFileSync(file, 'utf8'); + file = path.join(dir, file); + var html = fs.readFileSync(file, 'utf8'); // fix unencoded quotes html = html @@ -380,7 +402,7 @@ function fix() { .replace(/</g, '<') .replace(/&/g, '&'); - id = id.toLowerCase().replace(/[^\w]+/g, '-'); + id = id.toLowerCase().replace(/[^\w]+/g, '-'); return '<' + h + ' id="' + id + '">' + text + ''; }); @@ -390,8 +412,8 @@ function fix() { // turn
    into
    fs.readdirSync(dir).forEach(function(file) { - var file = path.join(dir, file) - , text = fs.readFileSync(file, 'utf8'); + file = path.join(dir, file); + var text = fs.readFileSync(file, 'utf8'); text = text.replace(/(<|<)hr\s*\/(>|>)/g, '$1hr$2'); @@ -419,12 +441,12 @@ function fix() { * Argument Parsing */ -function parseArg(argv) { - var argv = process.argv.slice(2) - , options = {} - , opt = "" - , orphans = [] - , arg; +function parseArg() { + var argv = process.argv.slice(2), + options = {}, + opt = '', + orphans = [], + arg; function getarg() { var arg = argv.shift(); @@ -565,8 +587,16 @@ if (!module.parent) { exports = main; exports.main = main; exports.runTests = runTests; + exports.testFile = testFile; exports.runBench = runBench; exports.load = load; exports.bench = bench; module.exports = exports; } + +// returns time to millisecond granularity +function prettyElapsedTime(hrtimeElapsed) { + var seconds = hrtimeElapsed[0]; + var frac = Math.round(hrtimeElapsed[1] / 1e3) / 1e3; + return seconds * 1e3 + frac; +} diff --git a/test/new/cm_blockquotes.html b/test/new/cm_blockquotes.html index 363f4e21..f63e5e00 100644 --- a/test/new/cm_blockquotes.html +++ b/test/new/cm_blockquotes.html @@ -32,8 +32,7 @@ baz

    > # Foo
     > bar
    -> baz
    -
    +> baz

    Example 195

    @@ -78,11 +77,9 @@ foo

    For the same reason, we can’t omit the > in front of subsequent lines of an indented or fenced code block:

    -
    foo
    -
    +
    foo
    -
    bar
    -
    +
    bar

    Example 200

    @@ -94,8 +91,7 @@ foo <pre><code></code></pre> </blockquote> <p>foo</p> -<pre><code></code></pre> - +<pre><code></code></pre>

    Example 201

    > foo
    @@ -104,8 +100,7 @@ foo
     <blockquote>
     <p>foo
     - bar</p>
    -</blockquote>
    -
    +</blockquote>

    Example 202

    @@ -231,8 +226,7 @@ baz

    When including an indented code block in a block quote, remember that the block quote marker includes both the > and a following space. So five spaces are needed after the >:

    -
    code
    -
    +
    code

    not code

    diff --git a/test/new/cm_html_blocks.html b/test/new/cm_html_blocks.html new file mode 100644 index 00000000..80fdff57 --- /dev/null +++ b/test/new/cm_html_blocks.html @@ -0,0 +1,300 @@ +

    HTML blocks

    + +

    Example 116

    + +
    +
    +**Hello**,
    +

    world. +

    +
    + +

    Example 117

    + + + + + +
    + hi +
    +

    okay.

    + +

    Example 118

    + +
    + *hello* + + +

    Example 119

    + +
    +*foo* + +

    Example 120

    + +
    +

    Markdown

    +
    + +

    Example 121

    + +
    +
    + +

    Example 122

    + +
    +
    + +

    Example 123

    + +
    +*foo* +

    bar

    + +

    Example 124

    + +
    Example 125

    + +
    Example 126 + +
    Example 127 + +
    *foo*
    + +

    Example 128

    + +
    +foo +
    + +

    Example 129

    + +
    +``` c +int x = 33; +``` + +

    Example 130

    + + +*bar* + + +

    Example 131

    + + +*bar* + + +

    Example 132

    + + +*bar* + + +

    Example 133

    + + +*bar* + +

    Example 134

    + + +*foo* + + +

    Example 135

    + + +

    foo

    +
    + +

    Example 136

    + +

    foo

    + +

    Example 137

    + +
    
    +import Text.HTML.TagSoup
    +
    +main :: IO ()
    +main = print $ parseTags tags
    +
    +

    okay

    + +

    Example 138

    + + +

    okay

    + +

    Example 139

    + + +

    okay

    + +

    Example 141

    + +
    +
    +foo +
    +

    bar

    + +

    Example 142

    + +
      +
    • +
      +
    • +
    • foo
    • +
    + +

    Example 143

    + + +

    foo

    + +

    Example 144

    + +*bar* +

    baz

    + +

    Example 145

    + +1. *bar* + +

    Example 146

    + + +

    okay

    + +

    Example 147

    + +'; + +?> +

    okay

    + +

    Example 148

    + + + +

    Example 149

    + + +

    okay

    + +

    Example 150

    + + +
    <!-- foo -->
    +
    + +

    Example 151

    + +
    +
    <div>
    +
    + +

    Example 152

    + +

    Foo

    +
    +bar +
    + +

    Example 153

    + +
    +bar +
    +*foo* + +

    Example 154

    + +

    Foo + +baz

    + +

    Example 155

    + +
    +

    Emphasized text.

    +
    + +

    Example 156

    + +
    +*Emphasized* text. +
    + +

    Example 157

    + + + + + +
    +Hi +
    + +

    Example 158

    + + + +
    <td>
    +  Hi
    +</td>
    +
    + +
    + +

    Example 140

    + +

    If there is no matching end tag, the block will end at the end of the document (or the enclosing block quote or list item):

    + + +okay + +### Example 141 + +>
    +> foo + +bar + +### Example 142 + +-
    +- foo + +### Example 143 + + +*foo* + +### Example 144 + +*bar* +*baz* + +### Example 145 + +1. *bar* + +### Example 146 + + +okay + +### Example 147 + +'; + +?> +okay + +### Example 148 + + + +### Example 149 + + +okay + +### Example 150 + + + + + +### Example 151 + +
    + +
    + +### Example 152 + +Foo +
    +bar +
    + +### Example 153 + +
    +bar +
    +*foo* + +### Example 154 + +Foo +
    +baz + +### Example 155 + +
    + +*Emphasized* text. + +
    + +### Example 156 + +
    +*Emphasized* text. +
    + +### Example 157 + + + + + + + + + +
    +Hi +
    + +### Example 158 + + + + + + + + + +
    + Hi +
    + +### Example 140 + +If there is no matching end tag, the block will end at the end of the document (or the enclosing block quote or list item): + +\n

    okay

    \n", + "markdown": "\nh1 {color:red;}\n\np {color:blue;}\n\nokay\n", + "example": 139, + "start_line": 2398 + }, + { + "end_line": 2431, + "section": "HTML blocks", + "html": "\n\nfoo\n", + "markdown": "\n\nfoo\n", + "example": 140, + "start_line": 2421 + }, + { + "end_line": 2445, + "section": "HTML blocks", + "html": "
    \n
    \nfoo\n
    \n

    bar

    \n", + "markdown": ">
    \n> foo\n\nbar\n", + "example": 141, + "start_line": 2434 + }, + { + "end_line": 2458, + "section": "HTML blocks", + "html": "
      \n
    • \n
      \n
    • \n
    • foo
    • \n
    \n", + "markdown": "-
    \n- foo\n", + "example": 142, + "start_line": 2448 + }, + { + "end_line": 2469, + "section": "HTML blocks", + "html": "\n

    foo

    \n", + "markdown": "\n*foo*\n", + "example": 143, + "start_line": 2463 + }, + { + "end_line": 2478, + "section": "HTML blocks", + "html": "*bar*\n

    baz

    \n", + "markdown": "*bar*\n*baz*\n", + "example": 144, + "start_line": 2472 + }, + { + "end_line": 2492, + "section": "HTML blocks", + "html": "1. *bar*\n", + "markdown": "1. *bar*\n", + "example": 145, + "start_line": 2484 + }, + { + "end_line": 2509, + "section": "HTML blocks", + "html": "\n

    okay

    \n", + "markdown": "\nokay\n", + "example": 146, + "start_line": 2497 + }, + { + "end_line": 2529, + "section": "HTML blocks", + "html": "';\n\n?>\n

    okay

    \n", + "markdown": "';\n\n?>\nokay\n", + "example": 147, + "start_line": 2515 + }, + { + "end_line": 2538, + "section": "HTML blocks", + "html": "\n", + "markdown": "\n", + "example": 148, + "start_line": 2534 + }, + { + "end_line": 2571, + "section": "HTML blocks", + "html": "\n

    okay

    \n", + "markdown": "\nokay\n", + "example": 149, + "start_line": 2543 + }, + { + "end_line": 2584, + "section": "HTML blocks", + "html": " \n
    <!-- foo -->\n
    \n", + "markdown": " \n\n \n", + "example": 150, + "start_line": 2576 + }, + { + "end_line": 2595, + "section": "HTML blocks", + "html": "
    \n
    <div>\n
    \n", + "markdown": "
    \n\n
    \n", + "example": 151, + "start_line": 2587 + }, + { + "end_line": 2611, + "section": "HTML blocks", + "html": "

    Foo

    \n
    \nbar\n
    \n", + "markdown": "Foo\n
    \nbar\n
    \n", + "example": 152, + "start_line": 2601 + }, + { + "end_line": 2627, + "section": "HTML blocks", + "html": "
    \nbar\n
    \n*foo*\n", + "markdown": "
    \nbar\n
    \n*foo*\n", + "example": 153, + "start_line": 2617 + }, + { + "end_line": 2640, + "section": "HTML blocks", + "html": "

    Foo\n\nbaz

    \n", + "markdown": "Foo\n\nbaz\n", + "example": 154, + "start_line": 2632 + }, + { + "end_line": 2683, + "section": "HTML blocks", + "html": "
    \n

    Emphasized text.

    \n
    \n", + "markdown": "
    \n\n*Emphasized* text.\n\n
    \n", + "example": 155, + "start_line": 2673 + }, + { + "end_line": 2694, + "section": "HTML blocks", + "html": "
    \n*Emphasized* text.\n
    \n", + "markdown": "
    \n*Emphasized* text.\n
    \n", + "example": 156, + "start_line": 2686 + }, + { + "end_line": 2728, + "section": "HTML blocks", + "html": "\n\n\n\n
    \nHi\n
    \n", + "markdown": "\n\n\n\n\n\n\n\n
    \nHi\n
    \n", + "example": 157, + "start_line": 2708 + }, + { + "end_line": 2756, + "section": "HTML blocks", + "html": "\n \n
    <td>\n  Hi\n</td>\n
    \n \n
    \n", + "markdown": "\n\n \n\n \n\n \n\n
    \n Hi\n
    \n", + "example": 158, + "start_line": 2735 + }, + { + "end_line": 2789, + "section": "Link reference definitions", + "html": "

    foo

    \n", + "markdown": "[foo]: /url \"title\"\n\n[foo]\n", + "example": 159, + "start_line": 2783 + }, + { + "end_line": 2800, + "section": "Link reference definitions", + "html": "

    foo

    \n", + "markdown": " [foo]: \n /url \n 'the title' \n\n[foo]\n", + "example": 160, + "start_line": 2792 + }, + { + "end_line": 2809, + "section": "Link reference definitions", + "html": "

    Foo*bar]

    \n", + "markdown": "[Foo*bar\\]]:my_(url) 'title (with parens)'\n\n[Foo*bar\\]]\n", + "example": 161, + "start_line": 2803 + }, + { + "end_line": 2820, + "section": "Link reference definitions", + "html": "

    Foo bar

    \n", + "markdown": "[Foo bar]:\n\n'title'\n\n[Foo bar]\n", + "example": 162, + "start_line": 2812 + }, + { + "end_line": 2839, + "section": "Link reference definitions", + "html": "

    foo

    \n", + "markdown": "[foo]: /url '\ntitle\nline1\nline2\n'\n\n[foo]\n", + "example": 163, + "start_line": 2825 + }, + { + "end_line": 2854, + "section": "Link reference definitions", + "html": "

    [foo]: /url 'title

    \n

    with blank line'

    \n

    [foo]

    \n", + "markdown": "[foo]: /url 'title\n\nwith blank line'\n\n[foo]\n", + "example": 164, + "start_line": 2844 + }, + { + "end_line": 2866, + "section": "Link reference definitions", + "html": "

    foo

    \n", + "markdown": "[foo]:\n/url\n\n[foo]\n", + "example": 165, + "start_line": 2859 + }, + { + "end_line": 2878, + "section": "Link reference definitions", + "html": "

    [foo]:

    \n

    [foo]

    \n", + "markdown": "[foo]:\n\n[foo]\n", + "example": 166, + "start_line": 2871 + }, + { + "end_line": 2890, + "section": "Link reference definitions", + "html": "

    foo

    \n", + "markdown": "[foo]: /url\\bar\\*baz \"foo\\\"bar\\baz\"\n\n[foo]\n", + "example": 167, + "start_line": 2884 + }, + { + "end_line": 2901, + "section": "Link reference definitions", + "html": "

    foo

    \n", + "markdown": "[foo]\n\n[foo]: url\n", + "example": 168, + "start_line": 2895 + }, + { + "end_line": 2914, + "section": "Link reference definitions", + "html": "

    foo

    \n", + "markdown": "[foo]\n\n[foo]: first\n[foo]: second\n", + "example": 169, + "start_line": 2907 + }, + { + "end_line": 2926, + "section": "Link reference definitions", + "html": "

    Foo

    \n", + "markdown": "[FOO]: /url\n\n[Foo]\n", + "example": 170, + "start_line": 2920 + }, + { + "end_line": 2935, + "section": "Link reference definitions", + "html": "

    αγω

    \n", + "markdown": "[ΑΓΩ]: /φου\n\n[αγω]\n", + "example": 171, + "start_line": 2929 + }, + { + "end_line": 2944, + "section": "Link reference definitions", + "html": "", + "markdown": "[foo]: /url\n", + "example": 172, + "start_line": 2941 + }, + { + "end_line": 2956, + "section": "Link reference definitions", + "html": "

    bar

    \n", + "markdown": "[\nfoo\n]: /url\nbar\n", + "example": 173, + "start_line": 2949 + }, + { + "end_line": 2966, + "section": "Link reference definitions", + "html": "

    [foo]: /url "title" ok

    \n", + "markdown": "[foo]: /url \"title\" ok\n", + "example": 174, + "start_line": 2962 + }, + { + "end_line": 2976, + "section": "Link reference definitions", + "html": "

    "title" ok

    \n", + "markdown": "[foo]: /url\n\"title\" ok\n", + "example": 175, + "start_line": 2971 + }, + { + "end_line": 2990, + "section": "Link reference definitions", + "html": "
    [foo]: /url "title"\n
    \n

    [foo]

    \n", + "markdown": " [foo]: /url \"title\"\n\n[foo]\n", + "example": 176, + "start_line": 2982 + }, + { + "end_line": 3006, + "section": "Link reference definitions", + "html": "
    [foo]: /url\n
    \n

    [foo]

    \n", + "markdown": "```\n[foo]: /url\n```\n\n[foo]\n", + "example": 177, + "start_line": 2996 + }, + { + "end_line": 3020, + "section": "Link reference definitions", + "html": "

    Foo\n[bar]: /baz

    \n

    [bar]

    \n", + "markdown": "Foo\n[bar]: /baz\n\n[bar]\n", + "example": 178, + "start_line": 3011 + }, + { + "end_line": 3035, + "section": "Link reference definitions", + "html": "

    Foo

    \n
    \n

    bar

    \n
    \n", + "markdown": "# [Foo]\n[foo]: /url\n> bar\n", + "example": 179, + "start_line": 3026 + }, + { + "end_line": 3054, + "section": "Link reference definitions", + "html": "

    foo,\nbar,\nbaz

    \n", + "markdown": "[foo]: /foo-url \"foo\"\n[bar]: /bar-url\n \"bar\"\n[baz]: /baz-url\n\n[foo],\n[bar],\n[baz]\n", + "example": 180, + "start_line": 3041 + }, + { + "end_line": 3070, + "section": "Link reference definitions", + "html": "

    foo

    \n
    \n
    \n", + "markdown": "[foo]\n\n> [foo]: /url\n", + "example": 181, + "start_line": 3062 + }, + { + "end_line": 3092, + "section": "Paragraphs", + "html": "

    aaa

    \n

    bbb

    \n", + "markdown": "aaa\n\nbbb\n", + "example": 182, + "start_line": 3085 + }, + { + "end_line": 3108, + "section": "Paragraphs", + "html": "

    aaa\nbbb

    \n

    ccc\nddd

    \n", + "markdown": "aaa\nbbb\n\nccc\nddd\n", + "example": 183, + "start_line": 3097 + }, + { + "end_line": 3121, + "section": "Paragraphs", + "html": "

    aaa

    \n

    bbb

    \n", + "markdown": "aaa\n\n\nbbb\n", + "example": 184, + "start_line": 3113 + }, + { + "end_line": 3132, + "section": "Paragraphs", + "html": "

    aaa\nbbb

    \n", + "markdown": " aaa\n bbb\n", + "example": 185, + "start_line": 3126 + }, + { + "end_line": 3146, + "section": "Paragraphs", + "html": "

    aaa\nbbb\nccc

    \n", + "markdown": "aaa\n bbb\n ccc\n", + "example": 186, + "start_line": 3138 + }, + { + "end_line": 3158, + "section": "Paragraphs", + "html": "

    aaa\nbbb

    \n", + "markdown": " aaa\nbbb\n", + "example": 187, + "start_line": 3152 + }, + { + "end_line": 3168, + "section": "Paragraphs", + "html": "
    aaa\n
    \n

    bbb

    \n", + "markdown": " aaa\nbbb\n", + "example": 188, + "start_line": 3161 + }, + { + "end_line": 3181, + "section": "Paragraphs", + "html": "

    aaa
    \nbbb

    \n", + "markdown": "aaa \nbbb \n", + "example": 189, + "start_line": 3175 + }, + { + "end_line": 3204, + "section": "Blank lines", + "html": "

    aaa

    \n

    aaa

    \n", + "markdown": " \n\naaa\n \n\n# aaa\n\n \n", + "example": 190, + "start_line": 3192 + }, + { + "end_line": 3268, + "section": "Block quotes", + "html": "
    \n

    Foo

    \n

    bar\nbaz

    \n
    \n", + "markdown": "> # Foo\n> bar\n> baz\n", + "example": 191, + "start_line": 3258 + }, + { + "end_line": 3283, + "section": "Block quotes", + "html": "
    \n

    Foo

    \n

    bar\nbaz

    \n
    \n", + "markdown": "># Foo\n>bar\n> baz\n", + "example": 192, + "start_line": 3273 + }, + { + "end_line": 3298, + "section": "Block quotes", + "html": "
    \n

    Foo

    \n

    bar\nbaz

    \n
    \n", + "markdown": " > # Foo\n > bar\n > baz\n", + "example": 193, + "start_line": 3288 + }, + { + "end_line": 3312, + "section": "Block quotes", + "html": "
    > # Foo\n> bar\n> baz\n
    \n", + "markdown": " > # Foo\n > bar\n > baz\n", + "example": 194, + "start_line": 3303 + }, + { + "end_line": 3328, + "section": "Block quotes", + "html": "
    \n

    Foo

    \n

    bar\nbaz

    \n
    \n", + "markdown": "> # Foo\n> bar\nbaz\n", + "example": 195, + "start_line": 3318 + }, + { + "end_line": 3344, + "section": "Block quotes", + "html": "
    \n

    bar\nbaz\nfoo

    \n
    \n", + "markdown": "> bar\nbaz\n> foo\n", + "example": 196, + "start_line": 3334 + }, + { + "end_line": 3366, + "section": "Block quotes", + "html": "
    \n

    foo

    \n
    \n
    \n", + "markdown": "> foo\n---\n", + "example": 197, + "start_line": 3358 + }, + { + "end_line": 3390, + "section": "Block quotes", + "html": "
    \n
      \n
    • foo
    • \n
    \n
    \n
      \n
    • bar
    • \n
    \n", + "markdown": "> - foo\n- bar\n", + "example": 198, + "start_line": 3378 + }, + { + "end_line": 3406, + "section": "Block quotes", + "html": "
    \n
    foo\n
    \n
    \n
    bar\n
    \n", + "markdown": "> foo\n bar\n", + "example": 199, + "start_line": 3396 + }, + { + "end_line": 3419, + "section": "Block quotes", + "html": "
    \n
    \n
    \n

    foo

    \n
    \n", + "markdown": "> ```\nfoo\n```\n", + "example": 200, + "start_line": 3409 + }, + { + "end_line": 3433, + "section": "Block quotes", + "html": "
    \n

    foo\n- bar

    \n
    \n", + "markdown": "> foo\n - bar\n", + "example": 201, + "start_line": 3425 + }, + { + "end_line": 3454, + "section": "Block quotes", + "html": "
    \n
    \n", + "markdown": ">\n", + "example": 202, + "start_line": 3449 + }, + { + "end_line": 3464, + "section": "Block quotes", + "html": "
    \n
    \n", + "markdown": ">\n> \n> \n", + "example": 203, + "start_line": 3457 + }, + { + "end_line": 3477, + "section": "Block quotes", + "html": "
    \n

    foo

    \n
    \n", + "markdown": ">\n> foo\n> \n", + "example": 204, + "start_line": 3469 + }, + { + "end_line": 3493, + "section": "Block quotes", + "html": "
    \n

    foo

    \n
    \n
    \n

    bar

    \n
    \n", + "markdown": "> foo\n\n> bar\n", + "example": 205, + "start_line": 3482 + }, + { + "end_line": 3512, + "section": "Block quotes", + "html": "
    \n

    foo\nbar

    \n
    \n", + "markdown": "> foo\n> bar\n", + "example": 206, + "start_line": 3504 + }, + { + "end_line": 3526, + "section": "Block quotes", + "html": "
    \n

    foo

    \n

    bar

    \n
    \n", + "markdown": "> foo\n>\n> bar\n", + "example": 207, + "start_line": 3517 + }, + { + "end_line": 3539, + "section": "Block quotes", + "html": "

    foo

    \n
    \n

    bar

    \n
    \n", + "markdown": "foo\n> bar\n", + "example": 208, + "start_line": 3531 + }, + { + "end_line": 3557, + "section": "Block quotes", + "html": "
    \n

    aaa

    \n
    \n
    \n
    \n

    bbb

    \n
    \n", + "markdown": "> aaa\n***\n> bbb\n", + "example": 209, + "start_line": 3545 + }, + { + "end_line": 3571, + "section": "Block quotes", + "html": "
    \n

    bar\nbaz

    \n
    \n", + "markdown": "> bar\nbaz\n", + "example": 210, + "start_line": 3563 + }, + { + "end_line": 3583, + "section": "Block quotes", + "html": "
    \n

    bar

    \n
    \n

    baz

    \n", + "markdown": "> bar\n\nbaz\n", + "example": 211, + "start_line": 3574 + }, + { + "end_line": 3595, + "section": "Block quotes", + "html": "
    \n

    bar

    \n
    \n

    baz

    \n", + "markdown": "> bar\n>\nbaz\n", + "example": 212, + "start_line": 3586 + }, + { + "end_line": 3614, + "section": "Block quotes", + "html": "
    \n
    \n
    \n

    foo\nbar

    \n
    \n
    \n
    \n", + "markdown": "> > > foo\nbar\n", + "example": 213, + "start_line": 3602 + }, + { + "end_line": 3631, + "section": "Block quotes", + "html": "
    \n
    \n
    \n

    foo\nbar\nbaz

    \n
    \n
    \n
    \n", + "markdown": ">>> foo\n> bar\n>>baz\n", + "example": 214, + "start_line": 3617 + }, + { + "end_line": 3651, + "section": "Block quotes", + "html": "
    \n
    code\n
    \n
    \n
    \n

    not code

    \n
    \n", + "markdown": "> code\n\n> not code\n", + "example": 215, + "start_line": 3639 + }, + { + "end_line": 3709, + "section": "List items", + "html": "

    A paragraph\nwith two lines.

    \n
    indented code\n
    \n
    \n

    A block quote.

    \n
    \n", + "markdown": "A paragraph\nwith two lines.\n\n indented code\n\n> A block quote.\n", + "example": 216, + "start_line": 3694 + }, + { + "end_line": 3735, + "section": "List items", + "html": "
      \n
    1. \n

      A paragraph\nwith two lines.

      \n
      indented code\n
      \n
      \n

      A block quote.

      \n
      \n
    2. \n
    \n", + "markdown": "1. A paragraph\n with two lines.\n\n indented code\n\n > A block quote.\n", + "example": 217, + "start_line": 3716 + }, + { + "end_line": 3758, + "section": "List items", + "html": "
      \n
    • one
    • \n
    \n

    two

    \n", + "markdown": "- one\n\n two\n", + "example": 218, + "start_line": 3749 + }, + { + "end_line": 3772, + "section": "List items", + "html": "
      \n
    • \n

      one

      \n

      two

      \n
    • \n
    \n", + "markdown": "- one\n\n two\n", + "example": 219, + "start_line": 3761 + }, + { + "end_line": 3785, + "section": "List items", + "html": "
      \n
    • one
    • \n
    \n
     two\n
    \n", + "markdown": " - one\n\n two\n", + "example": 220, + "start_line": 3775 + }, + { + "end_line": 3799, + "section": "List items", + "html": "
      \n
    • \n

      one

      \n

      two

      \n
    • \n
    \n", + "markdown": " - one\n\n two\n", + "example": 221, + "start_line": 3788 + }, + { + "end_line": 3825, + "section": "List items", + "html": "
    \n
    \n
      \n
    1. \n

      one

      \n

      two

      \n
    2. \n
    \n
    \n
    \n", + "markdown": " > > 1. one\n>>\n>> two\n", + "example": 222, + "start_line": 3810 + }, + { + "end_line": 3850, + "section": "List items", + "html": "
    \n
    \n
      \n
    • one
    • \n
    \n

    two

    \n
    \n
    \n", + "markdown": ">>- one\n>>\n > > two\n", + "example": 223, + "start_line": 3837 + }, + { + "end_line": 3863, + "section": "List items", + "html": "

    -one

    \n

    2.two

    \n", + "markdown": "-one\n\n2.two\n", + "example": 224, + "start_line": 3856 + }, + { + "end_line": 3881, + "section": "List items", + "html": "
      \n
    • \n

      foo

      \n

      bar

      \n
    • \n
    \n", + "markdown": "- foo\n\n\n bar\n", + "example": 225, + "start_line": 3869 + }, + { + "end_line": 3908, + "section": "List items", + "html": "
      \n
    1. \n

      foo

      \n
      bar\n
      \n

      baz

      \n
      \n

      bam

      \n
      \n
    2. \n
    \n", + "markdown": "1. foo\n\n ```\n bar\n ```\n\n baz\n\n > bam\n", + "example": 226, + "start_line": 3886 + }, + { + "end_line": 3932, + "section": "List items", + "html": "
      \n
    • \n

      Foo

      \n
      bar\n\n\nbaz\n
      \n
    • \n
    \n", + "markdown": "- Foo\n\n bar\n\n\n baz\n", + "example": 227, + "start_line": 3914 + }, + { + "end_line": 3942, + "section": "List items", + "html": "
      \n
    1. ok
    2. \n
    \n", + "markdown": "123456789. ok\n", + "example": 228, + "start_line": 3936 + }, + { + "end_line": 3949, + "section": "List items", + "html": "

    1234567890. not ok

    \n", + "markdown": "1234567890. not ok\n", + "example": 229, + "start_line": 3945 + }, + { + "end_line": 3960, + "section": "List items", + "html": "
      \n
    1. ok
    2. \n
    \n", + "markdown": "0. ok\n", + "example": 230, + "start_line": 3954 + }, + { + "end_line": 3969, + "section": "List items", + "html": "
      \n
    1. ok
    2. \n
    \n", + "markdown": "003. ok\n", + "example": 231, + "start_line": 3963 + }, + { + "end_line": 3978, + "section": "List items", + "html": "

    -1. not ok

    \n", + "markdown": "-1. not ok\n", + "example": 232, + "start_line": 3974 + }, + { + "end_line": 4010, + "section": "List items", + "html": "
      \n
    • \n

      foo

      \n
      bar\n
      \n
    • \n
    \n", + "markdown": "- foo\n\n bar\n", + "example": 233, + "start_line": 3998 + }, + { + "end_line": 4027, + "section": "List items", + "html": "
      \n
    1. \n

      foo

      \n
      bar\n
      \n
    2. \n
    \n", + "markdown": " 10. foo\n\n bar\n", + "example": 234, + "start_line": 4015 + }, + { + "end_line": 4046, + "section": "List items", + "html": "
    indented code\n
    \n

    paragraph

    \n
    more code\n
    \n", + "markdown": " indented code\n\nparagraph\n\n more code\n", + "example": 235, + "start_line": 4034 + }, + { + "end_line": 4065, + "section": "List items", + "html": "
      \n
    1. \n
      indented code\n
      \n

      paragraph

      \n
      more code\n
      \n
    2. \n
    \n", + "markdown": "1. indented code\n\n paragraph\n\n more code\n", + "example": 236, + "start_line": 4049 + }, + { + "end_line": 4087, + "section": "List items", + "html": "
      \n
    1. \n
       indented code\n
      \n

      paragraph

      \n
      more code\n
      \n
    2. \n
    \n", + "markdown": "1. indented code\n\n paragraph\n\n more code\n", + "example": 237, + "start_line": 4071 + }, + { + "end_line": 4105, + "section": "List items", + "html": "

    foo

    \n

    bar

    \n", + "markdown": " foo\n\nbar\n", + "example": 238, + "start_line": 4098 + }, + { + "end_line": 4117, + "section": "List items", + "html": "
      \n
    • foo
    • \n
    \n

    bar

    \n", + "markdown": "- foo\n\n bar\n", + "example": 239, + "start_line": 4108 + }, + { + "end_line": 4136, + "section": "List items", + "html": "
      \n
    • \n

      foo

      \n

      bar

      \n
    • \n
    \n", + "markdown": "- foo\n\n bar\n", + "example": 240, + "start_line": 4125 + }, + { + "end_line": 4174, + "section": "List items", + "html": "
      \n
    • foo
    • \n
    • \n
      bar\n
      \n
    • \n
    • \n
      baz\n
      \n
    • \n
    \n", + "markdown": "-\n foo\n-\n ```\n bar\n ```\n-\n baz\n", + "example": 241, + "start_line": 4153 + }, + { + "end_line": 4186, + "section": "List items", + "html": "
      \n
    • foo
    • \n
    \n", + "markdown": "- \n foo\n", + "example": 242, + "start_line": 4179 + }, + { + "end_line": 4202, + "section": "List items", + "html": "
      \n
    • \n
    \n

    foo

    \n", + "markdown": "-\n\n foo\n", + "example": 243, + "start_line": 4193 + }, + { + "end_line": 4217, + "section": "List items", + "html": "
      \n
    • foo
    • \n
    • \n
    • bar
    • \n
    \n", + "markdown": "- foo\n-\n- bar\n", + "example": 244, + "start_line": 4207 + }, + { + "end_line": 4232, + "section": "List items", + "html": "
      \n
    • foo
    • \n
    • \n
    • bar
    • \n
    \n", + "markdown": "- foo\n- \n- bar\n", + "example": 245, + "start_line": 4222 + }, + { + "end_line": 4247, + "section": "List items", + "html": "
      \n
    1. foo
    2. \n
    3. \n
    4. bar
    5. \n
    \n", + "markdown": "1. foo\n2.\n3. bar\n", + "example": 246, + "start_line": 4237 + }, + { + "end_line": 4258, + "section": "List items", + "html": "
      \n
    • \n
    \n", + "markdown": "*\n", + "example": 247, + "start_line": 4252 + }, + { + "end_line": 4273, + "section": "List items", + "html": "

    foo\n*

    \n

    foo\n1.

    \n", + "markdown": "foo\n*\n\nfoo\n1.\n", + "example": 248, + "start_line": 4262 + }, + { + "end_line": 4303, + "section": "List items", + "html": "
      \n
    1. \n

      A paragraph\nwith two lines.

      \n
      indented code\n
      \n
      \n

      A block quote.

      \n
      \n
    2. \n
    \n", + "markdown": " 1. A paragraph\n with two lines.\n\n indented code\n\n > A block quote.\n", + "example": 249, + "start_line": 4284 + }, + { + "end_line": 4327, + "section": "List items", + "html": "
      \n
    1. \n

      A paragraph\nwith two lines.

      \n
      indented code\n
      \n
      \n

      A block quote.

      \n
      \n
    2. \n
    \n", + "markdown": " 1. A paragraph\n with two lines.\n\n indented code\n\n > A block quote.\n", + "example": 250, + "start_line": 4308 + }, + { + "end_line": 4351, + "section": "List items", + "html": "
      \n
    1. \n

      A paragraph\nwith two lines.

      \n
      indented code\n
      \n
      \n

      A block quote.

      \n
      \n
    2. \n
    \n", + "markdown": " 1. A paragraph\n with two lines.\n\n indented code\n\n > A block quote.\n", + "example": 251, + "start_line": 4332 + }, + { + "end_line": 4371, + "section": "List items", + "html": "
    1.  A paragraph\n    with two lines.\n\n        indented code\n\n    > A block quote.\n
    \n", + "markdown": " 1. A paragraph\n with two lines.\n\n indented code\n\n > A block quote.\n", + "example": 252, + "start_line": 4356 + }, + { + "end_line": 4405, + "section": "List items", + "html": "
      \n
    1. \n

      A paragraph\nwith two lines.

      \n
      indented code\n
      \n
      \n

      A block quote.

      \n
      \n
    2. \n
    \n", + "markdown": " 1. A paragraph\nwith two lines.\n\n indented code\n\n > A block quote.\n", + "example": 253, + "start_line": 4386 + }, + { + "end_line": 4418, + "section": "List items", + "html": "
      \n
    1. A paragraph\nwith two lines.
    2. \n
    \n", + "markdown": " 1. A paragraph\n with two lines.\n", + "example": 254, + "start_line": 4410 + }, + { + "end_line": 4437, + "section": "List items", + "html": "
    \n
      \n
    1. \n
      \n

      Blockquote\ncontinued here.

      \n
      \n
    2. \n
    \n
    \n", + "markdown": "> 1. > Blockquote\ncontinued here.\n", + "example": 255, + "start_line": 4423 + }, + { + "end_line": 4454, + "section": "List items", + "html": "
    \n
      \n
    1. \n
      \n

      Blockquote\ncontinued here.

      \n
      \n
    2. \n
    \n
    \n", + "markdown": "> 1. > Blockquote\n> continued here.\n", + "example": 256, + "start_line": 4440 + }, + { + "end_line": 4488, + "section": "List items", + "html": "
      \n
    • foo\n
        \n
      • bar\n
          \n
        • baz\n
            \n
          • boo
          • \n
          \n
        • \n
        \n
      • \n
      \n
    • \n
    \n", + "markdown": "- foo\n - bar\n - baz\n - boo\n", + "example": 257, + "start_line": 4467 + }, + { + "end_line": 4505, + "section": "List items", + "html": "
      \n
    • foo
    • \n
    • bar
    • \n
    • baz
    • \n
    • boo
    • \n
    \n", + "markdown": "- foo\n - bar\n - baz\n - boo\n", + "example": 258, + "start_line": 4493 + }, + { + "end_line": 4521, + "section": "List items", + "html": "
      \n
    1. foo\n
        \n
      • bar
      • \n
      \n
    2. \n
    \n", + "markdown": "10) foo\n - bar\n", + "example": 259, + "start_line": 4510 + }, + { + "end_line": 4536, + "section": "List items", + "html": "
      \n
    1. foo
    2. \n
    \n
      \n
    • bar
    • \n
    \n", + "markdown": "10) foo\n - bar\n", + "example": 260, + "start_line": 4526 + }, + { + "end_line": 4551, + "section": "List items", + "html": "
      \n
    • \n
        \n
      • foo
      • \n
      \n
    • \n
    \n", + "markdown": "- - foo\n", + "example": 261, + "start_line": 4541 + }, + { + "end_line": 4568, + "section": "List items", + "html": "
      \n
    1. \n
        \n
      • \n
          \n
        1. foo
        2. \n
        \n
      • \n
      \n
    2. \n
    \n", + "markdown": "1. - 2. foo\n", + "example": 262, + "start_line": 4554 + }, + { + "end_line": 4587, + "section": "List items", + "html": "
      \n
    • \n

      Foo

      \n
    • \n
    • \n

      Bar

      \nbaz
    • \n
    \n", + "markdown": "- # Foo\n- Bar\n ---\n baz\n", + "example": 263, + "start_line": 4573 + }, + { + "end_line": 4821, + "section": "Lists", + "html": "
      \n
    • foo
    • \n
    • bar
    • \n
    \n
      \n
    • baz
    • \n
    \n", + "markdown": "- foo\n- bar\n+ baz\n", + "example": 264, + "start_line": 4809 + }, + { + "end_line": 4836, + "section": "Lists", + "html": "
      \n
    1. foo
    2. \n
    3. bar
    4. \n
    \n
      \n
    1. baz
    2. \n
    \n", + "markdown": "1. foo\n2. bar\n3) baz\n", + "example": 265, + "start_line": 4824 + }, + { + "end_line": 4853, + "section": "Lists", + "html": "

    Foo

    \n
      \n
    • bar
    • \n
    • baz
    • \n
    \n", + "markdown": "Foo\n- bar\n- baz\n", + "example": 266, + "start_line": 4843 + }, + { + "end_line": 4926, + "section": "Lists", + "html": "

    The number of windows in my house is\n14. The number of doors is 6.

    \n", + "markdown": "The number of windows in my house is\n14. The number of doors is 6.\n", + "example": 267, + "start_line": 4920 + }, + { + "end_line": 4938, + "section": "Lists", + "html": "

    The number of windows in my house is

    \n
      \n
    1. The number of doors is 6.
    2. \n
    \n", + "markdown": "The number of windows in my house is\n1. The number of doors is 6.\n", + "example": 268, + "start_line": 4930 + }, + { + "end_line": 4963, + "section": "Lists", + "html": "
      \n
    • \n

      foo

      \n
    • \n
    • \n

      bar

      \n
    • \n
    • \n

      baz

      \n
    • \n
    \n", + "markdown": "- foo\n\n- bar\n\n\n- baz\n", + "example": 269, + "start_line": 4944 + }, + { + "end_line": 4987, + "section": "Lists", + "html": "
      \n
    • foo\n
        \n
      • bar\n
          \n
        • \n

          baz

          \n

          bim

          \n
        • \n
        \n
      • \n
      \n
    • \n
    \n", + "markdown": "- foo\n - bar\n - baz\n\n\n bim\n", + "example": 270, + "start_line": 4965 + }, + { + "end_line": 5013, + "section": "Lists", + "html": "
      \n
    • foo
    • \n
    • bar
    • \n
    \n\n
      \n
    • baz
    • \n
    • bim
    • \n
    \n", + "markdown": "- foo\n- bar\n\n\n\n- baz\n- bim\n", + "example": 271, + "start_line": 4995 + }, + { + "end_line": 5039, + "section": "Lists", + "html": "
      \n
    • \n

      foo

      \n

      notcode

      \n
    • \n
    • \n

      foo

      \n
    • \n
    \n\n
    code\n
    \n", + "markdown": "- foo\n\n notcode\n\n- foo\n\n\n\n code\n", + "example": 272, + "start_line": 5016 + }, + { + "end_line": 5069, + "section": "Lists", + "html": "
      \n
    • a
    • \n
    • b
    • \n
    • c
    • \n
    • d
    • \n
    • e
    • \n
    • f
    • \n
    • g
    • \n
    • h
    • \n
    • i
    • \n
    \n", + "markdown": "- a\n - b\n - c\n - d\n - e\n - f\n - g\n - h\n- i\n", + "example": 273, + "start_line": 5047 + }, + { + "end_line": 5090, + "section": "Lists", + "html": "
      \n
    1. \n

      a

      \n
    2. \n
    3. \n

      b

      \n
    4. \n
    5. \n

      c

      \n
    6. \n
    \n", + "markdown": "1. a\n\n 2. b\n\n 3. c\n", + "example": 274, + "start_line": 5072 + }, + { + "end_line": 5113, + "section": "Lists", + "html": "
      \n
    • \n

      a

      \n
    • \n
    • \n

      b

      \n
    • \n
    • \n

      c

      \n
    • \n
    \n", + "markdown": "- a\n- b\n\n- c\n", + "example": 275, + "start_line": 5096 + }, + { + "end_line": 5133, + "section": "Lists", + "html": "
      \n
    • \n

      a

      \n
    • \n
    • \n
    • \n

      c

      \n
    • \n
    \n", + "markdown": "* a\n*\n\n* c\n", + "example": 276, + "start_line": 5118 + }, + { + "end_line": 5159, + "section": "Lists", + "html": "
      \n
    • \n

      a

      \n
    • \n
    • \n

      b

      \n

      c

      \n
    • \n
    • \n

      d

      \n
    • \n
    \n", + "markdown": "- a\n- b\n\n c\n- d\n", + "example": 277, + "start_line": 5140 + }, + { + "end_line": 5180, + "section": "Lists", + "html": "
      \n
    • \n

      a

      \n
    • \n
    • \n

      b

      \n
    • \n
    • \n

      d

      \n
    • \n
    \n", + "markdown": "- a\n- b\n\n [ref]: /url\n- d\n", + "example": 278, + "start_line": 5162 + }, + { + "end_line": 5204, + "section": "Lists", + "html": "
      \n
    • a
    • \n
    • \n
      b\n\n\n
      \n
    • \n
    • c
    • \n
    \n", + "markdown": "- a\n- ```\n b\n\n\n ```\n- c\n", + "example": 279, + "start_line": 5185 + }, + { + "end_line": 5229, + "section": "Lists", + "html": "
      \n
    • a\n
        \n
      • \n

        b

        \n

        c

        \n
      • \n
      \n
    • \n
    • d
    • \n
    \n", + "markdown": "- a\n - b\n\n c\n- d\n", + "example": 280, + "start_line": 5211 + }, + { + "end_line": 5249, + "section": "Lists", + "html": "
      \n
    • a\n
      \n

      b

      \n
      \n
    • \n
    • c
    • \n
    \n", + "markdown": "* a\n > b\n >\n* c\n", + "example": 281, + "start_line": 5235 + }, + { + "end_line": 5273, + "section": "Lists", + "html": "
      \n
    • a\n
      \n

      b

      \n
      \n
      c\n
      \n
    • \n
    • d
    • \n
    \n", + "markdown": "- a\n > b\n ```\n c\n ```\n- d\n", + "example": 282, + "start_line": 5255 + }, + { + "end_line": 5284, + "section": "Lists", + "html": "
      \n
    • a
    • \n
    \n", + "markdown": "- a\n", + "example": 283, + "start_line": 5278 + }, + { + "end_line": 5298, + "section": "Lists", + "html": "
      \n
    • a\n
        \n
      • b
      • \n
      \n
    • \n
    \n", + "markdown": "- a\n - b\n", + "example": 284, + "start_line": 5287 + }, + { + "end_line": 5318, + "section": "Lists", + "html": "
      \n
    1. \n
      foo\n
      \n

      bar

      \n
    2. \n
    \n", + "markdown": "1. ```\n foo\n ```\n\n bar\n", + "example": 285, + "start_line": 5304 + }, + { + "end_line": 5338, + "section": "Lists", + "html": "
      \n
    • \n

      foo

      \n
        \n
      • bar
      • \n
      \n

      baz

      \n
    • \n
    \n", + "markdown": "* foo\n * bar\n\n baz\n", + "example": 286, + "start_line": 5323 + }, + { + "end_line": 5366, + "section": "Lists", + "html": "
      \n
    • \n

      a

      \n
        \n
      • b
      • \n
      • c
      • \n
      \n
    • \n
    • \n

      d

      \n
        \n
      • e
      • \n
      • f
      • \n
      \n
    • \n
    \n", + "markdown": "- a\n - b\n - c\n\n- d\n - e\n - f\n", + "example": 287, + "start_line": 5341 + }, + { + "end_line": 5379, + "section": "Inlines", + "html": "

    hilo`

    \n", + "markdown": "`hi`lo`\n", + "example": 288, + "start_line": 5375 + }, + { + "end_line": 5393, + "section": "Backslash escapes", + "html": "

    !"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~

    \n", + "markdown": "\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\-\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\\\\\]\\^\\_\\`\\{\\|\\}\\~\n", + "example": 289, + "start_line": 5389 + }, + { + "end_line": 5403, + "section": "Backslash escapes", + "html": "

    \\\t\\A\\a\\ \\3\\φ\\«

    \n", + "markdown": "\\\t\\A\\a\\ \\3\\φ\\«\n", + "example": 290, + "start_line": 5399 + }, + { + "end_line": 5427, + "section": "Backslash escapes", + "html": "

    *not emphasized*\n<br/> not a tag\n[not a link](/foo)\n`not code`\n1. not a list\n* not a list\n# not a heading\n[foo]: /url "not a reference"

    \n", + "markdown": "\\*not emphasized*\n\\
    not a tag\n\\[not a link](/foo)\n\\`not code`\n1\\. not a list\n\\* not a list\n\\# not a heading\n\\[foo]: /url \"not a reference\"\n", + "example": 291, + "start_line": 5409 + }, + { + "end_line": 5436, + "section": "Backslash escapes", + "html": "

    \\emphasis

    \n", + "markdown": "\\\\*emphasis*\n", + "example": 292, + "start_line": 5432 + }, + { + "end_line": 5447, + "section": "Backslash escapes", + "html": "

    foo
    \nbar

    \n", + "markdown": "foo\\\nbar\n", + "example": 293, + "start_line": 5441 + }, + { + "end_line": 5457, + "section": "Backslash escapes", + "html": "

    \\[\\`

    \n", + "markdown": "`` \\[\\` ``\n", + "example": 294, + "start_line": 5453 + }, + { + "end_line": 5465, + "section": "Backslash escapes", + "html": "
    \\[\\]\n
    \n", + "markdown": " \\[\\]\n", + "example": 295, + "start_line": 5460 + }, + { + "end_line": 5475, + "section": "Backslash escapes", + "html": "
    \\[\\]\n
    \n", + "markdown": "~~~\n\\[\\]\n~~~\n", + "example": 296, + "start_line": 5468 + }, + { + "end_line": 5482, + "section": "Backslash escapes", + "html": "

    http://example.com?find=\\*

    \n", + "markdown": "\n", + "example": 297, + "start_line": 5478 + }, + { + "end_line": 5489, + "section": "Backslash escapes", + "html": "\n", + "markdown": "\n", + "example": 298, + "start_line": 5485 + }, + { + "end_line": 5499, + "section": "Backslash escapes", + "html": "

    foo

    \n", + "markdown": "[foo](/bar\\* \"ti\\*tle\")\n", + "example": 299, + "start_line": 5495 + }, + { + "end_line": 5508, + "section": "Backslash escapes", + "html": "

    foo

    \n", + "markdown": "[foo]\n\n[foo]: /bar\\* \"ti\\*tle\"\n", + "example": 300, + "start_line": 5502 + }, + { + "end_line": 5518, + "section": "Backslash escapes", + "html": "
    foo\n
    \n", + "markdown": "``` foo\\+bar\nfoo\n```\n", + "example": 301, + "start_line": 5511 + }, + { + "end_line": 5546, + "section": "Entity and numeric character references", + "html": "

    & © Æ Ď\n¾ ℋ ⅆ\n∲ ≧̸

    \n", + "markdown": "  & © Æ Ď\n¾ ℋ ⅆ\n∲ ≧̸\n", + "example": 302, + "start_line": 5538 + }, + { + "end_line": 5561, + "section": "Entity and numeric character references", + "html": "

    # Ӓ Ϡ � �

    \n", + "markdown": "# Ӓ Ϡ � �\n", + "example": 303, + "start_line": 5557 + }, + { + "end_line": 5574, + "section": "Entity and numeric character references", + "html": "

    " ആ ಫ

    \n", + "markdown": "" ആ ಫ\n", + "example": 304, + "start_line": 5570 + }, + { + "end_line": 5585, + "section": "Entity and numeric character references", + "html": "

    &nbsp &x; &#; &#x;\n&ThisIsNotDefined; &hi?;

    \n", + "markdown": "  &x; &#; &#x;\n&ThisIsNotDefined; &hi?;\n", + "example": 305, + "start_line": 5579 + }, + { + "end_line": 5596, + "section": "Entity and numeric character references", + "html": "

    &copy

    \n", + "markdown": "©\n", + "example": 306, + "start_line": 5592 + }, + { + "end_line": 5606, + "section": "Entity and numeric character references", + "html": "

    &MadeUpEntity;

    \n", + "markdown": "&MadeUpEntity;\n", + "example": 307, + "start_line": 5602 + }, + { + "end_line": 5617, + "section": "Entity and numeric character references", + "html": "\n", + "markdown": "\n", + "example": 308, + "start_line": 5613 + }, + { + "end_line": 5624, + "section": "Entity and numeric character references", + "html": "

    foo

    \n", + "markdown": "[foo](/föö \"föö\")\n", + "example": 309, + "start_line": 5620 + }, + { + "end_line": 5633, + "section": "Entity and numeric character references", + "html": "

    foo

    \n", + "markdown": "[foo]\n\n[foo]: /föö \"föö\"\n", + "example": 310, + "start_line": 5627 + }, + { + "end_line": 5643, + "section": "Entity and numeric character references", + "html": "
    foo\n
    \n", + "markdown": "``` föö\nfoo\n```\n", + "example": 311, + "start_line": 5636 + }, + { + "end_line": 5653, + "section": "Entity and numeric character references", + "html": "

    f&ouml;&ouml;

    \n", + "markdown": "`föö`\n", + "example": 312, + "start_line": 5649 + }, + { + "end_line": 5661, + "section": "Entity and numeric character references", + "html": "
    f&ouml;f&ouml;\n
    \n", + "markdown": " föfö\n", + "example": 313, + "start_line": 5656 + }, + { + "end_line": 5682, + "section": "Code spans", + "html": "

    foo

    \n", + "markdown": "`foo`\n", + "example": 314, + "start_line": 5678 + }, + { + "end_line": 5692, + "section": "Code spans", + "html": "

    foo ` bar

    \n", + "markdown": "`` foo ` bar ``\n", + "example": 315, + "start_line": 5688 + }, + { + "end_line": 5702, + "section": "Code spans", + "html": "

    ``

    \n", + "markdown": "` `` `\n", + "example": 316, + "start_line": 5698 + }, + { + "end_line": 5713, + "section": "Code spans", + "html": "

    foo

    \n", + "markdown": "``\nfoo\n``\n", + "example": 317, + "start_line": 5707 + }, + { + "end_line": 5724, + "section": "Code spans", + "html": "

    foo bar baz

    \n", + "markdown": "`foo bar\n baz`\n", + "example": 318, + "start_line": 5719 + }, + { + "end_line": 5734, + "section": "Code spans", + "html": "

    a b

    \n", + "markdown": "`a b`\n", + "example": 319, + "start_line": 5730 + }, + { + "end_line": 5754, + "section": "Code spans", + "html": "

    foo `` bar

    \n", + "markdown": "`foo `` bar`\n", + "example": 320, + "start_line": 5750 + }, + { + "end_line": 5764, + "section": "Code spans", + "html": "

    foo\\bar`

    \n", + "markdown": "`foo\\`bar`\n", + "example": 321, + "start_line": 5760 + }, + { + "end_line": 5780, + "section": "Code spans", + "html": "

    *foo*

    \n", + "markdown": "*foo`*`\n", + "example": 322, + "start_line": 5776 + }, + { + "end_line": 5789, + "section": "Code spans", + "html": "

    [not a link](/foo)

    \n", + "markdown": "[not a `link](/foo`)\n", + "example": 323, + "start_line": 5785 + }, + { + "end_line": 5799, + "section": "Code spans", + "html": "

    <a href="">`

    \n", + "markdown": "``\n", + "example": 324, + "start_line": 5795 + }, + { + "end_line": 5808, + "section": "Code spans", + "html": "

    `

    \n", + "markdown": "`\n", + "example": 325, + "start_line": 5804 + }, + { + "end_line": 5817, + "section": "Code spans", + "html": "

    <http://foo.bar.baz>`

    \n", + "markdown": "``\n", + "example": 326, + "start_line": 5813 + }, + { + "end_line": 5826, + "section": "Code spans", + "html": "

    http://foo.bar.`baz`

    \n", + "markdown": "`\n", + "example": 327, + "start_line": 5822 + }, + { + "end_line": 5836, + "section": "Code spans", + "html": "

    ```foo``

    \n", + "markdown": "```foo``\n", + "example": 328, + "start_line": 5832 + }, + { + "end_line": 5843, + "section": "Code spans", + "html": "

    `foo

    \n", + "markdown": "`foo\n", + "example": 329, + "start_line": 5839 + }, + { + "end_line": 5852, + "section": "Code spans", + "html": "

    `foobar

    \n", + "markdown": "`foo``bar``\n", + "example": 330, + "start_line": 5848 + }, + { + "end_line": 6065, + "section": "Emphasis and strong emphasis", + "html": "

    foo bar

    \n", + "markdown": "*foo bar*\n", + "example": 331, + "start_line": 6061 + }, + { + "end_line": 6075, + "section": "Emphasis and strong emphasis", + "html": "

    a * foo bar*

    \n", + "markdown": "a * foo bar*\n", + "example": 332, + "start_line": 6071 + }, + { + "end_line": 6086, + "section": "Emphasis and strong emphasis", + "html": "

    a*"foo"*

    \n", + "markdown": "a*\"foo\"*\n", + "example": 333, + "start_line": 6082 + }, + { + "end_line": 6095, + "section": "Emphasis and strong emphasis", + "html": "

    * a *

    \n", + "markdown": "* a *\n", + "example": 334, + "start_line": 6091 + }, + { + "end_line": 6104, + "section": "Emphasis and strong emphasis", + "html": "

    foobar

    \n", + "markdown": "foo*bar*\n", + "example": 335, + "start_line": 6100 + }, + { + "end_line": 6111, + "section": "Emphasis and strong emphasis", + "html": "

    5678

    \n", + "markdown": "5*6*78\n", + "example": 336, + "start_line": 6107 + }, + { + "end_line": 6120, + "section": "Emphasis and strong emphasis", + "html": "

    foo bar

    \n", + "markdown": "_foo bar_\n", + "example": 337, + "start_line": 6116 + }, + { + "end_line": 6130, + "section": "Emphasis and strong emphasis", + "html": "

    _ foo bar_

    \n", + "markdown": "_ foo bar_\n", + "example": 338, + "start_line": 6126 + }, + { + "end_line": 6140, + "section": "Emphasis and strong emphasis", + "html": "

    a_"foo"_

    \n", + "markdown": "a_\"foo\"_\n", + "example": 339, + "start_line": 6136 + }, + { + "end_line": 6149, + "section": "Emphasis and strong emphasis", + "html": "

    foo_bar_

    \n", + "markdown": "foo_bar_\n", + "example": 340, + "start_line": 6145 + }, + { + "end_line": 6156, + "section": "Emphasis and strong emphasis", + "html": "

    5_6_78

    \n", + "markdown": "5_6_78\n", + "example": 341, + "start_line": 6152 + }, + { + "end_line": 6163, + "section": "Emphasis and strong emphasis", + "html": "

    пристаням_стремятся_

    \n", + "markdown": "пристаням_стремятся_\n", + "example": 342, + "start_line": 6159 + }, + { + "end_line": 6173, + "section": "Emphasis and strong emphasis", + "html": "

    aa_"bb"_cc

    \n", + "markdown": "aa_\"bb\"_cc\n", + "example": 343, + "start_line": 6169 + }, + { + "end_line": 6184, + "section": "Emphasis and strong emphasis", + "html": "

    foo-(bar)

    \n", + "markdown": "foo-_(bar)_\n", + "example": 344, + "start_line": 6180 + }, + { + "end_line": 6196, + "section": "Emphasis and strong emphasis", + "html": "

    _foo*

    \n", + "markdown": "_foo*\n", + "example": 345, + "start_line": 6192 + }, + { + "end_line": 6206, + "section": "Emphasis and strong emphasis", + "html": "

    *foo bar *

    \n", + "markdown": "*foo bar *\n", + "example": 346, + "start_line": 6202 + }, + { + "end_line": 6217, + "section": "Emphasis and strong emphasis", + "html": "

    *foo bar\n*

    \n", + "markdown": "*foo bar\n*\n", + "example": 347, + "start_line": 6211 + }, + { + "end_line": 6228, + "section": "Emphasis and strong emphasis", + "html": "

    *(*foo)

    \n", + "markdown": "*(*foo)\n", + "example": 348, + "start_line": 6224 + }, + { + "end_line": 6238, + "section": "Emphasis and strong emphasis", + "html": "

    (foo)

    \n", + "markdown": "*(*foo*)*\n", + "example": 349, + "start_line": 6234 + }, + { + "end_line": 6247, + "section": "Emphasis and strong emphasis", + "html": "

    foobar

    \n", + "markdown": "*foo*bar\n", + "example": 350, + "start_line": 6243 + }, + { + "end_line": 6260, + "section": "Emphasis and strong emphasis", + "html": "

    _foo bar _

    \n", + "markdown": "_foo bar _\n", + "example": 351, + "start_line": 6256 + }, + { + "end_line": 6270, + "section": "Emphasis and strong emphasis", + "html": "

    _(_foo)

    \n", + "markdown": "_(_foo)\n", + "example": 352, + "start_line": 6266 + }, + { + "end_line": 6279, + "section": "Emphasis and strong emphasis", + "html": "

    (foo)

    \n", + "markdown": "_(_foo_)_\n", + "example": 353, + "start_line": 6275 + }, + { + "end_line": 6288, + "section": "Emphasis and strong emphasis", + "html": "

    _foo_bar

    \n", + "markdown": "_foo_bar\n", + "example": 354, + "start_line": 6284 + }, + { + "end_line": 6295, + "section": "Emphasis and strong emphasis", + "html": "

    _пристаням_стремятся

    \n", + "markdown": "_пристаням_стремятся\n", + "example": 355, + "start_line": 6291 + }, + { + "end_line": 6302, + "section": "Emphasis and strong emphasis", + "html": "

    foo_bar_baz

    \n", + "markdown": "_foo_bar_baz_\n", + "example": 356, + "start_line": 6298 + }, + { + "end_line": 6313, + "section": "Emphasis and strong emphasis", + "html": "

    (bar).

    \n", + "markdown": "_(bar)_.\n", + "example": 357, + "start_line": 6309 + }, + { + "end_line": 6322, + "section": "Emphasis and strong emphasis", + "html": "

    foo bar

    \n", + "markdown": "**foo bar**\n", + "example": 358, + "start_line": 6318 + }, + { + "end_line": 6332, + "section": "Emphasis and strong emphasis", + "html": "

    ** foo bar**

    \n", + "markdown": "** foo bar**\n", + "example": 359, + "start_line": 6328 + }, + { + "end_line": 6343, + "section": "Emphasis and strong emphasis", + "html": "

    a**"foo"**

    \n", + "markdown": "a**\"foo\"**\n", + "example": 360, + "start_line": 6339 + }, + { + "end_line": 6352, + "section": "Emphasis and strong emphasis", + "html": "

    foobar

    \n", + "markdown": "foo**bar**\n", + "example": 361, + "start_line": 6348 + }, + { + "end_line": 6361, + "section": "Emphasis and strong emphasis", + "html": "

    foo bar

    \n", + "markdown": "__foo bar__\n", + "example": 362, + "start_line": 6357 + }, + { + "end_line": 6371, + "section": "Emphasis and strong emphasis", + "html": "

    __ foo bar__

    \n", + "markdown": "__ foo bar__\n", + "example": 363, + "start_line": 6367 + }, + { + "end_line": 6381, + "section": "Emphasis and strong emphasis", + "html": "

    __\nfoo bar__

    \n", + "markdown": "__\nfoo bar__\n", + "example": 364, + "start_line": 6375 + }, + { + "end_line": 6391, + "section": "Emphasis and strong emphasis", + "html": "

    a__"foo"__

    \n", + "markdown": "a__\"foo\"__\n", + "example": 365, + "start_line": 6387 + }, + { + "end_line": 6400, + "section": "Emphasis and strong emphasis", + "html": "

    foo__bar__

    \n", + "markdown": "foo__bar__\n", + "example": 366, + "start_line": 6396 + }, + { + "end_line": 6407, + "section": "Emphasis and strong emphasis", + "html": "

    5__6__78

    \n", + "markdown": "5__6__78\n", + "example": 367, + "start_line": 6403 + }, + { + "end_line": 6414, + "section": "Emphasis and strong emphasis", + "html": "

    пристаням__стремятся__

    \n", + "markdown": "пристаням__стремятся__\n", + "example": 368, + "start_line": 6410 + }, + { + "end_line": 6421, + "section": "Emphasis and strong emphasis", + "html": "

    foo, bar, baz

    \n", + "markdown": "__foo, __bar__, baz__\n", + "example": 369, + "start_line": 6417 + }, + { + "end_line": 6432, + "section": "Emphasis and strong emphasis", + "html": "

    foo-(bar)

    \n", + "markdown": "foo-__(bar)__\n", + "example": 370, + "start_line": 6428 + }, + { + "end_line": 6445, + "section": "Emphasis and strong emphasis", + "html": "

    **foo bar **

    \n", + "markdown": "**foo bar **\n", + "example": 371, + "start_line": 6441 + }, + { + "end_line": 6458, + "section": "Emphasis and strong emphasis", + "html": "

    **(**foo)

    \n", + "markdown": "**(**foo)\n", + "example": 372, + "start_line": 6454 + }, + { + "end_line": 6468, + "section": "Emphasis and strong emphasis", + "html": "

    (foo)

    \n", + "markdown": "*(**foo**)*\n", + "example": 373, + "start_line": 6464 + }, + { + "end_line": 6477, + "section": "Emphasis and strong emphasis", + "html": "

    Gomphocarpus (Gomphocarpus physocarpus, syn.\nAsclepias physocarpa)

    \n", + "markdown": "**Gomphocarpus (*Gomphocarpus physocarpus*, syn.\n*Asclepias physocarpa*)**\n", + "example": 374, + "start_line": 6471 + }, + { + "end_line": 6484, + "section": "Emphasis and strong emphasis", + "html": "

    foo "bar" foo

    \n", + "markdown": "**foo \"*bar*\" foo**\n", + "example": 375, + "start_line": 6480 + }, + { + "end_line": 6493, + "section": "Emphasis and strong emphasis", + "html": "

    foobar

    \n", + "markdown": "**foo**bar\n", + "example": 376, + "start_line": 6489 + }, + { + "end_line": 6505, + "section": "Emphasis and strong emphasis", + "html": "

    __foo bar __

    \n", + "markdown": "__foo bar __\n", + "example": 377, + "start_line": 6501 + }, + { + "end_line": 6515, + "section": "Emphasis and strong emphasis", + "html": "

    __(__foo)

    \n", + "markdown": "__(__foo)\n", + "example": 378, + "start_line": 6511 + }, + { + "end_line": 6525, + "section": "Emphasis and strong emphasis", + "html": "

    (foo)

    \n", + "markdown": "_(__foo__)_\n", + "example": 379, + "start_line": 6521 + }, + { + "end_line": 6534, + "section": "Emphasis and strong emphasis", + "html": "

    __foo__bar

    \n", + "markdown": "__foo__bar\n", + "example": 380, + "start_line": 6530 + }, + { + "end_line": 6541, + "section": "Emphasis and strong emphasis", + "html": "

    __пристаням__стремятся

    \n", + "markdown": "__пристаням__стремятся\n", + "example": 381, + "start_line": 6537 + }, + { + "end_line": 6548, + "section": "Emphasis and strong emphasis", + "html": "

    foo__bar__baz

    \n", + "markdown": "__foo__bar__baz__\n", + "example": 382, + "start_line": 6544 + }, + { + "end_line": 6559, + "section": "Emphasis and strong emphasis", + "html": "

    (bar).

    \n", + "markdown": "__(bar)__.\n", + "example": 383, + "start_line": 6555 + }, + { + "end_line": 6571, + "section": "Emphasis and strong emphasis", + "html": "

    foo bar

    \n", + "markdown": "*foo [bar](/url)*\n", + "example": 384, + "start_line": 6567 + }, + { + "end_line": 6580, + "section": "Emphasis and strong emphasis", + "html": "

    foo\nbar

    \n", + "markdown": "*foo\nbar*\n", + "example": 385, + "start_line": 6574 + }, + { + "end_line": 6590, + "section": "Emphasis and strong emphasis", + "html": "

    foo bar baz

    \n", + "markdown": "_foo __bar__ baz_\n", + "example": 386, + "start_line": 6586 + }, + { + "end_line": 6597, + "section": "Emphasis and strong emphasis", + "html": "

    foo bar baz

    \n", + "markdown": "_foo _bar_ baz_\n", + "example": 387, + "start_line": 6593 + }, + { + "end_line": 6604, + "section": "Emphasis and strong emphasis", + "html": "

    foo bar

    \n", + "markdown": "__foo_ bar_\n", + "example": 388, + "start_line": 6600 + }, + { + "end_line": 6611, + "section": "Emphasis and strong emphasis", + "html": "

    foo bar

    \n", + "markdown": "*foo *bar**\n", + "example": 389, + "start_line": 6607 + }, + { + "end_line": 6618, + "section": "Emphasis and strong emphasis", + "html": "

    foo bar baz

    \n", + "markdown": "*foo **bar** baz*\n", + "example": 390, + "start_line": 6614 + }, + { + "end_line": 6624, + "section": "Emphasis and strong emphasis", + "html": "

    foobarbaz

    \n", + "markdown": "*foo**bar**baz*\n", + "example": 391, + "start_line": 6620 + }, + { + "end_line": 6649, + "section": "Emphasis and strong emphasis", + "html": "

    foo bar

    \n", + "markdown": "***foo** bar*\n", + "example": 392, + "start_line": 6645 + }, + { + "end_line": 6656, + "section": "Emphasis and strong emphasis", + "html": "

    foo bar

    \n", + "markdown": "*foo **bar***\n", + "example": 393, + "start_line": 6652 + }, + { + "end_line": 6663, + "section": "Emphasis and strong emphasis", + "html": "

    foobar

    \n", + "markdown": "*foo**bar***\n", + "example": 394, + "start_line": 6659 + }, + { + "end_line": 6672, + "section": "Emphasis and strong emphasis", + "html": "

    foo bar baz bim bop

    \n", + "markdown": "*foo **bar *baz* bim** bop*\n", + "example": 395, + "start_line": 6668 + }, + { + "end_line": 6679, + "section": "Emphasis and strong emphasis", + "html": "

    foo bar

    \n", + "markdown": "*foo [*bar*](/url)*\n", + "example": 396, + "start_line": 6675 + }, + { + "end_line": 6688, + "section": "Emphasis and strong emphasis", + "html": "

    ** is not an empty emphasis

    \n", + "markdown": "** is not an empty emphasis\n", + "example": 397, + "start_line": 6684 + }, + { + "end_line": 6695, + "section": "Emphasis and strong emphasis", + "html": "

    **** is not an empty strong emphasis

    \n", + "markdown": "**** is not an empty strong emphasis\n", + "example": 398, + "start_line": 6691 + }, + { + "end_line": 6708, + "section": "Emphasis and strong emphasis", + "html": "

    foo bar

    \n", + "markdown": "**foo [bar](/url)**\n", + "example": 399, + "start_line": 6704 + }, + { + "end_line": 6717, + "section": "Emphasis and strong emphasis", + "html": "

    foo\nbar

    \n", + "markdown": "**foo\nbar**\n", + "example": 400, + "start_line": 6711 + }, + { + "end_line": 6727, + "section": "Emphasis and strong emphasis", + "html": "

    foo bar baz

    \n", + "markdown": "__foo _bar_ baz__\n", + "example": 401, + "start_line": 6723 + }, + { + "end_line": 6734, + "section": "Emphasis and strong emphasis", + "html": "

    foo bar baz

    \n", + "markdown": "__foo __bar__ baz__\n", + "example": 402, + "start_line": 6730 + }, + { + "end_line": 6741, + "section": "Emphasis and strong emphasis", + "html": "

    foo bar

    \n", + "markdown": "____foo__ bar__\n", + "example": 403, + "start_line": 6737 + }, + { + "end_line": 6748, + "section": "Emphasis and strong emphasis", + "html": "

    foo bar

    \n", + "markdown": "**foo **bar****\n", + "example": 404, + "start_line": 6744 + }, + { + "end_line": 6755, + "section": "Emphasis and strong emphasis", + "html": "

    foo bar baz

    \n", + "markdown": "**foo *bar* baz**\n", + "example": 405, + "start_line": 6751 + }, + { + "end_line": 6762, + "section": "Emphasis and strong emphasis", + "html": "

    foobarbaz

    \n", + "markdown": "**foo*bar*baz**\n", + "example": 406, + "start_line": 6758 + }, + { + "end_line": 6769, + "section": "Emphasis and strong emphasis", + "html": "

    foo bar

    \n", + "markdown": "***foo* bar**\n", + "example": 407, + "start_line": 6765 + }, + { + "end_line": 6776, + "section": "Emphasis and strong emphasis", + "html": "

    foo bar

    \n", + "markdown": "**foo *bar***\n", + "example": 408, + "start_line": 6772 + }, + { + "end_line": 6787, + "section": "Emphasis and strong emphasis", + "html": "

    foo bar baz\nbim bop

    \n", + "markdown": "**foo *bar **baz**\nbim* bop**\n", + "example": 409, + "start_line": 6781 + }, + { + "end_line": 6794, + "section": "Emphasis and strong emphasis", + "html": "

    foo bar

    \n", + "markdown": "**foo [*bar*](/url)**\n", + "example": 410, + "start_line": 6790 + }, + { + "end_line": 6803, + "section": "Emphasis and strong emphasis", + "html": "

    __ is not an empty emphasis

    \n", + "markdown": "__ is not an empty emphasis\n", + "example": 411, + "start_line": 6799 + }, + { + "end_line": 6810, + "section": "Emphasis and strong emphasis", + "html": "

    ____ is not an empty strong emphasis

    \n", + "markdown": "____ is not an empty strong emphasis\n", + "example": 412, + "start_line": 6806 + }, + { + "end_line": 6820, + "section": "Emphasis and strong emphasis", + "html": "

    foo ***

    \n", + "markdown": "foo ***\n", + "example": 413, + "start_line": 6816 + }, + { + "end_line": 6827, + "section": "Emphasis and strong emphasis", + "html": "

    foo *

    \n", + "markdown": "foo *\\**\n", + "example": 414, + "start_line": 6823 + }, + { + "end_line": 6834, + "section": "Emphasis and strong emphasis", + "html": "

    foo _

    \n", + "markdown": "foo *_*\n", + "example": 415, + "start_line": 6830 + }, + { + "end_line": 6841, + "section": "Emphasis and strong emphasis", + "html": "

    foo *****

    \n", + "markdown": "foo *****\n", + "example": 416, + "start_line": 6837 + }, + { + "end_line": 6848, + "section": "Emphasis and strong emphasis", + "html": "

    foo *

    \n", + "markdown": "foo **\\***\n", + "example": 417, + "start_line": 6844 + }, + { + "end_line": 6855, + "section": "Emphasis and strong emphasis", + "html": "

    foo _

    \n", + "markdown": "foo **_**\n", + "example": 418, + "start_line": 6851 + }, + { + "end_line": 6866, + "section": "Emphasis and strong emphasis", + "html": "

    *foo

    \n", + "markdown": "**foo*\n", + "example": 419, + "start_line": 6862 + }, + { + "end_line": 6873, + "section": "Emphasis and strong emphasis", + "html": "

    foo*

    \n", + "markdown": "*foo**\n", + "example": 420, + "start_line": 6869 + }, + { + "end_line": 6880, + "section": "Emphasis and strong emphasis", + "html": "

    *foo

    \n", + "markdown": "***foo**\n", + "example": 421, + "start_line": 6876 + }, + { + "end_line": 6887, + "section": "Emphasis and strong emphasis", + "html": "

    ***foo

    \n", + "markdown": "****foo*\n", + "example": 422, + "start_line": 6883 + }, + { + "end_line": 6894, + "section": "Emphasis and strong emphasis", + "html": "

    foo*

    \n", + "markdown": "**foo***\n", + "example": 423, + "start_line": 6890 + }, + { + "end_line": 6901, + "section": "Emphasis and strong emphasis", + "html": "

    foo***

    \n", + "markdown": "*foo****\n", + "example": 424, + "start_line": 6897 + }, + { + "end_line": 6911, + "section": "Emphasis and strong emphasis", + "html": "

    foo ___

    \n", + "markdown": "foo ___\n", + "example": 425, + "start_line": 6907 + }, + { + "end_line": 6918, + "section": "Emphasis and strong emphasis", + "html": "

    foo _

    \n", + "markdown": "foo _\\__\n", + "example": 426, + "start_line": 6914 + }, + { + "end_line": 6925, + "section": "Emphasis and strong emphasis", + "html": "

    foo *

    \n", + "markdown": "foo _*_\n", + "example": 427, + "start_line": 6921 + }, + { + "end_line": 6932, + "section": "Emphasis and strong emphasis", + "html": "

    foo _____

    \n", + "markdown": "foo _____\n", + "example": 428, + "start_line": 6928 + }, + { + "end_line": 6939, + "section": "Emphasis and strong emphasis", + "html": "

    foo _

    \n", + "markdown": "foo __\\___\n", + "example": 429, + "start_line": 6935 + }, + { + "end_line": 6946, + "section": "Emphasis and strong emphasis", + "html": "

    foo *

    \n", + "markdown": "foo __*__\n", + "example": 430, + "start_line": 6942 + }, + { + "end_line": 6953, + "section": "Emphasis and strong emphasis", + "html": "

    _foo

    \n", + "markdown": "__foo_\n", + "example": 431, + "start_line": 6949 + }, + { + "end_line": 6964, + "section": "Emphasis and strong emphasis", + "html": "

    foo_

    \n", + "markdown": "_foo__\n", + "example": 432, + "start_line": 6960 + }, + { + "end_line": 6971, + "section": "Emphasis and strong emphasis", + "html": "

    _foo

    \n", + "markdown": "___foo__\n", + "example": 433, + "start_line": 6967 + }, + { + "end_line": 6978, + "section": "Emphasis and strong emphasis", + "html": "

    ___foo

    \n", + "markdown": "____foo_\n", + "example": 434, + "start_line": 6974 + }, + { + "end_line": 6985, + "section": "Emphasis and strong emphasis", + "html": "

    foo_

    \n", + "markdown": "__foo___\n", + "example": 435, + "start_line": 6981 + }, + { + "end_line": 6992, + "section": "Emphasis and strong emphasis", + "html": "

    foo___

    \n", + "markdown": "_foo____\n", + "example": 436, + "start_line": 6988 + }, + { + "end_line": 7002, + "section": "Emphasis and strong emphasis", + "html": "

    foo

    \n", + "markdown": "**foo**\n", + "example": 437, + "start_line": 6998 + }, + { + "end_line": 7009, + "section": "Emphasis and strong emphasis", + "html": "

    foo

    \n", + "markdown": "*_foo_*\n", + "example": 438, + "start_line": 7005 + }, + { + "end_line": 7016, + "section": "Emphasis and strong emphasis", + "html": "

    foo

    \n", + "markdown": "__foo__\n", + "example": 439, + "start_line": 7012 + }, + { + "end_line": 7023, + "section": "Emphasis and strong emphasis", + "html": "

    foo

    \n", + "markdown": "_*foo*_\n", + "example": 440, + "start_line": 7019 + }, + { + "end_line": 7033, + "section": "Emphasis and strong emphasis", + "html": "

    foo

    \n", + "markdown": "****foo****\n", + "example": 441, + "start_line": 7029 + }, + { + "end_line": 7040, + "section": "Emphasis and strong emphasis", + "html": "

    foo

    \n", + "markdown": "____foo____\n", + "example": 442, + "start_line": 7036 + }, + { + "end_line": 7051, + "section": "Emphasis and strong emphasis", + "html": "

    foo

    \n", + "markdown": "******foo******\n", + "example": 443, + "start_line": 7047 + }, + { + "end_line": 7060, + "section": "Emphasis and strong emphasis", + "html": "

    foo

    \n", + "markdown": "***foo***\n", + "example": 444, + "start_line": 7056 + }, + { + "end_line": 7067, + "section": "Emphasis and strong emphasis", + "html": "

    foo

    \n", + "markdown": "_____foo_____\n", + "example": 445, + "start_line": 7063 + }, + { + "end_line": 7076, + "section": "Emphasis and strong emphasis", + "html": "

    foo _bar baz_

    \n", + "markdown": "*foo _bar* baz_\n", + "example": 446, + "start_line": 7072 + }, + { + "end_line": 7083, + "section": "Emphasis and strong emphasis", + "html": "

    foo bar *baz bim bam

    \n", + "markdown": "*foo __bar *baz bim__ bam*\n", + "example": 447, + "start_line": 7079 + }, + { + "end_line": 7092, + "section": "Emphasis and strong emphasis", + "html": "

    **foo bar baz

    \n", + "markdown": "**foo **bar baz**\n", + "example": 448, + "start_line": 7088 + }, + { + "end_line": 7099, + "section": "Emphasis and strong emphasis", + "html": "

    *foo bar baz

    \n", + "markdown": "*foo *bar baz*\n", + "example": 449, + "start_line": 7095 + }, + { + "end_line": 7108, + "section": "Emphasis and strong emphasis", + "html": "

    *bar*

    \n", + "markdown": "*[bar*](/url)\n", + "example": 450, + "start_line": 7104 + }, + { + "end_line": 7115, + "section": "Emphasis and strong emphasis", + "html": "

    _foo bar_

    \n", + "markdown": "_foo [bar_](/url)\n", + "example": 451, + "start_line": 7111 + }, + { + "end_line": 7122, + "section": "Emphasis and strong emphasis", + "html": "

    *

    \n", + "markdown": "*\n", + "example": 452, + "start_line": 7118 + }, + { + "end_line": 7129, + "section": "Emphasis and strong emphasis", + "html": "

    **

    \n", + "markdown": "**\n", + "example": 453, + "start_line": 7125 + }, + { + "end_line": 7136, + "section": "Emphasis and strong emphasis", + "html": "

    __

    \n", + "markdown": "__\n", + "example": 454, + "start_line": 7132 + }, + { + "end_line": 7143, + "section": "Emphasis and strong emphasis", + "html": "

    a *

    \n", + "markdown": "*a `*`*\n", + "example": 455, + "start_line": 7139 + }, + { + "end_line": 7150, + "section": "Emphasis and strong emphasis", + "html": "

    a _

    \n", + "markdown": "_a `_`_\n", + "example": 456, + "start_line": 7146 + }, + { + "end_line": 7157, + "section": "Emphasis and strong emphasis", + "html": "

    **ahttp://foo.bar/?q=**

    \n", + "markdown": "**a\n", + "example": 457, + "start_line": 7153 + }, + { + "end_line": 7164, + "section": "Emphasis and strong emphasis", + "html": "

    __ahttp://foo.bar/?q=__

    \n", + "markdown": "__a\n", + "example": 458, + "start_line": 7160 + }, + { + "end_line": 7245, + "section": "Links", + "html": "

    link

    \n", + "markdown": "[link](/uri \"title\")\n", + "example": 459, + "start_line": 7241 + }, + { + "end_line": 7254, + "section": "Links", + "html": "

    link

    \n", + "markdown": "[link](/uri)\n", + "example": 460, + "start_line": 7250 + }, + { + "end_line": 7263, + "section": "Links", + "html": "

    link

    \n", + "markdown": "[link]()\n", + "example": 461, + "start_line": 7259 + }, + { + "end_line": 7270, + "section": "Links", + "html": "

    link

    \n", + "markdown": "[link](<>)\n", + "example": 462, + "start_line": 7266 + }, + { + "end_line": 7280, + "section": "Links", + "html": "

    [link](/my uri)

    \n", + "markdown": "[link](/my uri)\n", + "example": 463, + "start_line": 7276 + }, + { + "end_line": 7287, + "section": "Links", + "html": "

    [link](</my uri>)

    \n", + "markdown": "[link]()\n", + "example": 464, + "start_line": 7283 + }, + { + "end_line": 7296, + "section": "Links", + "html": "

    [link](foo\nbar)

    \n", + "markdown": "[link](foo\nbar)\n", + "example": 465, + "start_line": 7290 + }, + { + "end_line": 7305, + "section": "Links", + "html": "

    [link]()

    \n", + "markdown": "[link]()\n", + "example": 466, + "start_line": 7299 + }, + { + "end_line": 7313, + "section": "Links", + "html": "

    link

    \n", + "markdown": "[link](\\(foo\\))\n", + "example": 467, + "start_line": 7309 + }, + { + "end_line": 7322, + "section": "Links", + "html": "

    link

    \n", + "markdown": "[link](foo(and(bar)))\n", + "example": 468, + "start_line": 7318 + }, + { + "end_line": 7331, + "section": "Links", + "html": "

    link

    \n", + "markdown": "[link](foo\\(and\\(bar\\))\n", + "example": 469, + "start_line": 7327 + }, + { + "end_line": 7338, + "section": "Links", + "html": "

    link

    \n", + "markdown": "[link]()\n", + "example": 470, + "start_line": 7334 + }, + { + "end_line": 7348, + "section": "Links", + "html": "

    link

    \n", + "markdown": "[link](foo\\)\\:)\n", + "example": 471, + "start_line": 7344 + }, + { + "end_line": 7363, + "section": "Links", + "html": "

    link

    \n

    link

    \n

    link

    \n", + "markdown": "[link](#fragment)\n\n[link](http://example.com#fragment)\n\n[link](http://example.com?foo=3#frag)\n", + "example": 472, + "start_line": 7353 + }, + { + "end_line": 7373, + "section": "Links", + "html": "

    link

    \n", + "markdown": "[link](foo\\bar)\n", + "example": 473, + "start_line": 7369 + }, + { + "end_line": 7389, + "section": "Links", + "html": "

    link

    \n", + "markdown": "[link](foo%20bä)\n", + "example": 474, + "start_line": 7385 + }, + { + "end_line": 7400, + "section": "Links", + "html": "

    link

    \n", + "markdown": "[link](\"title\")\n", + "example": 475, + "start_line": 7396 + }, + { + "end_line": 7413, + "section": "Links", + "html": "

    link\nlink\nlink

    \n", + "markdown": "[link](/url \"title\")\n[link](/url 'title')\n[link](/url (title))\n", + "example": 476, + "start_line": 7405 + }, + { + "end_line": 7423, + "section": "Links", + "html": "

    link

    \n", + "markdown": "[link](/url \"title \\\""\")\n", + "example": 477, + "start_line": 7419 + }, + { + "end_line": 7433, + "section": "Links", + "html": "

    link

    \n", + "markdown": "[link](/url \"title\")\n", + "example": 478, + "start_line": 7429 + }, + { + "end_line": 7442, + "section": "Links", + "html": "

    [link](/url "title "and" title")

    \n", + "markdown": "[link](/url \"title \"and\" title\")\n", + "example": 479, + "start_line": 7438 + }, + { + "end_line": 7451, + "section": "Links", + "html": "

    link

    \n", + "markdown": "[link](/url 'title \"and\" title')\n", + "example": 480, + "start_line": 7447 + }, + { + "end_line": 7476, + "section": "Links", + "html": "

    link

    \n", + "markdown": "[link]( /uri\n \"title\" )\n", + "example": 481, + "start_line": 7471 + }, + { + "end_line": 7486, + "section": "Links", + "html": "

    [link] (/uri)

    \n", + "markdown": "[link] (/uri)\n", + "example": 482, + "start_line": 7482 + }, + { + "end_line": 7496, + "section": "Links", + "html": "

    link [foo [bar]]

    \n", + "markdown": "[link [foo [bar]]](/uri)\n", + "example": 483, + "start_line": 7492 + }, + { + "end_line": 7503, + "section": "Links", + "html": "

    [link] bar](/uri)

    \n", + "markdown": "[link] bar](/uri)\n", + "example": 484, + "start_line": 7499 + }, + { + "end_line": 7510, + "section": "Links", + "html": "

    [link bar

    \n", + "markdown": "[link [bar](/uri)\n", + "example": 485, + "start_line": 7506 + }, + { + "end_line": 7517, + "section": "Links", + "html": "

    link [bar

    \n", + "markdown": "[link \\[bar](/uri)\n", + "example": 486, + "start_line": 7513 + }, + { + "end_line": 7526, + "section": "Links", + "html": "

    link foo bar #

    \n", + "markdown": "[link *foo **bar** `#`*](/uri)\n", + "example": 487, + "start_line": 7522 + }, + { + "end_line": 7533, + "section": "Links", + "html": "

    \"moon\"

    \n", + "markdown": "[![moon](moon.jpg)](/uri)\n", + "example": 488, + "start_line": 7529 + }, + { + "end_line": 7542, + "section": "Links", + "html": "

    [foo bar](/uri)

    \n", + "markdown": "[foo [bar](/uri)](/uri)\n", + "example": 489, + "start_line": 7538 + }, + { + "end_line": 7549, + "section": "Links", + "html": "

    [foo [bar baz](/uri)](/uri)

    \n", + "markdown": "[foo *[bar [baz](/uri)](/uri)*](/uri)\n", + "example": 490, + "start_line": 7545 + }, + { + "end_line": 7556, + "section": "Links", + "html": "

    \"[foo](uri2)\"

    \n", + "markdown": "![[[foo](uri1)](uri2)](uri3)\n", + "example": 491, + "start_line": 7552 + }, + { + "end_line": 7566, + "section": "Links", + "html": "

    *foo*

    \n", + "markdown": "*[foo*](/uri)\n", + "example": 492, + "start_line": 7562 + }, + { + "end_line": 7573, + "section": "Links", + "html": "

    foo *bar

    \n", + "markdown": "[foo *bar](baz*)\n", + "example": 493, + "start_line": 7569 + }, + { + "end_line": 7583, + "section": "Links", + "html": "

    foo [bar baz]

    \n", + "markdown": "*foo [bar* baz]\n", + "example": 494, + "start_line": 7579 + }, + { + "end_line": 7593, + "section": "Links", + "html": "

    [foo

    \n", + "markdown": "[foo \n", + "example": 495, + "start_line": 7589 + }, + { + "end_line": 7600, + "section": "Links", + "html": "

    [foo](/uri)

    \n", + "markdown": "[foo`](/uri)`\n", + "example": 496, + "start_line": 7596 + }, + { + "end_line": 7607, + "section": "Links", + "html": "

    [foohttp://example.com/?search=](uri)

    \n", + "markdown": "[foo\n", + "example": 497, + "start_line": 7603 + }, + { + "end_line": 7647, + "section": "Links", + "html": "

    foo

    \n", + "markdown": "[foo][bar]\n\n[bar]: /url \"title\"\n", + "example": 498, + "start_line": 7641 + }, + { + "end_line": 7662, + "section": "Links", + "html": "

    link [foo [bar]]

    \n", + "markdown": "[link [foo [bar]]][ref]\n\n[ref]: /uri\n", + "example": 499, + "start_line": 7656 + }, + { + "end_line": 7671, + "section": "Links", + "html": "

    link [bar

    \n", + "markdown": "[link \\[bar][ref]\n\n[ref]: /uri\n", + "example": 500, + "start_line": 7665 + }, + { + "end_line": 7682, + "section": "Links", + "html": "

    link foo bar #

    \n", + "markdown": "[link *foo **bar** `#`*][ref]\n\n[ref]: /uri\n", + "example": 501, + "start_line": 7676 + }, + { + "end_line": 7691, + "section": "Links", + "html": "

    \"moon\"

    \n", + "markdown": "[![moon](moon.jpg)][ref]\n\n[ref]: /uri\n", + "example": 502, + "start_line": 7685 + }, + { + "end_line": 7702, + "section": "Links", + "html": "

    [foo bar]ref

    \n", + "markdown": "[foo [bar](/uri)][ref]\n\n[ref]: /uri\n", + "example": 503, + "start_line": 7696 + }, + { + "end_line": 7711, + "section": "Links", + "html": "

    [foo bar baz]ref

    \n", + "markdown": "[foo *bar [baz][ref]*][ref]\n\n[ref]: /uri\n", + "example": 504, + "start_line": 7705 + }, + { + "end_line": 7726, + "section": "Links", + "html": "

    *foo*

    \n", + "markdown": "*[foo*][ref]\n\n[ref]: /uri\n", + "example": 505, + "start_line": 7720 + }, + { + "end_line": 7735, + "section": "Links", + "html": "

    foo *bar

    \n", + "markdown": "[foo *bar][ref]\n\n[ref]: /uri\n", + "example": 506, + "start_line": 7729 + }, + { + "end_line": 7747, + "section": "Links", + "html": "

    [foo

    \n", + "markdown": "[foo \n\n[ref]: /uri\n", + "example": 507, + "start_line": 7741 + }, + { + "end_line": 7756, + "section": "Links", + "html": "

    [foo][ref]

    \n", + "markdown": "[foo`][ref]`\n\n[ref]: /uri\n", + "example": 508, + "start_line": 7750 + }, + { + "end_line": 7765, + "section": "Links", + "html": "

    [foohttp://example.com/?search=][ref]

    \n", + "markdown": "[foo\n\n[ref]: /uri\n", + "example": 509, + "start_line": 7759 + }, + { + "end_line": 7776, + "section": "Links", + "html": "

    foo

    \n", + "markdown": "[foo][BaR]\n\n[bar]: /url \"title\"\n", + "example": 510, + "start_line": 7770 + }, + { + "end_line": 7787, + "section": "Links", + "html": "

    Толпой is a Russian word.

    \n", + "markdown": "[Толпой][Толпой] is a Russian word.\n\n[ТОЛПОЙ]: /url\n", + "example": 511, + "start_line": 7781 + }, + { + "end_line": 7800, + "section": "Links", + "html": "

    Baz

    \n", + "markdown": "[Foo\n bar]: /url\n\n[Baz][Foo bar]\n", + "example": 512, + "start_line": 7793 + }, + { + "end_line": 7812, + "section": "Links", + "html": "

    [foo] bar

    \n", + "markdown": "[foo] [bar]\n\n[bar]: /url \"title\"\n", + "example": 513, + "start_line": 7806 + }, + { + "end_line": 7823, + "section": "Links", + "html": "

    [foo]\nbar

    \n", + "markdown": "[foo]\n[bar]\n\n[bar]: /url \"title\"\n", + "example": 514, + "start_line": 7815 + }, + { + "end_line": 7864, + "section": "Links", + "html": "

    bar

    \n", + "markdown": "[foo]: /url1\n\n[foo]: /url2\n\n[bar][foo]\n", + "example": 515, + "start_line": 7856 + }, + { + "end_line": 7877, + "section": "Links", + "html": "

    [bar][foo!]

    \n", + "markdown": "[bar][foo\\!]\n\n[foo!]: /url\n", + "example": 516, + "start_line": 7871 + }, + { + "end_line": 7890, + "section": "Links", + "html": "

    [foo][ref[]

    \n

    [ref[]: /uri

    \n", + "markdown": "[foo][ref[]\n\n[ref[]: /uri\n", + "example": 517, + "start_line": 7883 + }, + { + "end_line": 7900, + "section": "Links", + "html": "

    [foo][ref[bar]]

    \n

    [ref[bar]]: /uri

    \n", + "markdown": "[foo][ref[bar]]\n\n[ref[bar]]: /uri\n", + "example": 518, + "start_line": 7893 + }, + { + "end_line": 7910, + "section": "Links", + "html": "

    [[[foo]]]

    \n

    [[[foo]]]: /url

    \n", + "markdown": "[[[foo]]]\n\n[[[foo]]]: /url\n", + "example": 519, + "start_line": 7903 + }, + { + "end_line": 7919, + "section": "Links", + "html": "

    foo

    \n", + "markdown": "[foo][ref\\[]\n\n[ref\\[]: /uri\n", + "example": 520, + "start_line": 7913 + }, + { + "end_line": 7930, + "section": "Links", + "html": "

    bar\\

    \n", + "markdown": "[bar\\\\]: /uri\n\n[bar\\\\]\n", + "example": 521, + "start_line": 7924 + }, + { + "end_line": 7942, + "section": "Links", + "html": "

    []

    \n

    []: /uri

    \n", + "markdown": "[]\n\n[]: /uri\n", + "example": 522, + "start_line": 7935 + }, + { + "end_line": 7956, + "section": "Links", + "html": "

    [\n]

    \n

    [\n]: /uri

    \n", + "markdown": "[\n ]\n\n[\n ]: /uri\n", + "example": 523, + "start_line": 7945 + }, + { + "end_line": 7974, + "section": "Links", + "html": "

    foo

    \n", + "markdown": "[foo][]\n\n[foo]: /url \"title\"\n", + "example": 524, + "start_line": 7968 + }, + { + "end_line": 7983, + "section": "Links", + "html": "

    foo bar

    \n", + "markdown": "[*foo* bar][]\n\n[*foo* bar]: /url \"title\"\n", + "example": 525, + "start_line": 7977 + }, + { + "end_line": 7994, + "section": "Links", + "html": "

    Foo

    \n", + "markdown": "[Foo][]\n\n[foo]: /url \"title\"\n", + "example": 526, + "start_line": 7988 + }, + { + "end_line": 8009, + "section": "Links", + "html": "

    foo\n[]

    \n", + "markdown": "[foo] \n[]\n\n[foo]: /url \"title\"\n", + "example": 527, + "start_line": 8001 + }, + { + "end_line": 8027, + "section": "Links", + "html": "

    foo

    \n", + "markdown": "[foo]\n\n[foo]: /url \"title\"\n", + "example": 528, + "start_line": 8021 + }, + { + "end_line": 8036, + "section": "Links", + "html": "

    foo bar

    \n", + "markdown": "[*foo* bar]\n\n[*foo* bar]: /url \"title\"\n", + "example": 529, + "start_line": 8030 + }, + { + "end_line": 8045, + "section": "Links", + "html": "

    [foo bar]

    \n", + "markdown": "[[*foo* bar]]\n\n[*foo* bar]: /url \"title\"\n", + "example": 530, + "start_line": 8039 + }, + { + "end_line": 8054, + "section": "Links", + "html": "

    [[bar foo

    \n", + "markdown": "[[bar [foo]\n\n[foo]: /url\n", + "example": 531, + "start_line": 8048 + }, + { + "end_line": 8065, + "section": "Links", + "html": "

    Foo

    \n", + "markdown": "[Foo]\n\n[foo]: /url \"title\"\n", + "example": 532, + "start_line": 8059 + }, + { + "end_line": 8076, + "section": "Links", + "html": "

    foo bar

    \n", + "markdown": "[foo] bar\n\n[foo]: /url\n", + "example": 533, + "start_line": 8070 + }, + { + "end_line": 8088, + "section": "Links", + "html": "

    [foo]

    \n", + "markdown": "\\[foo]\n\n[foo]: /url \"title\"\n", + "example": 534, + "start_line": 8082 + }, + { + "end_line": 8100, + "section": "Links", + "html": "

    *foo*

    \n", + "markdown": "[foo*]: /url\n\n*[foo*]\n", + "example": 535, + "start_line": 8094 + }, + { + "end_line": 8113, + "section": "Links", + "html": "

    foo

    \n", + "markdown": "[foo][bar]\n\n[foo]: /url1\n[bar]: /url2\n", + "example": 536, + "start_line": 8106 + }, + { + "end_line": 8121, + "section": "Links", + "html": "

    foo

    \n", + "markdown": "[foo][]\n\n[foo]: /url1\n", + "example": 537, + "start_line": 8115 + }, + { + "end_line": 8131, + "section": "Links", + "html": "

    foo

    \n", + "markdown": "[foo]()\n\n[foo]: /url1\n", + "example": 538, + "start_line": 8125 + }, + { + "end_line": 8139, + "section": "Links", + "html": "

    foo(not a link)

    \n", + "markdown": "[foo](not a link)\n\n[foo]: /url1\n", + "example": 539, + "start_line": 8133 + }, + { + "end_line": 8150, + "section": "Links", + "html": "

    [foo]bar

    \n", + "markdown": "[foo][bar][baz]\n\n[baz]: /url\n", + "example": 540, + "start_line": 8144 + }, + { + "end_line": 8163, + "section": "Links", + "html": "

    foobaz

    \n", + "markdown": "[foo][bar][baz]\n\n[baz]: /url1\n[bar]: /url2\n", + "example": 541, + "start_line": 8156 + }, + { + "end_line": 8176, + "section": "Links", + "html": "

    [foo]bar

    \n", + "markdown": "[foo][bar][baz]\n\n[baz]: /url1\n[foo]: /url2\n", + "example": 542, + "start_line": 8169 + }, + { + "end_line": 8196, + "section": "Images", + "html": "

    \"foo\"

    \n", + "markdown": "![foo](/url \"title\")\n", + "example": 543, + "start_line": 8192 + }, + { + "end_line": 8205, + "section": "Images", + "html": "

    \"foo

    \n", + "markdown": "![foo *bar*]\n\n[foo *bar*]: train.jpg \"train & tracks\"\n", + "example": 544, + "start_line": 8199 + }, + { + "end_line": 8212, + "section": "Images", + "html": "

    \"foo

    \n", + "markdown": "![foo ![bar](/url)](/url2)\n", + "example": 545, + "start_line": 8208 + }, + { + "end_line": 8219, + "section": "Images", + "html": "

    \"foo

    \n", + "markdown": "![foo [bar](/url)](/url2)\n", + "example": 546, + "start_line": 8215 + }, + { + "end_line": 8235, + "section": "Images", + "html": "

    \"foo

    \n", + "markdown": "![foo *bar*][]\n\n[foo *bar*]: train.jpg \"train & tracks\"\n", + "example": 547, + "start_line": 8229 + }, + { + "end_line": 8244, + "section": "Images", + "html": "

    \"foo

    \n", + "markdown": "![foo *bar*][foobar]\n\n[FOOBAR]: train.jpg \"train & tracks\"\n", + "example": 548, + "start_line": 8238 + }, + { + "end_line": 8251, + "section": "Images", + "html": "

    \"foo\"

    \n", + "markdown": "![foo](train.jpg)\n", + "example": 549, + "start_line": 8247 + }, + { + "end_line": 8258, + "section": "Images", + "html": "

    My \"foo

    \n", + "markdown": "My ![foo bar](/path/to/train.jpg \"title\" )\n", + "example": 550, + "start_line": 8254 + }, + { + "end_line": 8265, + "section": "Images", + "html": "

    \"foo\"

    \n", + "markdown": "![foo]()\n", + "example": 551, + "start_line": 8261 + }, + { + "end_line": 8272, + "section": "Images", + "html": "

    \"\"

    \n", + "markdown": "![](/url)\n", + "example": 552, + "start_line": 8268 + }, + { + "end_line": 8283, + "section": "Images", + "html": "

    \"foo\"

    \n", + "markdown": "![foo][bar]\n\n[bar]: /url\n", + "example": 553, + "start_line": 8277 + }, + { + "end_line": 8292, + "section": "Images", + "html": "

    \"foo\"

    \n", + "markdown": "![foo][bar]\n\n[BAR]: /url\n", + "example": 554, + "start_line": 8286 + }, + { + "end_line": 8303, + "section": "Images", + "html": "

    \"foo\"

    \n", + "markdown": "![foo][]\n\n[foo]: /url \"title\"\n", + "example": 555, + "start_line": 8297 + }, + { + "end_line": 8312, + "section": "Images", + "html": "

    \"foo

    \n", + "markdown": "![*foo* bar][]\n\n[*foo* bar]: /url \"title\"\n", + "example": 556, + "start_line": 8306 + }, + { + "end_line": 8323, + "section": "Images", + "html": "

    \"Foo\"

    \n", + "markdown": "![Foo][]\n\n[foo]: /url \"title\"\n", + "example": 557, + "start_line": 8317 + }, + { + "end_line": 8337, + "section": "Images", + "html": "

    \"foo\"\n[]

    \n", + "markdown": "![foo] \n[]\n\n[foo]: /url \"title\"\n", + "example": 558, + "start_line": 8329 + }, + { + "end_line": 8348, + "section": "Images", + "html": "

    \"foo\"

    \n", + "markdown": "![foo]\n\n[foo]: /url \"title\"\n", + "example": 559, + "start_line": 8342 + }, + { + "end_line": 8357, + "section": "Images", + "html": "

    \"foo

    \n", + "markdown": "![*foo* bar]\n\n[*foo* bar]: /url \"title\"\n", + "example": 560, + "start_line": 8351 + }, + { + "end_line": 8369, + "section": "Images", + "html": "

    ![[foo]]

    \n

    [[foo]]: /url "title"

    \n", + "markdown": "![[foo]]\n\n[[foo]]: /url \"title\"\n", + "example": 561, + "start_line": 8362 + }, + { + "end_line": 8380, + "section": "Images", + "html": "

    \"Foo\"

    \n", + "markdown": "![Foo]\n\n[foo]: /url \"title\"\n", + "example": 562, + "start_line": 8374 + }, + { + "end_line": 8392, + "section": "Images", + "html": "

    ![foo]

    \n", + "markdown": "!\\[foo]\n\n[foo]: /url \"title\"\n", + "example": 563, + "start_line": 8386 + }, + { + "end_line": 8404, + "section": "Images", + "html": "

    !foo

    \n", + "markdown": "\\![foo]\n\n[foo]: /url \"title\"\n", + "example": 564, + "start_line": 8398 + }, + { + "end_line": 8435, + "section": "Autolinks", + "html": "

    http://foo.bar.baz

    \n", + "markdown": "\n", + "example": 565, + "start_line": 8431 + }, + { + "end_line": 8442, + "section": "Autolinks", + "html": "

    http://foo.bar.baz/test?q=hello&id=22&boolean

    \n", + "markdown": "\n", + "example": 566, + "start_line": 8438 + }, + { + "end_line": 8449, + "section": "Autolinks", + "html": "

    irc://foo.bar:2233/baz

    \n", + "markdown": "\n", + "example": 567, + "start_line": 8445 + }, + { + "end_line": 8458, + "section": "Autolinks", + "html": "

    MAILTO:FOO@BAR.BAZ

    \n", + "markdown": "\n", + "example": 568, + "start_line": 8454 + }, + { + "end_line": 8470, + "section": "Autolinks", + "html": "

    a+b+c:d

    \n", + "markdown": "\n", + "example": 569, + "start_line": 8466 + }, + { + "end_line": 8477, + "section": "Autolinks", + "html": "

    made-up-scheme://foo,bar

    \n", + "markdown": "\n", + "example": 570, + "start_line": 8473 + }, + { + "end_line": 8484, + "section": "Autolinks", + "html": "

    http://../

    \n", + "markdown": "\n", + "example": 571, + "start_line": 8480 + }, + { + "end_line": 8491, + "section": "Autolinks", + "html": "

    localhost:5001/foo

    \n", + "markdown": "\n", + "example": 572, + "start_line": 8487 + }, + { + "end_line": 8500, + "section": "Autolinks", + "html": "

    <http://foo.bar/baz bim>

    \n", + "markdown": "\n", + "example": 573, + "start_line": 8496 + }, + { + "end_line": 8509, + "section": "Autolinks", + "html": "

    http://example.com/\\[\\

    \n", + "markdown": "\n", + "example": 574, + "start_line": 8505 + }, + { + "end_line": 8531, + "section": "Autolinks", + "html": "

    foo@bar.example.com

    \n", + "markdown": "\n", + "example": 575, + "start_line": 8527 + }, + { + "end_line": 8538, + "section": "Autolinks", + "html": "

    foo+special@Bar.baz-bar0.com

    \n", + "markdown": "\n", + "example": 576, + "start_line": 8534 + }, + { + "end_line": 8547, + "section": "Autolinks", + "html": "

    <foo+@bar.example.com>

    \n", + "markdown": "\n", + "example": 577, + "start_line": 8543 + }, + { + "end_line": 8556, + "section": "Autolinks", + "html": "

    <>

    \n", + "markdown": "<>\n", + "example": 578, + "start_line": 8552 + }, + { + "end_line": 8563, + "section": "Autolinks", + "html": "

    < http://foo.bar >

    \n", + "markdown": "< http://foo.bar >\n", + "example": 579, + "start_line": 8559 + }, + { + "end_line": 8570, + "section": "Autolinks", + "html": "

    <m:abc>

    \n", + "markdown": "\n", + "example": 580, + "start_line": 8566 + }, + { + "end_line": 8577, + "section": "Autolinks", + "html": "

    <foo.bar.baz>

    \n", + "markdown": "\n", + "example": 581, + "start_line": 8573 + }, + { + "end_line": 8584, + "section": "Autolinks", + "html": "

    http://example.com

    \n", + "markdown": "http://example.com\n", + "example": 582, + "start_line": 8580 + }, + { + "end_line": 8591, + "section": "Autolinks", + "html": "

    foo@bar.example.com

    \n", + "markdown": "foo@bar.example.com\n", + "example": 583, + "start_line": 8587 + }, + { + "end_line": 8673, + "section": "Raw HTML", + "html": "

    \n", + "markdown": "\n", + "example": 584, + "start_line": 8669 + }, + { + "end_line": 8682, + "section": "Raw HTML", + "html": "

    \n", + "markdown": "\n", + "example": 585, + "start_line": 8678 + }, + { + "end_line": 8693, + "section": "Raw HTML", + "html": "

    \n", + "markdown": "\n", + "example": 586, + "start_line": 8687 + }, + { + "end_line": 8704, + "section": "Raw HTML", + "html": "

    \n", + "markdown": "\n", + "example": 587, + "start_line": 8698 + }, + { + "end_line": 8713, + "section": "Raw HTML", + "html": "

    Foo

    \n", + "markdown": "Foo \n", + "example": 588, + "start_line": 8709 + }, + { + "end_line": 8722, + "section": "Raw HTML", + "html": "

    <33> <__>

    \n", + "markdown": "<33> <__>\n", + "example": 589, + "start_line": 8718 + }, + { + "end_line": 8731, + "section": "Raw HTML", + "html": "

    <a h*#ref="hi">

    \n", + "markdown": "
    \n", + "example": 590, + "start_line": 8727 + }, + { + "end_line": 8740, + "section": "Raw HTML", + "html": "

    <a href="hi'> <a href=hi'>

    \n", + "markdown": "
    \n", + "example": 591, + "start_line": 8736 + }, + { + "end_line": 8751, + "section": "Raw HTML", + "html": "

    < a><\nfoo><bar/ >

    \n", + "markdown": "< a><\nfoo>\n", + "example": 592, + "start_line": 8745 + }, + { + "end_line": 8760, + "section": "Raw HTML", + "html": "

    <a href='bar'title=title>

    \n", + "markdown": "
    \n", + "example": 593, + "start_line": 8756 + }, + { + "end_line": 8769, + "section": "Raw HTML", + "html": "

    \n", + "markdown": "\n", + "example": 594, + "start_line": 8765 + }, + { + "end_line": 8778, + "section": "Raw HTML", + "html": "

    </a href="foo">

    \n", + "markdown": "\n", + "example": 595, + "start_line": 8774 + }, + { + "end_line": 8789, + "section": "Raw HTML", + "html": "

    foo

    \n", + "markdown": "foo \n", + "example": 596, + "start_line": 8783 + }, + { + "end_line": 8796, + "section": "Raw HTML", + "html": "

    foo <!-- not a comment -- two hyphens -->

    \n", + "markdown": "foo \n", + "example": 597, + "start_line": 8792 + }, + { + "end_line": 8808, + "section": "Raw HTML", + "html": "

    foo <!--> foo -->

    \n

    foo <!-- foo--->

    \n", + "markdown": "foo foo -->\n\nfoo \n", + "example": 598, + "start_line": 8801 + }, + { + "end_line": 8817, + "section": "Raw HTML", + "html": "

    foo

    \n", + "markdown": "foo \n", + "example": 599, + "start_line": 8813 + }, + { + "end_line": 8826, + "section": "Raw HTML", + "html": "

    foo

    \n", + "markdown": "foo \n", + "example": 600, + "start_line": 8822 + }, + { + "end_line": 8835, + "section": "Raw HTML", + "html": "

    foo &<]]>

    \n", + "markdown": "foo &<]]>\n", + "example": 601, + "start_line": 8831 + }, + { + "end_line": 8845, + "section": "Raw HTML", + "html": "

    foo

    \n", + "markdown": "foo \n", + "example": 602, + "start_line": 8841 + }, + { + "end_line": 8854, + "section": "Raw HTML", + "html": "

    foo

    \n", + "markdown": "foo \n", + "example": 603, + "start_line": 8850 + }, + { + "end_line": 8861, + "section": "Raw HTML", + "html": "

    <a href=""">

    \n", + "markdown": "
    \n", + "example": 604, + "start_line": 8857 + }, + { + "end_line": 8877, + "section": "Hard line breaks", + "html": "

    foo
    \nbaz

    \n", + "markdown": "foo \nbaz\n", + "example": 605, + "start_line": 8871 + }, + { + "end_line": 8889, + "section": "Hard line breaks", + "html": "

    foo
    \nbaz

    \n", + "markdown": "foo\\\nbaz\n", + "example": 606, + "start_line": 8883 + }, + { + "end_line": 8900, + "section": "Hard line breaks", + "html": "

    foo
    \nbaz

    \n", + "markdown": "foo \nbaz\n", + "example": 607, + "start_line": 8894 + }, + { + "end_line": 8911, + "section": "Hard line breaks", + "html": "

    foo
    \nbar

    \n", + "markdown": "foo \n bar\n", + "example": 608, + "start_line": 8905 + }, + { + "end_line": 8920, + "section": "Hard line breaks", + "html": "

    foo
    \nbar

    \n", + "markdown": "foo\\\n bar\n", + "example": 609, + "start_line": 8914 + }, + { + "end_line": 8932, + "section": "Hard line breaks", + "html": "

    foo
    \nbar

    \n", + "markdown": "*foo \nbar*\n", + "example": 610, + "start_line": 8926 + }, + { + "end_line": 8941, + "section": "Hard line breaks", + "html": "

    foo
    \nbar

    \n", + "markdown": "*foo\\\nbar*\n", + "example": 611, + "start_line": 8935 + }, + { + "end_line": 8951, + "section": "Hard line breaks", + "html": "

    code span

    \n", + "markdown": "`code \nspan`\n", + "example": 612, + "start_line": 8946 + }, + { + "end_line": 8959, + "section": "Hard line breaks", + "html": "

    code\\ span

    \n", + "markdown": "`code\\\nspan`\n", + "example": 613, + "start_line": 8954 + }, + { + "end_line": 8970, + "section": "Hard line breaks", + "html": "

    \n", + "markdown": "\n", + "example": 614, + "start_line": 8964 + }, + { + "end_line": 8979, + "section": "Hard line breaks", + "html": "

    \n", + "markdown": "\n", + "example": 615, + "start_line": 8973 + }, + { + "end_line": 8990, + "section": "Hard line breaks", + "html": "

    foo\\

    \n", + "markdown": "foo\\\n", + "example": 616, + "start_line": 8986 + }, + { + "end_line": 8997, + "section": "Hard line breaks", + "html": "

    foo

    \n", + "markdown": "foo \n", + "example": 617, + "start_line": 8993 + }, + { + "end_line": 9004, + "section": "Hard line breaks", + "html": "

    foo\\

    \n", + "markdown": "### foo\\\n", + "example": 618, + "start_line": 9000 + }, + { + "end_line": 9011, + "section": "Hard line breaks", + "html": "

    foo

    \n", + "markdown": "### foo \n", + "example": 619, + "start_line": 9007 + }, + { + "end_line": 9028, + "section": "Soft line breaks", + "html": "

    foo\nbaz

    \n", + "markdown": "foo\nbaz\n", + "example": 620, + "start_line": 9022 + }, + { + "end_line": 9040, + "section": "Soft line breaks", + "html": "

    foo\nbaz

    \n", + "markdown": "foo \n baz\n", + "example": 621, + "start_line": 9034 + }, + { + "end_line": 9058, + "section": "Textual content", + "html": "

    hello $.;'there

    \n", + "markdown": "hello $.;'there\n", + "example": 622, + "start_line": 9054 + }, + { + "end_line": 9065, + "section": "Textual content", + "html": "

    Foo χρῆν

    \n", + "markdown": "Foo χρῆν\n", + "example": 623, + "start_line": 9061 + }, + { + "end_line": 9074, + "section": "Textual content", + "html": "

    Multiple spaces

    \n", + "markdown": "Multiple spaces\n", + "example": 624, + "start_line": 9070 + } +] \ No newline at end of file diff --git a/test/specs/gfm/gfm-spec.js b/test/specs/gfm/gfm-spec.js new file mode 100644 index 00000000..a4d52f70 --- /dev/null +++ b/test/specs/gfm/gfm-spec.js @@ -0,0 +1,96 @@ +var marked = require('../../../lib/marked.js'); +var gfmSpec = require('./gfm.0.28.json') +var HtmlDiffer = require('html-differ').HtmlDiffer, + htmlDiffer = new HtmlDiffer(); +var since = require('jasmine2-custom-message'); + +var Messenger = function() {} + +Messenger.prototype.message = function(spec, expected, actual) { + return 'CommonMark (' + spec.section + '):\n' + spec.markdown + '\n------\n\nExpected:\n' + expected + '\n------\n\nMarked:\n' + actual; +} + +Messenger.prototype.test = function(spec, section, ignore) { + if (spec.section === section && ignore.indexOf(spec.example) < 0) { + var shouldFail = ~ignore.indexOf(spec.example); + it('should ' + (shouldFail ? 'fail' : 'pass') + ' example ' + spec.example, function() { + var expected = spec.html; + var actual = marked(spec.markdown, { headerIds: false, xhtml: false }); + since(messenger.message(spec, expected, actual)).expect( + htmlDiffer.isEqual(expected, actual) + ).toEqual(!shouldFail); + }); + } +} + +var messenger = new Messenger(); + +describe('GFM 0.28 Tables', function() { + var section = 'Tables'; + + var shouldPassButFails = []; + + var willNotBeAttemptedByCoreTeam = []; + + var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); + + gfmSpec.forEach(function(spec) { + messenger.test(spec, section, ignore); + }); +}); + +describe('GFM 0.28 Task list items', function() { + var section = 'Task list items'; + + var shouldPassButFails = []; + + var willNotBeAttemptedByCoreTeam = []; + + var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); + + gfmSpec.forEach(function(spec) { + messenger.test(spec, section, ignore); + }); +}); + +describe('GFM 0.28 Strikethrough', function() { + var section = 'Strikethrough'; + + var shouldPassButFails = []; + + var willNotBeAttemptedByCoreTeam = []; + + var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); + + gfmSpec.forEach(function(spec) { + messenger.test(spec, section, ignore); + }); +}); + +describe('GFM 0.28 Autolinks', function() { + var section = 'Autolinks'; + + var shouldPassButFails = [607]; + + var willNotBeAttemptedByCoreTeam = []; + + var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); + + gfmSpec.forEach(function(spec) { + messenger.test(spec, section, ignore); + }); +}); + +describe('GFM 0.28 Disallowed Raw HTML', function() { + var section = 'Disallowed Raw HTML'; + + var shouldPassButFails = [629]; + + var willNotBeAttemptedByCoreTeam = []; + + var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); + + gfmSpec.forEach(function(spec) { + messenger.test(spec, section, ignore); + }); +}); diff --git a/test/specs/gfm/gfm.0.28.json b/test/specs/gfm/gfm.0.28.json new file mode 100644 index 00000000..d045f8af --- /dev/null +++ b/test/specs/gfm/gfm.0.28.json @@ -0,0 +1,152 @@ +[ + { + "section": "Tables", + "html": "\n\n\n\n\n\n\n\n\n\n\n
    foobar
    bazbim
    ", + "markdown": "| foo | bar |\n| --- | --- |\n| baz | bim |", + "example": 191 + }, + { + "section": "Tables", + "html": "\n\n\n\n\n\n\n\n\n\n\n
    abcdefghi
    barbaz
    ", + "markdown": "| abc | defghi |\n:-: | -----------:\nbar | baz", + "example": 192 + }, + { + "section": "Tables", + "html": "\n\n\n\n\n\n\n\n\n\n\n\n
    f|oo
    b | az
    b | im
    ", + "markdown": "| f\\|oo |\n| ------ |\n| b `\\|` az |\n| b **\\|** im |", + "example": 193 + }, + { + "section": "Tables", + "html": "\n\n\n\n\n\n\n\n\n\n\n
    abcdef
    barbaz
    \n
    \n

    bar

    \n
    ", + "markdown": "| abc | def |\n| --- | --- |\n| bar | baz |\n> bar", + "example": 194 + }, + { + "section": "Tables", + "html": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    abcdef
    barbaz
    bar
    \n

    bar

    ", + "markdown": "| abc | def |\n| --- | --- |\n| bar | baz |\nbar\n\nbar", + "example": 195 + }, + { + "section": "Tables", + "html": "

    | abc | def |\n| --- |\n| bar |

    ", + "markdown": "| abc | def |\n| --- |\n| bar |", + "example": 196 + }, + { + "section": "Tables", + "html": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    abcdef
    bar
    barbaz
    ", + "markdown": "| abc | def |\n| --- | --- |\n| bar |\n| bar | baz | boo |", + "example": 197 + }, + { + "section": "Tables", + "html": "\n\n\n\n\n\n
    abcdef
    ", + "markdown": "| abc | def |\n| --- | --- |", + "example": 198 + }, + { + "section": "Task list items", + "html": "
      \n
    • foo
    • \n
    • bar
    • \n
    ", + "markdown": "- [ ] foo\n- [x] bar", + "example": 272 + }, + { + "section": "Task list items", + "html": "
      \n
    • foo\n
        \n
      • bar
      • \n
      • baz
      • \n
      \n
    • \n
    • bim
    • \n
    ", + "markdown": "- [x] foo\n - [ ] bar\n - [x] baz\n- [ ] bim", + "example": 273 + }, + { + "section": "Strikethrough", + "html": "

    Hi Hello, world!

    ", + "markdown": "~Hi~ Hello, world!", + "example": 469 + }, + { + "section": "Strikethrough", + "html": "

    This text is curious.

    ", + "markdown": "This ~text~~~~ is ~~~~curious~.", + "example": 470 + }, + { + "section": "Strikethrough", + "html": "

    This ~~has a

    \n

    new paragraph~~.

    ", + "markdown": "This ~~has a\n\nnew paragraph~~.", + "example": 471 + }, + { + "section": "Autolinks", + "html": "

    www.commonmark.org

    ", + "markdown": "www.commonmark.org", + "example": 597 + }, + { + "section": "Autolinks", + "html": "

    Visit www.commonmark.org/help for more information.

    ", + "markdown": "Visit www.commonmark.org/help for more information.", + "example": 598 + }, + { + "section": "Autolinks", + "html": "

    Visit www.commonmark.org.

    \n

    Visit www.commonmark.org/a.b.

    ", + "markdown": "Visit www.commonmark.org.\n\nVisit www.commonmark.org/a.b.", + "example": 599 + }, + { + "section": "Autolinks", + "html": "

    www.google.com/search?q=Markup+(business)

    \n

    (www.google.com/search?q=Markup+(business))

    ", + "markdown": "www.google.com/search?q=Markup+(business)\n\n(www.google.com/search?q=Markup+(business))", + "example": 600 + }, + { + "section": "Autolinks", + "html": "

    www.google.com/search?q=(business))+ok

    ", + "markdown": "www.google.com/search?q=(business))+ok", + "example": 601 + }, + { + "section": "Autolinks", + "html": "

    www.google.com/search?q=commonmark&hl=en

    \n

    www.google.com/search?q=commonmark&hl;

    ", + "markdown": "www.google.com/search?q=commonmark&hl=en\n\nwww.google.com/search?q=commonmark&hl;", + "example": 602 + }, + { + "section": "Autolinks", + "html": "

    www.commonmark.org/he<lp

    ", + "markdown": "www.commonmark.org/hehttp://commonmark.org

    \n

    (Visit https://encrypted.google.com/search?q=Markup+(business))

    \n

    Anonymous FTP is available at ftp://foo.bar.baz.

    ", + "markdown": "http://commonmark.org\n\n(Visit https://encrypted.google.com/search?q=Markup+(business))\n\nAnonymous FTP is available at ftp://foo.bar.baz.", + "example": 604 + }, + { + "section": "Autolinks", + "html": "

    foo@bar.baz

    ", + "markdown": "foo@bar.baz", + "example": 605 + }, + { + "section": "Autolinks", + "html": "

    hello@mail+xyz.example isn't valid, but hello+xyz@mail.example is.

    ", + "markdown": "hello@mail+xyz.example isn't valid, but hello+xyz@mail.example is.", + "example": 606 + }, + { + "section": "Autolinks", + "html": "

    a.b-c_d@a.b

    \n

    a.b-c_d@a.b.

    \n

    a.b-c_d@a.b-

    \n

    a.b-c_d@a.b_

    ", + "markdown": "a.b-c_d@a.b\n\na.b-c_d@a.b.\n\na.b-c_d@a.b-\n\na.b-c_d@a.b_", + "example": 607 + }, + { + "section": "Disallowed Raw HTML", + "html": "

    <title> <style>

    \n
    \n <xmp> is disallowed. <XMP> is also disallowed.\n
    ", + "markdown": " <style> <em>\n\n<blockquote>\n <xmp> is disallowed. <XMP> is also disallowed.\n</blockquote>", + "example": 629 + } +] diff --git a/test/specs/marked/marked-spec.js b/test/specs/marked/marked-spec.js new file mode 100644 index 00000000..8bc52ec3 --- /dev/null +++ b/test/specs/marked/marked-spec.js @@ -0,0 +1,89 @@ +/** + * Marked does not have a custom markdown specification. However, there are times + * when we come across use cases that are not defined in a given specification. + * Therefore, we will put use cases together to illustrate those instances to + * consumers of marked. + * + */ +var marked = require('../../../lib/marked.js'); +var markedSpec = require('./marked.json'); +var HtmlDiffer = require('html-differ').HtmlDiffer, + htmlDiffer = new HtmlDiffer(); +var since = require('jasmine2-custom-message'); + +var Messenger = function() {} + +Messenger.prototype.message = function(spec, expected, actual) { + return 'CommonMark (' + spec.section + '):\n' + spec.markdown + '\n------\n\nExpected:\n' + expected + '\n------\n\nMarked:\n' + actual; +} + +Messenger.prototype.test = function(spec, section, ignore) { + if (spec.section === section) { + var shouldFail = ~ignore.indexOf(spec.example); + it('should ' + (shouldFail ? 'fail' : 'pass') + ' example ' + spec.example, function() { + var expected = spec.html; + var actual = marked(spec.markdown, { headerIds: false, xhtml: true }); + since(messenger.message(spec, expected, actual)).expect( + htmlDiffer.isEqual(expected, actual) + ).toEqual(!shouldFail); + }); + } +} + +var messenger = new Messenger(); + +describe('Marked Autolinks', function() { + var section = 'Autolinks'; + + var shouldPassButFails = []; + + var willNotBeAttemptedByCoreTeam = []; + + var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); + + markedSpec.forEach(function(spec) { + messenger.test(spec, section, ignore); + }); +}); + +describe('Marked Code spans', function() { + var section = 'Code spans'; + + var shouldPassButFails = [1]; + + var willNotBeAttemptedByCoreTeam = []; + + var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); + + markedSpec.forEach(function(spec) { + messenger.test(spec, section, ignore); + }); +}); + +describe('Marked Links', function() { + var section = 'Links'; + + var shouldPassButFails = []; + + var willNotBeAttemptedByCoreTeam = []; + + var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); + + markedSpec.forEach(function(spec) { + messenger.test(spec, section, ignore); + }); +}); + +describe('Marked Table cells', function() { + var section = 'Table cells'; + + var shouldPassButFails = []; + + var willNotBeAttemptedByCoreTeam = []; + + var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); + + markedSpec.forEach(function(spec) { + messenger.test(spec, section, ignore); + }); +}); diff --git a/test/specs/marked/marked.json b/test/specs/marked/marked.json new file mode 100644 index 00000000..1cb3a2a8 --- /dev/null +++ b/test/specs/marked/marked.json @@ -0,0 +1,80 @@ +[ + { + "section": "Autolinks", + "markdown": "(See https://www.example.com/fhqwhgads.)", + "html": "<p>(See <a href=\"https://www.example.com/fhqwhgads\">https://www.example.com/fhqwhgads</a>.)</p>", + "example": 10 + }, + { + "section": "Autolinks", + "markdown": "((http://foo.com))", + "html": "<p>((<a href=\"http://foo.com\">http://foo.com</a>))</p>", + "example": 11 + }, + { + "section": "Autolinks", + "markdown": "((http://foo.com.))", + "html": "<p>((<a href=\"http://foo.com\">http://foo.com</a>.))</p>", + "example": 12 + }, + { + "section": "Code spans", + "markdown": "`someone@example.com`", + "html": "<p><code>someone@example.com</code></p>", + "example": 1 + }, + { + "section": "Table cells", + "markdown": "|1|\n|-|\n|1|", + "html": "<table><thead><tr><th>1</th></tr></thead><tbody><tr><td>1</td></tr></tbody></table>", + "example": 2 + }, + { + "section": "Table cells", + "markdown": "|1|\n|-|\n|\\||", + "html": "<table><thead><tr><th>1</th></tr></thead><tbody><tr><td>|</td></tr></tbody></table>", + "example": 3 + }, + { + "section": "Table cells", + "markdown": "|1|\n|-|\n|1\\\\1|", + "html": "<table><thead><tr><th>1</th></tr></thead><tbody><tr><td>1\\1</td></tr></tbody></table>", + "example": 4 + }, + { + "section": "Table cells", + "markdown": "|1|\n|-|\n|\\\\\\\\||", + "html": "<table><thead><tr><th>1</th></tr></thead><tbody><tr><td>\\\\</td></tr></tbody></table>", + "example": 5 + }, + { + "section": "Table cells", + "markdown": "|1|\n|-|\n|\\\\\\\\\\||", + "html": "<table><thead><tr><th>1</th></tr></thead><tbody><tr><td>\\\\|</td></tr></tbody></table>", + "example": 6 + }, + { + "section": "Table cells", + "markdown": "|1|2|\n|-|-|\n||2|", + "html": "<table><thead><tr><th>1</th><th>2</th></tr></thead><tbody><tr><td></td><td>2</td></tr></tbody></table>", + "example": 7 + }, + { + "section": "Table cells", + "markdown": "|1|2|\n|-|-|\n|1\\|\\\\|2\\|\\\\|", + "html": "<table><thead><tr><th>1</th><th>2</th></tr></thead><tbody><tr><td>1|\\</td><td>2|\\</td></tr></tbody></table>", + "example": 8 + }, + { + "section": "Table cells", + "markdown": "|1|2|\n|-|-|\n| |2|", + "html": "<table><thead><tr><th>1</th><th>2</th></tr></thead><tbody><tr><td></td><td>2</td></tr></tbody></table>", + "example": 9 + }, + { + "section": "Links", + "markdown": "Link: [constructor][].\n\n[constructor]: https://example.org/", + "html": "<p>Link: <a href=\"https://example.org/\">constructor</a>.</p>", + "example": 10 + } +] diff --git a/test/specs/original/specs-spec.js b/test/specs/original/specs-spec.js new file mode 100644 index 00000000..2610b3bb --- /dev/null +++ b/test/specs/original/specs-spec.js @@ -0,0 +1,12 @@ +var specTests = require('../../'); + +it('should run spec tests', function () { + // hide output + spyOn(console, 'log'); + if (!specTests({stop: true})) { + // if tests fail rerun tests and show output + console.log.and.callThrough(); + specTests(); + fail(); + } +}); diff --git a/test/unit/marked-spec.js b/test/unit/marked-spec.js new file mode 100644 index 00000000..97789afe --- /dev/null +++ b/test/unit/marked-spec.js @@ -0,0 +1,27 @@ +var marked = require('../../lib/marked.js'); + +describe('Test heading ID functionality', function() { + it('should add id attribute by default', function() { + var renderer = new marked.Renderer(marked.defaults); + var header = renderer.heading('test', 1, 'test'); + expect(header).toBe('<h1 id="test">test</h1>\n'); + }); + + it('should NOT add id attribute when options set false', function() { + var renderer = new marked.Renderer({ headerIds: false }); + var header = renderer.heading('test', 1, 'test'); + expect(header).toBe('<h1>test</h1>\n'); + }); +}); + +describe('Test paragraph token type', function () { + it('should use the "paragraph" type on top level', function () { + const md = 'A Paragraph.\n\n> A blockquote\n\n- list item\n'; + + const tokens = marked.lexer(md); + + expect(tokens[0].type).toBe('paragraph'); + expect(tokens[3].type).toBe('paragraph'); + expect(tokens[7].type).toBe('text'); + }); +});