From 5f2f0874188ff1079e4c99641a55d391ec1ca043 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Sat, 9 Mar 2019 23:37:33 -0600 Subject: [PATCH 01/12] add run-spec --- test/specs/run-spec.js | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 test/specs/run-spec.js diff --git a/test/specs/run-spec.js b/test/specs/run-spec.js new file mode 100644 index 0000000000..809ae10ce2 --- /dev/null +++ b/test/specs/run-spec.js @@ -0,0 +1,32 @@ +function runSpecs(title, file, options) { + const json = require(file); + const specs = json.reduce((obj, spec) => { + if (!obj[spec.section]) { + obj[spec.section] = []; + } + obj[spec.section].push(spec); + return obj; + }, {}); + + describe(title, function() { + Object.keys(specs).forEach(section => { + describe(section, function() { + specs[section].forEach(function(spec) { + if (options) { + spec.options = Object.assign({}, options, (spec.options || {})); + } + (spec.only ? fit : it)('should ' + (spec.shouldFail ? 'fail' : 'pass') + ' example ' + spec.example, function() { + if (spec.shouldFail) { + expect(spec).not.toRender(spec.html); + } else { + expect(spec).toRender(spec.html); + } + }); + }); + }); + }); + }); +}; + +runSpecs('GFM 0.28', './gfm/gfm.0.28.json', {gfm: true}); +runSpecs('CommonMark 0.28', './commonmark/commonmark.0.28.json', {headerIds: false}); From b9d99af59d63543ea60e2abe2d98ef1e8e799616 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Sat, 9 Mar 2019 23:39:50 -0600 Subject: [PATCH 02/12] add toRender matcher --- test/helpers/helpers.js | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/test/helpers/helpers.js b/test/helpers/helpers.js index d9244a880b..25f0f4b63c 100644 --- a/test/helpers/helpers.js +++ b/test/helpers/helpers.js @@ -1,5 +1,42 @@ -var marked = require('../../lib/marked.js'); +const marked = require('../../'); +const HtmlDiffer = require('@markedjs/html-differ').HtmlDiffer; +const htmlDiffer = new HtmlDiffer({ignoreSelfClosingSlash: true}); beforeEach(function () { marked.setOptions(marked.getDefaults()); + + jasmine.addMatchers({ + toRender: function () { + return { + compare: function (spec, expected) { + const result = {}; + const actual = marked(spec.markdown, spec.options); + result.pass = htmlDiffer.isEqual(expected, actual); + + if (result.pass) { + result.message = spec.markdown + '\n------\n\nExpected: Should Fail'; + } else { + var expectedHtml = expected.replace(/\s/g, ''); + var actualHtml = actual.replace(/\s/g, ''); + + for (var i = 0; i < expectedHtml.length; i++) { + if (actualHtml[i] !== expectedHtml[i]) { + actualHtml = actualHtml.substring( + Math.max(i - 30, 0), + Math.min(i + 30, actualHtml.length)); + + expectedHtml = expectedHtml.substring( + Math.max(i - 30, 0), + Math.min(i + 30, expectedHtml.length)); + + break; + } + } + result.message = 'Expected:\n' + expectedHtml + '\n\nActual:\n' + actualHtml; + } + return result; + } + }; + } + }); }); From 973b00060106122f14118b00a52464dc9446ca4c Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Sat, 9 Mar 2019 23:40:59 -0600 Subject: [PATCH 03/12] move marked.json to /new files --- test/new/autolinks.html | 15 +++ test/new/autolinks.md | 15 +++ test/new/code_spans.html | 3 + test/new/code_spans.md | 3 + test/new/emphasis_extra tests.html | 1 + test/new/emphasis_extra tests.md | 1 + test/new/links.html | 8 +- test/new/links.md | 13 +-- test/new/sanitize_links.html | 5 + test/new/sanitize_links.md | 12 +++ test/new/table_cells.html | 27 +++++ test/new/table_cells.md | 55 +++++++++++ test/specs/marked/marked-spec.js | 103 ------------------- test/specs/marked/marked.json | 152 ----------------------------- 14 files changed, 143 insertions(+), 270 deletions(-) create mode 100644 test/new/autolinks.html create mode 100644 test/new/autolinks.md create mode 100644 test/new/code_spans.html create mode 100644 test/new/code_spans.md create mode 100644 test/new/emphasis_extra tests.html create mode 100644 test/new/emphasis_extra tests.md create mode 100644 test/new/sanitize_links.html create mode 100644 test/new/sanitize_links.md create mode 100644 test/new/table_cells.html create mode 100644 test/new/table_cells.md delete mode 100644 test/specs/marked/marked-spec.js delete mode 100644 test/specs/marked/marked.json diff --git a/test/new/autolinks.html b/test/new/autolinks.html new file mode 100644 index 0000000000..8fa4837e61 --- /dev/null +++ b/test/new/autolinks.html @@ -0,0 +1,15 @@ +

(See https://www.example.com/fhqwhgads.)

+ +

((http://foo.com))

+ +

((http://foo.com.))

+ +

HTTP://FOO.COM

+ +

hTtP://fOo.CoM

+ +

hello@email.com

+ +

me@example.com

+ +

test@test.com

\ No newline at end of file diff --git a/test/new/autolinks.md b/test/new/autolinks.md new file mode 100644 index 0000000000..1f5f739c49 --- /dev/null +++ b/test/new/autolinks.md @@ -0,0 +1,15 @@ +(See https://www.example.com/fhqwhgads.) + +((http://foo.com)) + +((http://foo.com.)) + +HTTP://FOO.COM + +hTtP://fOo.CoM + +~~hello@email.com~~ + +**me@example.com** + +__test@test.com__ \ No newline at end of file diff --git a/test/new/code_spans.html b/test/new/code_spans.html new file mode 100644 index 0000000000..ca220d8043 --- /dev/null +++ b/test/new/code_spans.html @@ -0,0 +1,3 @@ +

someone@example.com

+ +

``test`

\ No newline at end of file diff --git a/test/new/code_spans.md b/test/new/code_spans.md new file mode 100644 index 0000000000..845a116ae7 --- /dev/null +++ b/test/new/code_spans.md @@ -0,0 +1,3 @@ +`someone@example.com` + +``*test`* \ No newline at end of file diff --git a/test/new/emphasis_extra tests.html b/test/new/emphasis_extra tests.html new file mode 100644 index 0000000000..0e2609cdbd --- /dev/null +++ b/test/new/emphasis_extra tests.html @@ -0,0 +1 @@ +

test. test: test! test? test-

\ No newline at end of file diff --git a/test/new/emphasis_extra tests.md b/test/new/emphasis_extra tests.md new file mode 100644 index 0000000000..bf8afdc7d1 --- /dev/null +++ b/test/new/emphasis_extra tests.md @@ -0,0 +1 @@ +_test_. _test_: _test_! _test_? _test_- \ No newline at end of file diff --git a/test/new/links.html b/test/new/links.html index 092ea471a0..a6b0acd5b0 100644 --- a/test/new/links.html +++ b/test/new/links.html @@ -1,5 +1,3 @@ -

URL

-

URL

-

URL

-

URL

-

URL

+

Link: constructor.

+ +

One (Two) Three

diff --git a/test/new/links.md b/test/new/links.md index 1850be4e9f..2bbc098905 100644 --- a/test/new/links.md +++ b/test/new/links.md @@ -1,12 +1,5 @@ ---- -sanitize: true ---- -[URL](javascript:alert) +Link: [constructor][]. -[URL](vbscript:alert) +[One](https://example.com/1) ([Two](https://example.com/2)) [Three](https://example.com/3) -[URL](javascript:alert(1)) - -[URL](javascript:document;alert(1)) - -[URL](data:text/html;base64,PHNjcmlwdD5hbGVydCgnWFNTJyk8L3NjcmlwdD4K) +[constructor]: https://example.org diff --git a/test/new/sanitize_links.html b/test/new/sanitize_links.html new file mode 100644 index 0000000000..092ea471a0 --- /dev/null +++ b/test/new/sanitize_links.html @@ -0,0 +1,5 @@ +

URL

+

URL

+

URL

+

URL

+

URL

diff --git a/test/new/sanitize_links.md b/test/new/sanitize_links.md new file mode 100644 index 0000000000..1850be4e9f --- /dev/null +++ b/test/new/sanitize_links.md @@ -0,0 +1,12 @@ +--- +sanitize: true +--- +[URL](javascript:alert) + +[URL](vbscript:alert) + +[URL](javascript:alert(1)) + +[URL](javascript:document;alert(1)) + +[URL](data:text/html;base64,PHNjcmlwdD5hbGVydCgnWFNTJyk8L3NjcmlwdD4K) diff --git a/test/new/table_cells.html b/test/new/table_cells.html new file mode 100644 index 0000000000..83bbc45989 --- /dev/null +++ b/test/new/table_cells.html @@ -0,0 +1,27 @@ +
1
1
+ +
1
|
+ +
1
1\1
+ +
1
\\
+ +
1
\\|
+ +
12
2
+ +
12
1|\2|\
+ +
12
2
+ +
12
1|\\2|\\
+ +
12
2
+ +
12
12|
+ +
12
12|
+ +
12
12|
+ +
12
12|
diff --git a/test/new/table_cells.md b/test/new/table_cells.md new file mode 100644 index 0000000000..332298a692 --- /dev/null +++ b/test/new/table_cells.md @@ -0,0 +1,55 @@ +|1| +|-| +|1| + +|1| +|-| +|\|| + +|1| +|-| +|1\\1| + +|1| +|-| +|\\\\|| + +|1| +|-| +|\\\\\|| + +|1|2| +|-|-| +||2| + +|1|2| +|-|-| +|1\|\\|2\|\\| + +|1|2| +|-|-| +| |2| + +1|2 +-|- +1\|\\|2\|\\ + +1|2 +-|- + |2 + +1|2 +-|- +1|2\| + +1|2 +-|- +1|2\| + +|1|2| +|-|-| +|1|2\|| + +|1|2| +|-|-| +|1|2\|| diff --git a/test/specs/marked/marked-spec.js b/test/specs/marked/marked-spec.js deleted file mode 100644 index 0bc73a7846..0000000000 --- a/test/specs/marked/marked-spec.js +++ /dev/null @@ -1,103 +0,0 @@ -/** - * 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('@markedjs/html-differ').HtmlDiffer, - htmlDiffer = new HtmlDiffer({ignoreSelfClosingSlash: true}); -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 = []; - - 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); - }); -}); - -describe('Emphasis extra tests', function() { - var section = 'Emphasis extra tests'; - - 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 deleted file mode 100644 index 2569825c51..0000000000 --- a/test/specs/marked/marked.json +++ /dev/null @@ -1,152 +0,0 @@ -[ - { - "section": "Code spans", - "markdown": "`someone@example.com`", - "html": "

someone@example.com

", - "example": 1 - }, - { - "section": "Table cells", - "markdown": "|1|\n|-|\n|1|", - "html": "
1
1
", - "example": 2 - }, - { - "section": "Table cells", - "markdown": "|1|\n|-|\n|\\||", - "html": "
1
|
", - "example": 3 - }, - { - "section": "Table cells", - "markdown": "|1|\n|-|\n|1\\\\1|", - "html": "
1
1\\1
", - "example": 4 - }, - { - "section": "Table cells", - "markdown": "|1|\n|-|\n|\\\\\\\\||", - "html": "
1
\\\\
", - "example": 5 - }, - { - "section": "Table cells", - "markdown": "|1|\n|-|\n|\\\\\\\\\\||", - "html": "
1
\\\\|
", - "example": 6 - }, - { - "section": "Table cells", - "markdown": "|1|2|\n|-|-|\n||2|", - "html": "
12
2
", - "example": 7 - }, - { - "section": "Table cells", - "markdown": "|1|2|\n|-|-|\n|1\\|\\\\|2\\|\\\\|", - "html": "
12
1|\\2|\\
", - "example": 8 - }, - { - "section": "Table cells", - "markdown": "|1|2|\n|-|-|\n| |2|", - "html": "
12
2
", - "example": 9 - }, - { - "section": "Links", - "markdown": "Link: [constructor][].\n\n[constructor]: https://example.org/", - "html": "

Link: constructor.

", - "example": 10 - }, - { - "section": "Autolinks", - "markdown": "(See https://www.example.com/fhqwhgads.)", - "html": "

(See https://www.example.com/fhqwhgads.)

", - "example": 11 - }, - { - "section": "Autolinks", - "markdown": "((http://foo.com))", - "html": "

((http://foo.com))

", - "example": 12 - }, - { - "section": "Autolinks", - "markdown": "((http://foo.com.))", - "html": "

((http://foo.com.))

", - "example": 13 - }, - { - "section": "Code spans", - "markdown": "``*test`*", - "html": "

``test`

", - "example": 14 - }, - { - "section": "Autolinks", - "markdown": "HTTP://FOO.COM", - "html": "

HTTP://FOO.COM

", - "example": 17 - }, - { - "section": "Autolinks", - "markdown": "hTtP://fOo.CoM", - "html": "

hTtP://fOo.CoM

", - "example": 18 - }, - { - "section": "Autolinks", - "markdown": "~~hello@email.com~~", - "html": "

hello@email.com

", - "example": 1307 - }, - { - "section": "Autolinks", - "markdown": "**me@example.com**", - "html": "

me@example.com

", - "example": 1327 - }, - { - "section": "Autolinks", - "markdown": "__test@test.com__", - "html": "

test@test.com

", - "example": 1347 - }, - { - "section": "Emphasis extra tests", - "markdown": "_test_. _test_: _test_! _test_? _test_-", - "html": "

test. test: test! test? test-

", - "example": 15 - }, - { - "section": "Table cells", - "markdown": "1|2\n-|-\n1\\|\\\\|2\\|\\\\", - "html": "
12
1|\\2|\\
", - "example": 19 - }, - { - "section": "Table cells", - "markdown": "1|2\n-|-\n |2", - "html": "
12
2
", - "example": 20 - }, - { - "section": "Table cells", - "markdown": "1|2\n-|-\n1|2\\|\n\n1|2\n-|-\n1|2\\|", - "html": "
12
12|
\n\n
12
12|
", - "example": 21 - }, - { - "section": "Table cells", - "markdown": "|1|2|\n|-|-|\n|1|2\\||\n\n|1|2|\n|-|-|\n|1|2\\||", - "html": "
12
12|
\n\n
12
12|
", - "example": 22 - }, - { - "section": "Links", - "markdown": "[One](https://example.com/1) ([Two](https://example.com/2)) [Three](https://example.com/3)", - "html": "

One (Two) Three

", - "example": 16 - } -] From 895d3ea1ede9cd7f26868df081cff6c4b2ae01ea Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Sat, 9 Mar 2019 23:43:08 -0600 Subject: [PATCH 04/12] update gfm and commonmark tests --- test/specs/commonmark/commonmark-spec.js | 454 --------------------- test/specs/commonmark/commonmark.0.28.json | 362 ++++++++++------ test/specs/gfm/gfm-spec.js | 96 ----- test/specs/gfm/gfm.0.28.json | 6 +- 4 files changed, 245 insertions(+), 673 deletions(-) delete mode 100644 test/specs/commonmark/commonmark-spec.js delete mode 100644 test/specs/gfm/gfm-spec.js diff --git a/test/specs/commonmark/commonmark-spec.js b/test/specs/commonmark/commonmark-spec.js deleted file mode 100644 index ec270bb831..0000000000 --- a/test/specs/commonmark/commonmark-spec.js +++ /dev/null @@ -1,454 +0,0 @@ -var marked = require('../../../lib/marked.js'); -var cmSpec = require('./commonmark.0.28.json'); -var HtmlDiffer = require('@markedjs/html-differ').HtmlDiffer, - htmlDiffer = new HtmlDiffer({ignoreSelfClosingSlash: true}); -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(); -/* -|Section |Count |Percent | -|:---------------------------------------|:---------:|-------:| -|Tabs | 10 of 11 | 91%| -|Precedence | 1 of 1 | 100%| -|Thematic breaks | 19 of 19 | 100%| -|ATX headings | 14 of 18 | 78%| -|Setext headings | 21 of 26 | 81%| -|Indented code blocks | 12 of 12 | 100%| -|Fenced code blocks | 21 of 28 | 75%| -|HTML blocks | 43 of 43 | 100%| -|Link reference definitions | 22 of 23 | 96%| -|Paragraphs | 8 of 8 | 100%| -|Blank lines | 1 of 1 | 100%| -|Block quotes | 21 of 25 | 84%| -|List items | 32 of 48 | 67%| -|Lists | 12 of 24 | 50%| -|Inlines | 1 of 1 | 100%| -|Backslash escapes | 10 of 13 | 77%| -|Entity and numeric character references | 9 of 12 | 75%| -|Code spans | 11 of 17 | 65%| -|Emphasis and strong emphasis | 79 of 128 | 61%| -|Links | 69 of 84 | 82%| -|Images | 15 of 22 | 68%| -|Autolinks | 15 of 19 | 79%| -|Raw HTML | 19 of 21 | 90%| -|Hard line breaks | 15 of 15 | 100%| -|Soft line breaks | 2 of 2 | 100%| -|Textual content | 3 of 3 | 100%| -*/ - -describe('CommonMark 0.28 Tabs', function() { - var section = 'Tabs'; - - // These examples probably should pass but don't for some reason. - // This is the easiest way to demonstrate limitations or defects - // within Marked. Toggle comments for next two lines to see which examples - // are known failures. Note: If all arrays are empty, it means Marked is - // 100% compliant with that section of the given specification. - // - // var shouldPassButFails = []; - var shouldPassButFails = [7]; - - // Identifies examples that the Marked core team has determined beyond - // the ability or desire to correct; thereby, implicitly requesting - // outside help and assistance. - var willNotBeAttemptedByCoreTeam = []; - - // Combine known failures and skips. - var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); - - cmSpec.forEach(function(spec) { - // Run test. - messenger.test(spec, section, ignore); - }); -}); - -describe('CommonMark 0.28 Precedence', function() { - var section = 'Precedence'; - - // var shouldPassButFails = []; - var shouldPassButFails = []; - - var willNotBeAttemptedByCoreTeam = []; - - var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); - - cmSpec.forEach(function(spec) { - messenger.test(spec, section, ignore); - }); -}); - -describe('CommonMark 0.28 Thematic breaks', function() { - var section = 'Thematic breaks'; - - // var shouldPassButFails = []; - var shouldPassButFails = []; - - var willNotBeAttemptedByCoreTeam = []; - - var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); - - cmSpec.forEach(function(spec) { - messenger.test(spec, section, ignore); - }); -}); - -describe('CommonMark 0.28 ATX headings', function() { - var section = 'ATX headings'; - - // var shouldPassButFails = []; - var shouldPassButFails = [40, 45, 46, 49]; - - var willNotBeAttemptedByCoreTeam = []; - - var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); - - cmSpec.forEach(function(spec) { - messenger.test(spec, section, ignore); - }); -}); - -describe('CommonMark 0.28 Setext headings', function() { - var section = 'Setext headings'; - - // var shouldPassButFails = []; - var shouldPassButFails = [51, 52, 56, 62, 64]; - - var willNotBeAttemptedByCoreTeam = []; - - var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); - - cmSpec.forEach(function(spec) { - messenger.test(spec, section, ignore); - }); -}); - -describe('CommonMark 0.28 Indented code blocks', function() { - var section = 'Indented code blocks'; - - // var shouldPassButFails = []; - var shouldPassButFails = []; - - var willNotBeAttemptedByCoreTeam = []; - - var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); - - cmSpec.forEach(function(spec) { - messenger.test(spec, section, ignore); - }); -}); - -describe('CommonMark 0.28 Fenced code blocks', function() { - var section = 'Fenced code blocks'; - - var shouldPassButFails = []; - - var willNotBeAttemptedByCoreTeam = []; - - var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); - - cmSpec.forEach(function(spec) { - messenger.test(spec, section, ignore); - }); -}); - -describe('CommonMark 0.28 HTML blocks', function() { - var section = 'HTML blocks'; - - var shouldPassButFails = []; - - var willNotBeAttemptedByCoreTeam = []; - - var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); - - cmSpec.forEach(function(spec) { - messenger.test(spec, section, ignore); - }); -}); - -describe('CommonMark 0.28 Link reference definitions', function() { - var section = 'Link reference definitions'; - - // var shouldPassButFails = []; - var shouldPassButFails = [167]; - - var willNotBeAttemptedByCoreTeam = []; - - var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); - - cmSpec.forEach(function(spec) { - messenger.test(spec, section, ignore); - }); -}); - -describe('CommonMark 0.28 Paragraphs', function() { - var section = 'Paragraphs'; - - // var shouldPassButFails = []; - var shouldPassButFails = []; - - var willNotBeAttemptedByCoreTeam = []; - - var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); - - cmSpec.forEach(function(spec) { - messenger.test(spec, section, ignore); - }); -}); - -describe('CommonMark 0.28 Blank lines', function() { - var section = 'Blank lines'; - - // var shouldPassButFails = []; - var shouldPassButFails = []; - - var willNotBeAttemptedByCoreTeam = []; - - var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); - - cmSpec.forEach(function(spec) { - messenger.test(spec, section, ignore); - }); -}); - -describe('CommonMark 0.28 Block quotes', function() { - var section = 'Block quotes'; - - // var shouldPassButFails = []; - var shouldPassButFails = [198, 199, 200]; - - var willNotBeAttemptedByCoreTeam = []; - - var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); - - cmSpec.forEach(function(spec) { - messenger.test(spec, section, ignore); - }); -}); - -describe('CommonMark 0.28 List items', function() { - var section = 'List items'; - - // var shouldPassButFails = []; - var shouldPassButFails = [237, 236, 227, 218, 243, 259, 241, 239, 247, 225, 220, 258, 260]; - - var willNotBeAttemptedByCoreTeam = []; - - var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); - - cmSpec.forEach(function(spec) { - messenger.test(spec, section, ignore); - }); -}); - -describe('CommonMark 0.28 Lists', function() { - var section = 'Lists'; - - // var shouldPassButFails = []; - var shouldPassButFails = [282, 270, 280, 278, 273, 274, 264, 265, 279, 267, 269]; - - var willNotBeAttemptedByCoreTeam = []; - - var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); - - cmSpec.forEach(function(spec) { - messenger.test(spec, section, ignore); - }); -}); - -describe('CommonMark 0.28 Inlines', function() { - var section = 'Inlines'; - - // var shouldPassButFails = []; - var shouldPassButFails = []; - - var willNotBeAttemptedByCoreTeam = []; - - var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); - - cmSpec.forEach(function(spec) { - messenger.test(spec, section, ignore); - }); -}); - -describe('CommonMark 0.28 Backslash escapes', function() { - var section = 'Backslash escapes'; - - // var shouldPassButFails = []; - var shouldPassButFails = [300, 301]; - - var willNotBeAttemptedByCoreTeam = []; - - var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); - - cmSpec.forEach(function(spec) { - messenger.test(spec, section, ignore); - }); -}); - -describe('CommonMark 0.28 Entity and numeric character references', function() { - var section = 'Entity and numeric character references'; - - // var shouldPassButFails = []; - var shouldPassButFails = [311, 309, 310]; - - var willNotBeAttemptedByCoreTeam = []; - - var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); - - cmSpec.forEach(function(spec) { - messenger.test(spec, section, ignore); - }); -}); - -describe('CommonMark 0.28 Code spans', function() { - var section = 'Code spans'; - - var shouldPassButFails = [322, 323]; - - var willNotBeAttemptedByCoreTeam = []; - - var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); - - cmSpec.forEach(function(spec) { - messenger.test(spec, section, ignore); - }); -}); - -describe('CommonMark 0.28 Emphasis and strong emphasis', function() { - var section = 'Emphasis and strong emphasis'; - - // var shouldPassButFails = []; - var shouldPassButFails = [334, 342, 348, 349, 352, 353, 360, 368, 369, 371, 372, 378, 380, 381, 382, 387, 388, 392, 393, 394, 395, 396, 402, 403, 409, 419, 420, 421, 422, 423, 424, 431, 432, 433, 434, 435, 436, 443, 444, 445, 448, 449, 453, 454, 455, 457, 458]; - - var willNotBeAttemptedByCoreTeam = []; - - var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); - - cmSpec.forEach(function(spec) { - messenger.test(spec, section, ignore); - }); -}); - -describe('CommonMark 0.28 Links', function() { - var section = 'Links'; - - // var shouldPassButFails = []; - var shouldPassButFails = [474, 478, 483, 489, 490, 491, 495, 496, 497, 499, 503, 504, 507, 508, 509]; - - var willNotBeAttemptedByCoreTeam = []; - - var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); - - cmSpec.forEach(function(spec) { - messenger.test(spec, section, ignore); - }); -}); - -describe('CommonMark 0.28 Images', function() { - var section = 'Images'; - - // var shouldPassButFails = []; - var shouldPassButFails = [544, 545, 546, 547, 548, 556, 560]; - - var willNotBeAttemptedByCoreTeam = []; - - var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); - - cmSpec.forEach(function(spec) { - messenger.test(spec, section, ignore); - }); -}); - -describe('CommonMark 0.28 Autolinks', function() { - var section = 'Autolinks'; - - // var shouldPassButFails = []; - var shouldPassButFails = [582, 573, 579, 583]; - - var willNotBeAttemptedByCoreTeam = []; - - var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); - - cmSpec.forEach(function(spec) { - messenger.test(spec, section, ignore); - }); -}); - -describe('CommonMark 0.28 Raw HTML', function() { - var section = 'Raw HTML'; - - // var shouldPassButFails = []; - var shouldPassButFails = [597, 598]; - - var willNotBeAttemptedByCoreTeam = []; - - var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); - - cmSpec.forEach(function(spec) { - messenger.test(spec, section, ignore); - }); -}); - -describe('CommonMark 0.28 Hard line breaks', function() { - var section = 'Hard line breaks'; - - // var shouldPassButFails = []; - var shouldPassButFails = []; - - var willNotBeAttemptedByCoreTeam = []; - - var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); - - cmSpec.forEach(function(spec) { - messenger.test(spec, section, ignore); - }); -}); - -describe('CommonMark 0.28 Soft line breaks', function() { - var section = 'Soft line breaks'; - - // var shouldPassButFails = []; - var shouldPassButFails = []; - - var willNotBeAttemptedByCoreTeam = []; - - var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); - - cmSpec.forEach(function(spec) { - messenger.test(spec, section, ignore); - }); -}); - -describe('CommonMark 0.28 Textual content', function() { - var section = 'Textual content'; - - // var shouldPassButFails = []; - var shouldPassButFails = []; - - var willNotBeAttemptedByCoreTeam = []; - - var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); - - cmSpec.forEach(function(spec) { - messenger.test(spec, section, ignore); - }); -}); diff --git a/test/specs/commonmark/commonmark.0.28.json b/test/specs/commonmark/commonmark.0.28.json index ec9a9fe15b..5b5001cd79 100644 --- a/test/specs/commonmark/commonmark.0.28.json +++ b/test/specs/commonmark/commonmark.0.28.json @@ -53,7 +53,8 @@ "html": "
    \n
  • \n
      foo\n
    \n
  • \n
\n", "markdown": "-\t\tfoo\n", "example": 7, - "start_line": 422 + "start_line": 422, + "shouldFail": true }, { "end_line": 441, @@ -317,7 +318,8 @@ "html": "

foo\n# bar

\n", "markdown": "foo\n # bar\n", "example": 40, - "start_line": 860 + "start_line": 860, + "shouldFail": true }, { "end_line": 877, @@ -357,7 +359,8 @@ "html": "

foo#

\n", "markdown": "# foo#\n", "example": 45, - "start_line": 913 + "start_line": 913, + "shouldFail": true }, { "end_line": 931, @@ -365,7 +368,8 @@ "html": "

foo ###

\n

foo ###

\n

foo #

\n", "markdown": "### foo \\###\n## foo #\\##\n# foo \\#\n", "example": 46, - "start_line": 923 + "start_line": 923, + "shouldFail": true }, { "end_line": 945, @@ -389,7 +393,8 @@ "html": "

\n

\n

\n", "markdown": "## \n#\n### ###\n", "example": 49, - "start_line": 961 + "start_line": 961, + "shouldFail": true }, { "end_line": 1013, @@ -405,7 +410,8 @@ "html": "

Foo bar\nbaz

\n", "markdown": "Foo *bar\nbaz*\n====\n", "example": 51, - "start_line": 1018 + "start_line": 1018, + "shouldFail": true }, { "end_line": 1039, @@ -413,7 +419,8 @@ "html": "

Foo

\n

Foo

\n", "markdown": "Foo\n-------------------------\n\nFoo\n=\n", "example": 52, - "start_line": 1030 + "start_line": 1030, + "shouldFail": true }, { "end_line": 1058, @@ -445,7 +452,8 @@ "html": "

Foo\n---

\n", "markdown": "Foo\n ---\n", "example": 56, - "start_line": 1092 + "start_line": 1092, + "shouldFail": true }, { "end_line": 1114, @@ -493,7 +501,8 @@ "html": "
\n

foo\nbar\n===

\n
\n", "markdown": "> foo\nbar\n===\n", "example": 62, - "start_line": 1170 + "start_line": 1170, + "shouldFail": true }, { "end_line": 1191, @@ -509,7 +518,8 @@ "html": "

Foo\nBar

\n", "markdown": "Foo\nBar\n---\n", "example": 64, - "start_line": 1198 + "start_line": 1198, + "shouldFail": true }, { "end_line": 1223, @@ -1333,7 +1343,8 @@ "html": "

foo

\n", "markdown": "[foo]: /url\\bar\\*baz \"foo\\\"bar\\baz\"\n\n[foo]\n", "example": 167, - "start_line": 2884 + "start_line": 2884, + "shouldFail": true }, { "end_line": 2901, @@ -1581,7 +1592,8 @@ "html": "
\n
    \n
  • foo
  • \n
\n
\n
    \n
  • bar
  • \n
\n", "markdown": "> - foo\n- bar\n", "example": 198, - "start_line": 3378 + "start_line": 3378, + "shouldFail": true }, { "end_line": 3406, @@ -1589,7 +1601,8 @@ "html": "
\n
foo\n
\n
\n
bar\n
\n", "markdown": "> foo\n bar\n", "example": 199, - "start_line": 3396 + "start_line": 3396, + "shouldFail": true }, { "end_line": 3419, @@ -1597,7 +1610,8 @@ "html": "
\n
\n
\n

foo

\n
\n", "markdown": "> ```\nfoo\n```\n", "example": 200, - "start_line": 3409 + "start_line": 3409, + "shouldFail": true }, { "end_line": 3433, @@ -1741,7 +1755,8 @@ "html": "
    \n
  • one
  • \n
\n

two

\n", "markdown": "- one\n\n two\n", "example": 218, - "start_line": 3749 + "start_line": 3749, + "shouldFail": true }, { "end_line": 3772, @@ -1757,7 +1772,8 @@ "html": "
    \n
  • one
  • \n
\n
 two\n
\n", "markdown": " - one\n\n two\n", "example": 220, - "start_line": 3775 + "start_line": 3775, + "shouldFail": true }, { "end_line": 3799, @@ -1797,7 +1813,8 @@ "html": "
    \n
  • \n

    foo

    \n

    bar

    \n
  • \n
\n", "markdown": "- foo\n\n\n bar\n", "example": 225, - "start_line": 3869 + "start_line": 3869, + "shouldFail": true }, { "end_line": 3908, @@ -1813,7 +1830,8 @@ "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 + "start_line": 3914, + "shouldFail": true }, { "end_line": 3942, @@ -1885,7 +1903,8 @@ "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 + "start_line": 4049, + "shouldFail": true }, { "end_line": 4087, @@ -1893,7 +1912,8 @@ "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 + "start_line": 4071, + "shouldFail": true }, { "end_line": 4105, @@ -1909,7 +1929,8 @@ "html": "
    \n
  • foo
  • \n
\n

bar

\n", "markdown": "- foo\n\n bar\n", "example": 239, - "start_line": 4108 + "start_line": 4108, + "shouldFail": true }, { "end_line": 4136, @@ -1925,7 +1946,8 @@ "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 + "start_line": 4153, + "shouldFail": true }, { "end_line": 4186, @@ -1941,7 +1963,8 @@ "html": "
    \n
  • \n
\n

foo

\n", "markdown": "-\n\n foo\n", "example": 243, - "start_line": 4193 + "start_line": 4193, + "shouldFail": true }, { "end_line": 4217, @@ -1973,7 +1996,8 @@ "html": "
    \n
  • \n
\n", "markdown": "*\n", "example": 247, - "start_line": 4252 + "start_line": 4252, + "shouldFail": true }, { "end_line": 4273, @@ -2061,7 +2085,8 @@ "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 + "start_line": 4493, + "shouldFail": true }, { "end_line": 4521, @@ -2069,7 +2094,8 @@ "html": "
    \n
  1. foo\n
      \n
    • bar
    • \n
    \n
  2. \n
\n", "markdown": "10) foo\n - bar\n", "example": 259, - "start_line": 4510 + "start_line": 4510, + "shouldFail": true }, { "end_line": 4536, @@ -2077,7 +2103,8 @@ "html": "
    \n
  1. foo
  2. \n
\n
    \n
  • bar
  • \n
\n", "markdown": "10) foo\n - bar\n", "example": 260, - "start_line": 4526 + "start_line": 4526, + "shouldFail": true }, { "end_line": 4551, @@ -2109,7 +2136,8 @@ "html": "
    \n
  • foo
  • \n
  • bar
  • \n
\n
    \n
  • baz
  • \n
\n", "markdown": "- foo\n- bar\n+ baz\n", "example": 264, - "start_line": 4809 + "start_line": 4809, + "shouldFail": true }, { "end_line": 4836, @@ -2117,7 +2145,8 @@ "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 + "start_line": 4824, + "shouldFail": true }, { "end_line": 4853, @@ -2133,7 +2162,8 @@ "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 + "start_line": 4920, + "shouldFail": true }, { "end_line": 4938, @@ -2149,7 +2179,8 @@ "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 + "start_line": 4944, + "shouldFail": true }, { "end_line": 4987, @@ -2157,7 +2188,8 @@ "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 + "start_line": 4965, + "shouldFail": true }, { "end_line": 5013, @@ -2181,7 +2213,8 @@ "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 + "start_line": 5047, + "shouldFail": true }, { "end_line": 5090, @@ -2189,7 +2222,8 @@ "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 + "start_line": 5072, + "shouldFail": true }, { "end_line": 5113, @@ -2221,7 +2255,8 @@ "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 + "start_line": 5162, + "shouldFail": true }, { "end_line": 5204, @@ -2229,7 +2264,8 @@ "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 + "start_line": 5185, + "shouldFail": true }, { "end_line": 5229, @@ -2237,7 +2273,8 @@ "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 + "start_line": 5211, + "shouldFail": true }, { "end_line": 5249, @@ -2253,7 +2290,8 @@ "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 + "start_line": 5255, + "shouldFail": true }, { "end_line": 5284, @@ -2397,7 +2435,8 @@ "html": "

foo

\n", "markdown": "[foo]\n\n[foo]: /bar\\* \"ti\\*tle\"\n", "example": 300, - "start_line": 5502 + "start_line": 5502, + "shouldFail": true }, { "end_line": 5518, @@ -2405,7 +2444,8 @@ "html": "
foo\n
\n", "markdown": "``` foo\\+bar\nfoo\n```\n", "example": 301, - "start_line": 5511 + "start_line": 5511, + "shouldFail": true }, { "end_line": 5546, @@ -2469,7 +2509,8 @@ "html": "

foo

\n", "markdown": "[foo](/föö \"föö\")\n", "example": 309, - "start_line": 5620 + "start_line": 5620, + "shouldFail": true }, { "end_line": 5633, @@ -2477,7 +2518,8 @@ "html": "

foo

\n", "markdown": "[foo]\n\n[foo]: /föö \"föö\"\n", "example": 310, - "start_line": 5627 + "start_line": 5627, + "shouldFail": true }, { "end_line": 5643, @@ -2485,7 +2527,8 @@ "html": "
foo\n
\n", "markdown": "``` föö\nfoo\n```\n", "example": 311, - "start_line": 5636 + "start_line": 5636, + "shouldFail": true }, { "end_line": 5653, @@ -2573,7 +2616,8 @@ "html": "

*foo*

\n", "markdown": "*foo`*`\n", "example": 322, - "start_line": 5776 + "start_line": 5776, + "shouldFail": true }, { "end_line": 5789, @@ -2581,7 +2625,8 @@ "html": "

[not a link](/foo)

\n", "markdown": "[not a `link](/foo`)\n", "example": 323, - "start_line": 5785 + "start_line": 5785, + "shouldFail": true }, { "end_line": 5799, @@ -2669,7 +2714,8 @@ "html": "

* a *

\n", "markdown": "* a *\n", "example": 334, - "start_line": 6091 + "start_line": 6091, + "shouldFail": true }, { "end_line": 6104, @@ -2733,7 +2779,8 @@ "html": "

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

\n", "markdown": "пристаням_стремятся_\n", "example": 342, - "start_line": 6159 + "start_line": 6159, + "shouldFail": true }, { "end_line": 6173, @@ -2781,7 +2828,8 @@ "html": "

*(*foo)

\n", "markdown": "*(*foo)\n", "example": 348, - "start_line": 6224 + "start_line": 6224, + "shouldFail": true }, { "end_line": 6238, @@ -2789,7 +2837,8 @@ "html": "

(foo)

\n", "markdown": "*(*foo*)*\n", "example": 349, - "start_line": 6234 + "start_line": 6234, + "shouldFail": true }, { "end_line": 6247, @@ -2813,7 +2862,8 @@ "html": "

_(_foo)

\n", "markdown": "_(_foo)\n", "example": 352, - "start_line": 6266 + "start_line": 6266, + "shouldFail": true }, { "end_line": 6279, @@ -2821,7 +2871,8 @@ "html": "

(foo)

\n", "markdown": "_(_foo_)_\n", "example": 353, - "start_line": 6275 + "start_line": 6275, + "shouldFail": true }, { "end_line": 6288, @@ -2877,7 +2928,8 @@ "html": "

a**"foo"**

\n", "markdown": "a**\"foo\"**\n", "example": 360, - "start_line": 6339 + "start_line": 6339, + "shouldFail": true }, { "end_line": 6352, @@ -2941,7 +2993,8 @@ "html": "

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

\n", "markdown": "пристаням__стремятся__\n", "example": 368, - "start_line": 6410 + "start_line": 6410, + "shouldFail": true }, { "end_line": 6421, @@ -2949,7 +3002,8 @@ "html": "

foo, bar, baz

\n", "markdown": "__foo, __bar__, baz__\n", "example": 369, - "start_line": 6417 + "start_line": 6417, + "shouldFail": true }, { "end_line": 6432, @@ -2965,7 +3019,8 @@ "html": "

**foo bar **

\n", "markdown": "**foo bar **\n", "example": 371, - "start_line": 6441 + "start_line": 6441, + "shouldFail": true }, { "end_line": 6458, @@ -2973,7 +3028,8 @@ "html": "

**(**foo)

\n", "markdown": "**(**foo)\n", "example": 372, - "start_line": 6454 + "start_line": 6454, + "shouldFail": true }, { "end_line": 6468, @@ -3021,7 +3077,8 @@ "html": "

__(__foo)

\n", "markdown": "__(__foo)\n", "example": 378, - "start_line": 6511 + "start_line": 6511, + "shouldFail": true }, { "end_line": 6525, @@ -3037,7 +3094,8 @@ "html": "

__foo__bar

\n", "markdown": "__foo__bar\n", "example": 380, - "start_line": 6530 + "start_line": 6530, + "shouldFail": true }, { "end_line": 6541, @@ -3045,7 +3103,8 @@ "html": "

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

\n", "markdown": "__пристаням__стремятся\n", "example": 381, - "start_line": 6537 + "start_line": 6537, + "shouldFail": true }, { "end_line": 6548, @@ -3053,7 +3112,8 @@ "html": "

foo__bar__baz

\n", "markdown": "__foo__bar__baz__\n", "example": 382, - "start_line": 6544 + "start_line": 6544, + "shouldFail": true }, { "end_line": 6559, @@ -3093,7 +3153,8 @@ "html": "

foo bar baz

\n", "markdown": "_foo _bar_ baz_\n", "example": 387, - "start_line": 6593 + "start_line": 6593, + "shouldFail": true }, { "end_line": 6604, @@ -3101,7 +3162,8 @@ "html": "

foo bar

\n", "markdown": "__foo_ bar_\n", "example": 388, - "start_line": 6600 + "start_line": 6600, + "shouldFail": true }, { "end_line": 6611, @@ -3133,7 +3195,8 @@ "html": "

foo bar

\n", "markdown": "***foo** bar*\n", "example": 392, - "start_line": 6645 + "start_line": 6645, + "shouldFail": true }, { "end_line": 6656, @@ -3141,7 +3204,8 @@ "html": "

foo bar

\n", "markdown": "*foo **bar***\n", "example": 393, - "start_line": 6652 + "start_line": 6652, + "shouldFail": true }, { "end_line": 6663, @@ -3149,7 +3213,8 @@ "html": "

foobar

\n", "markdown": "*foo**bar***\n", "example": 394, - "start_line": 6659 + "start_line": 6659, + "shouldFail": true }, { "end_line": 6672, @@ -3157,7 +3222,8 @@ "html": "

foo bar baz bim bop

\n", "markdown": "*foo **bar *baz* bim** bop*\n", "example": 395, - "start_line": 6668 + "start_line": 6668, + "shouldFail": true }, { "end_line": 6679, @@ -3165,7 +3231,8 @@ "html": "

foo bar

\n", "markdown": "*foo [*bar*](/url)*\n", "example": 396, - "start_line": 6675 + "start_line": 6675, + "shouldFail": true }, { "end_line": 6688, @@ -3213,7 +3280,8 @@ "html": "

foo bar baz

\n", "markdown": "__foo __bar__ baz__\n", "example": 402, - "start_line": 6730 + "start_line": 6730, + "shouldFail": true }, { "end_line": 6741, @@ -3221,7 +3289,8 @@ "html": "

foo bar

\n", "markdown": "____foo__ bar__\n", "example": 403, - "start_line": 6737 + "start_line": 6737, + "shouldFail": true }, { "end_line": 6748, @@ -3269,7 +3338,8 @@ "html": "

foo bar baz\nbim bop

\n", "markdown": "**foo *bar **baz**\nbim* bop**\n", "example": 409, - "start_line": 6781 + "start_line": 6781, + "shouldFail": true }, { "end_line": 6794, @@ -3349,7 +3419,8 @@ "html": "

*foo

\n", "markdown": "**foo*\n", "example": 419, - "start_line": 6862 + "start_line": 6862, + "shouldFail": true }, { "end_line": 6873, @@ -3357,7 +3428,8 @@ "html": "

foo*

\n", "markdown": "*foo**\n", "example": 420, - "start_line": 6869 + "start_line": 6869, + "shouldFail": true }, { "end_line": 6880, @@ -3365,7 +3437,8 @@ "html": "

*foo

\n", "markdown": "***foo**\n", "example": 421, - "start_line": 6876 + "start_line": 6876, + "shouldFail": true }, { "end_line": 6887, @@ -3373,7 +3446,8 @@ "html": "

***foo

\n", "markdown": "****foo*\n", "example": 422, - "start_line": 6883 + "start_line": 6883, + "shouldFail": true }, { "end_line": 6894, @@ -3381,7 +3455,8 @@ "html": "

foo*

\n", "markdown": "**foo***\n", "example": 423, - "start_line": 6890 + "start_line": 6890, + "shouldFail": true }, { "end_line": 6901, @@ -3389,7 +3464,8 @@ "html": "

foo***

\n", "markdown": "*foo****\n", "example": 424, - "start_line": 6897 + "start_line": 6897, + "shouldFail": true }, { "end_line": 6911, @@ -3445,7 +3521,8 @@ "html": "

_foo

\n", "markdown": "__foo_\n", "example": 431, - "start_line": 6949 + "start_line": 6949, + "shouldFail": true }, { "end_line": 6964, @@ -3453,7 +3530,8 @@ "html": "

foo_

\n", "markdown": "_foo__\n", "example": 432, - "start_line": 6960 + "start_line": 6960, + "shouldFail": true }, { "end_line": 6971, @@ -3461,7 +3539,8 @@ "html": "

_foo

\n", "markdown": "___foo__\n", "example": 433, - "start_line": 6967 + "start_line": 6967, + "shouldFail": true }, { "end_line": 6978, @@ -3469,7 +3548,8 @@ "html": "

___foo

\n", "markdown": "____foo_\n", "example": 434, - "start_line": 6974 + "start_line": 6974, + "shouldFail": true }, { "end_line": 6985, @@ -3477,7 +3557,8 @@ "html": "

foo_

\n", "markdown": "__foo___\n", "example": 435, - "start_line": 6981 + "start_line": 6981, + "shouldFail": true }, { "end_line": 6992, @@ -3485,7 +3566,8 @@ "html": "

foo___

\n", "markdown": "_foo____\n", "example": 436, - "start_line": 6988 + "start_line": 6988, + "shouldFail": true }, { "end_line": 7002, @@ -3541,7 +3623,8 @@ "html": "

foo

\n", "markdown": "******foo******\n", "example": 443, - "start_line": 7047 + "start_line": 7047, + "shouldFail": true }, { "end_line": 7060, @@ -3549,7 +3632,8 @@ "html": "

foo

\n", "markdown": "***foo***\n", "example": 444, - "start_line": 7056 + "start_line": 7056, + "shouldFail": true }, { "end_line": 7067, @@ -3557,7 +3641,8 @@ "html": "

foo

\n", "markdown": "_____foo_____\n", "example": 445, - "start_line": 7063 + "start_line": 7063, + "shouldFail": true }, { "end_line": 7076, @@ -3581,7 +3666,8 @@ "html": "

**foo bar baz

\n", "markdown": "**foo **bar baz**\n", "example": 448, - "start_line": 7088 + "start_line": 7088, + "shouldFail": true }, { "end_line": 7099, @@ -3589,7 +3675,8 @@ "html": "

*foo bar baz

\n", "markdown": "*foo *bar baz*\n", "example": 449, - "start_line": 7095 + "start_line": 7095, + "shouldFail": true }, { "end_line": 7108, @@ -3621,7 +3708,8 @@ "html": "

**

\n", "markdown": "**\n", "example": 453, - "start_line": 7125 + "start_line": 7125, + "shouldFail": true }, { "end_line": 7136, @@ -3629,7 +3717,8 @@ "html": "

__

\n", "markdown": "__\n", "example": 454, - "start_line": 7132 + "start_line": 7132, + "shouldFail": true }, { "end_line": 7143, @@ -3637,7 +3726,8 @@ "html": "

a *

\n", "markdown": "*a `*`*\n", "example": 455, - "start_line": 7139 + "start_line": 7139, + "shouldFail": true }, { "end_line": 7150, @@ -3653,7 +3743,8 @@ "html": "

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

\n", "markdown": "**a\n", "example": 457, - "start_line": 7153 + "start_line": 7153, + "shouldFail": true }, { "end_line": 7164, @@ -3661,7 +3752,8 @@ "html": "

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

\n", "markdown": "__a\n", "example": 458, - "start_line": 7160 + "start_line": 7160, + "shouldFail": true }, { "end_line": 7245, @@ -3789,7 +3881,8 @@ "html": "

link

\n", "markdown": "[link](foo%20bä)\n", "example": 474, - "start_line": 7385 + "start_line": 7385, + "shouldFail": true }, { "end_line": 7400, @@ -3821,7 +3914,8 @@ "html": "

link

\n", "markdown": "[link](/url \"title\")\n", "example": 478, - "start_line": 7429 + "start_line": 7429, + "shouldFail": true }, { "end_line": 7442, @@ -3861,7 +3955,8 @@ "html": "

link [foo [bar]]

\n", "markdown": "[link [foo [bar]]](/uri)\n", "example": 483, - "start_line": 7492 + "start_line": 7492, + "shouldFail": true }, { "end_line": 7503, @@ -3909,7 +4004,8 @@ "html": "

[foo bar](/uri)

\n", "markdown": "[foo [bar](/uri)](/uri)\n", "example": 489, - "start_line": 7538 + "start_line": 7538, + "shouldFail": true }, { "end_line": 7549, @@ -3917,7 +4013,8 @@ "html": "

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

\n", "markdown": "[foo *[bar [baz](/uri)](/uri)*](/uri)\n", "example": 490, - "start_line": 7545 + "start_line": 7545, + "shouldFail": true }, { "end_line": 7556, @@ -3925,7 +4022,8 @@ "html": "

\"[foo](uri2)\"

\n", "markdown": "![[[foo](uri1)](uri2)](uri3)\n", "example": 491, - "start_line": 7552 + "start_line": 7552, + "shouldFail": true }, { "end_line": 7566, @@ -3957,7 +4055,8 @@ "html": "

[foo

\n", "markdown": "[foo \n", "example": 495, - "start_line": 7589 + "start_line": 7589, + "shouldFail": true }, { "end_line": 7600, @@ -3965,7 +4064,8 @@ "html": "

[foo](/uri)

\n", "markdown": "[foo`](/uri)`\n", "example": 496, - "start_line": 7596 + "start_line": 7596, + "shouldFail": true }, { "end_line": 7607, @@ -3973,7 +4073,8 @@ "html": "

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

\n", "markdown": "[foo\n", "example": 497, - "start_line": 7603 + "start_line": 7603, + "shouldFail": true }, { "end_line": 7647, @@ -3989,7 +4090,8 @@ "html": "

link [foo [bar]]

\n", "markdown": "[link [foo [bar]]][ref]\n\n[ref]: /uri\n", "example": 499, - "start_line": 7656 + "start_line": 7656, + "shouldFail": true }, { "end_line": 7671, @@ -4021,7 +4123,8 @@ "html": "

[foo bar]ref

\n", "markdown": "[foo [bar](/uri)][ref]\n\n[ref]: /uri\n", "example": 503, - "start_line": 7696 + "start_line": 7696, + "shouldFail": true }, { "end_line": 7711, @@ -4029,7 +4132,8 @@ "html": "

[foo bar baz]ref

\n", "markdown": "[foo *bar [baz][ref]*][ref]\n\n[ref]: /uri\n", "example": 504, - "start_line": 7705 + "start_line": 7705, + "shouldFail": true }, { "end_line": 7726, @@ -4053,7 +4157,8 @@ "html": "

[foo

\n", "markdown": "[foo \n\n[ref]: /uri\n", "example": 507, - "start_line": 7741 + "start_line": 7741, + "shouldFail": true }, { "end_line": 7756, @@ -4061,7 +4166,8 @@ "html": "

[foo][ref]

\n", "markdown": "[foo`][ref]`\n\n[ref]: /uri\n", "example": 508, - "start_line": 7750 + "start_line": 7750, + "shouldFail": true }, { "end_line": 7765, @@ -4069,7 +4175,8 @@ "html": "

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

\n", "markdown": "[foo\n\n[ref]: /uri\n", "example": 509, - "start_line": 7759 + "start_line": 7759, + "shouldFail": true }, { "end_line": 7776, @@ -4349,7 +4456,8 @@ "html": "

\"foo

\n", "markdown": "![foo *bar*]\n\n[foo *bar*]: train.jpg \"train & tracks\"\n", "example": 544, - "start_line": 8199 + "start_line": 8199, + "shouldFail": true }, { "end_line": 8212, @@ -4357,7 +4465,8 @@ "html": "

\"foo

\n", "markdown": "![foo ![bar](/url)](/url2)\n", "example": 545, - "start_line": 8208 + "start_line": 8208, + "shouldFail": true }, { "end_line": 8219, @@ -4365,7 +4474,8 @@ "html": "

\"foo

\n", "markdown": "![foo [bar](/url)](/url2)\n", "example": 546, - "start_line": 8215 + "start_line": 8215, + "shouldFail": true }, { "end_line": 8235, @@ -4373,7 +4483,8 @@ "html": "

\"foo

\n", "markdown": "![foo *bar*][]\n\n[foo *bar*]: train.jpg \"train & tracks\"\n", "example": 547, - "start_line": 8229 + "start_line": 8229, + "shouldFail": true }, { "end_line": 8244, @@ -4381,7 +4492,8 @@ "html": "

\"foo

\n", "markdown": "![foo *bar*][foobar]\n\n[FOOBAR]: train.jpg \"train & tracks\"\n", "example": 548, - "start_line": 8238 + "start_line": 8238, + "shouldFail": true }, { "end_line": 8251, @@ -4445,7 +4557,8 @@ "html": "

\"foo

\n", "markdown": "![*foo* bar][]\n\n[*foo* bar]: /url \"title\"\n", "example": 556, - "start_line": 8306 + "start_line": 8306, + "shouldFail": true }, { "end_line": 8323, @@ -4477,7 +4590,8 @@ "html": "

\"foo

\n", "markdown": "![*foo* bar]\n\n[*foo* bar]: /url \"title\"\n", "example": 560, - "start_line": 8351 + "start_line": 8351, + "shouldFail": true }, { "end_line": 8369, @@ -4581,7 +4695,8 @@ "html": "

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

\n", "markdown": "\n", "example": 573, - "start_line": 8496 + "start_line": 8496, + "shouldFail": true }, { "end_line": 8509, @@ -4629,7 +4744,8 @@ "html": "

< http://foo.bar >

\n", "markdown": "< http://foo.bar >\n", "example": 579, - "start_line": 8559 + "start_line": 8559, + "shouldFail": true }, { "end_line": 8570, @@ -4653,7 +4769,8 @@ "html": "

http://example.com

\n", "markdown": "http://example.com\n", "example": 582, - "start_line": 8580 + "start_line": 8580, + "shouldFail": true }, { "end_line": 8591, @@ -4661,7 +4778,8 @@ "html": "

foo@bar.example.com

\n", "markdown": "foo@bar.example.com\n", "example": 583, - "start_line": 8587 + "start_line": 8587, + "shouldFail": true }, { "end_line": 8673, @@ -4773,7 +4891,8 @@ "html": "

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

\n", "markdown": "foo \n", "example": 597, - "start_line": 8792 + "start_line": 8792, + "shouldFail": true }, { "end_line": 8808, @@ -4781,7 +4900,8 @@ "html": "

foo <!--> foo -->

\n

foo <!-- foo--->

\n", "markdown": "foo foo -->\n\nfoo \n", "example": 598, - "start_line": 8801 + "start_line": 8801, + "shouldFail": true }, { "end_line": 8817, @@ -4991,4 +5111,4 @@ "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 deleted file mode 100644 index 83340db0fa..0000000000 --- a/test/specs/gfm/gfm-spec.js +++ /dev/null @@ -1,96 +0,0 @@ -var marked = require('../../../lib/marked.js'); -var gfmSpec = require('./gfm.0.28.json'); -var HtmlDiffer = require('@markedjs/html-differ').HtmlDiffer, - htmlDiffer = new HtmlDiffer({ignoreSelfClosingSlash: true}); -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 index d045f8af62..f9c28eb2ab 100644 --- a/test/specs/gfm/gfm.0.28.json +++ b/test/specs/gfm/gfm.0.28.json @@ -141,12 +141,14 @@ "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 + "example": 607, + "shouldFail": true }, { "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 + "example": 629, + "shouldFail": true } ] From 6e84f7ac6459e541cd38501bf89d12c04fb8d03f Mon Sep 17 00:00:00 2001 From: Tony Brix <tony@brix.ninja> Date: Sat, 9 Mar 2019 23:53:53 -0600 Subject: [PATCH 05/12] add json-to-file.js --- test/json-to-files.js | 62 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 test/json-to-files.js diff --git a/test/json-to-files.js b/test/json-to-files.js new file mode 100644 index 0000000000..d7e72aafe0 --- /dev/null +++ b/test/json-to-files.js @@ -0,0 +1,62 @@ +const path = require('path'); +const fs = require('fs'); + +const folder = process.argv[2]; +const jsonFile = process.argv[3]; + +if (!folder || !jsonFile) { + console.log('node ./json-to-files.js {path to folder} {path to json file}'); + process.exit(1); +} + +const specs = require(jsonFile); + +const files = specs.reduce((obj, spec) => { + if (!obj[spec.section]) { + obj[spec.section] = { + md: [], + html: [], + options: {} + }; + } + + obj[spec.section].md.push(spec.markdown); + obj[spec.section].html.push(spec.html); + Object.assign(obj[spec.section].options, spec.options); + + return obj; +}, {}); + +try { + fs.mkdirSync(folder, {recursive: true}); +} catch (ex) { + // already exists +} + +for (const section in files) { + const file = files[section]; + const name = section.toLowerCase().replace(' ', '_'); + const frontMatter = Object.keys(file.options).map(opt => { + let value = file.options[opt]; + if (typeof value !== 'string') { + value = JSON.stringify(value); + } + return `${opt}: ${value}`; + }).join('\n'); + + let markdown = file.md.join('\n\n'); + if (frontMatter) { + markdown = `---\n${frontMatter}\n---\n\n${markdown}`; + } + const html = file.html.join('\n\n'); + + const mdFile = path.resolve(folder, `${name}.md`); + const htmlFile = path.resolve(folder, `${name}.html`); + + if (fs.existsSync(mdFile) || fs.existsSync(htmlFile)) { + throw new Error(`${name} already exists.`); + } + + fs.writeFileSync(mdFile, markdown); + fs.writeFileSync(htmlFile, html); +} From 24d6f19337557eb931aa00ad640ca138817d4c10 Mon Sep 17 00:00:00 2001 From: Tony Brix <tony@brix.ninja> Date: Sun, 10 Mar 2019 15:41:46 -0500 Subject: [PATCH 06/12] fix links test --- test/new/links.html | 2 +- test/new/links.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/new/links.html b/test/new/links.html index a6b0acd5b0..c3cbaa0cd8 100644 --- a/test/new/links.html +++ b/test/new/links.html @@ -1,3 +1,3 @@ <p>Link: <a href="https://example.org/">constructor</a>.</p> -<p><a href=\"https://example.com/1\">One</a> (<a href=\"https://example.com/2\">Two</a>) <a href=\"https://example.com/3\">Three</a></p> +<p><a href="https://example.com/1">One</a> (<a href="https://example.com/2">Two</a>) <a href="https://example.com/3">Three</a></p> diff --git a/test/new/links.md b/test/new/links.md index 2bbc098905..f53cbf13d1 100644 --- a/test/new/links.md +++ b/test/new/links.md @@ -2,4 +2,4 @@ Link: [constructor][]. [One](https://example.com/1) ([Two](https://example.com/2)) [Three](https://example.com/3) -[constructor]: https://example.org +[constructor]: https://example.org/ From fb9a71ccf14ad38e93ee5c503794198c12c66b83 Mon Sep 17 00:00:00 2001 From: Tony Brix <tony@brix.ninja> Date: Mon, 11 Mar 2019 11:12:46 -0500 Subject: [PATCH 07/12] use arrow functions --- test/helpers/helpers.js | 6 +++--- test/specs/original/specs-spec.js | 2 +- test/specs/run-spec.js | 8 ++++---- test/unit/marked-spec.js | 26 +++++++++++++------------- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/test/helpers/helpers.js b/test/helpers/helpers.js index 25f0f4b63c..5395a5310f 100644 --- a/test/helpers/helpers.js +++ b/test/helpers/helpers.js @@ -2,13 +2,13 @@ const marked = require('../../'); const HtmlDiffer = require('@markedjs/html-differ').HtmlDiffer; const htmlDiffer = new HtmlDiffer({ignoreSelfClosingSlash: true}); -beforeEach(function () { +beforeEach(() => { marked.setOptions(marked.getDefaults()); jasmine.addMatchers({ - toRender: function () { + toRender: () => { return { - compare: function (spec, expected) { + compare: (spec, expected) => { const result = {}; const actual = marked(spec.markdown, spec.options); result.pass = htmlDiffer.isEqual(expected, actual); diff --git a/test/specs/original/specs-spec.js b/test/specs/original/specs-spec.js index d0869dd472..a3a1df437c 100644 --- a/test/specs/original/specs-spec.js +++ b/test/specs/original/specs-spec.js @@ -1,6 +1,6 @@ var specTests = require('../../'); -it('should run spec tests', function () { +it('should run spec tests', () => { // hide output spyOn(console, 'log'); if (!specTests(['', '', '--stop'])) { diff --git a/test/specs/run-spec.js b/test/specs/run-spec.js index 809ae10ce2..b827a0dcf0 100644 --- a/test/specs/run-spec.js +++ b/test/specs/run-spec.js @@ -8,14 +8,14 @@ function runSpecs(title, file, options) { return obj; }, {}); - describe(title, function() { + describe(title, () => { Object.keys(specs).forEach(section => { - describe(section, function() { - specs[section].forEach(function(spec) { + describe(section, () => { + specs[section].forEach((spec) => { if (options) { spec.options = Object.assign({}, options, (spec.options || {})); } - (spec.only ? fit : it)('should ' + (spec.shouldFail ? 'fail' : 'pass') + ' example ' + spec.example, function() { + (spec.only ? fit : it)('should ' + (spec.shouldFail ? 'fail' : 'pass') + ' example ' + spec.example, () => { if (spec.shouldFail) { expect(spec).not.toRender(spec.html); } else { diff --git a/test/unit/marked-spec.js b/test/unit/marked-spec.js index c365e8599c..994c5dc8d7 100644 --- a/test/unit/marked-spec.js +++ b/test/unit/marked-spec.js @@ -1,41 +1,41 @@ var marked = require('../../lib/marked.js'); -describe('Test heading ID functionality', function() { - it('should add id attribute by default', function() { +describe('Test heading ID functionality', () => { + it('should add id attribute by default', () => { var renderer = new marked.Renderer(); var slugger = new marked.Slugger(); var header = renderer.heading('test', 1, 'test', slugger); expect(header).toBe('<h1 id="test">test</h1>\n'); }); - it('should NOT add id attribute when options set false', function() { + it('should NOT add id attribute when options set false', () => { var renderer = new marked.Renderer({ headerIds: false }); var header = renderer.heading('test', 1, 'test'); expect(header).toBe('<h1>test</h1>\n'); }); }); -describe('Test slugger functionality', function() { - it('should use lowercase slug', function() { +describe('Test slugger functionality', () => { + it('should use lowercase slug', () => { var slugger = new marked.Slugger(); expect(slugger.slug('Test')).toBe('test'); }); - it('should be unique to avoid collisions 1280', function() { + it('should be unique to avoid collisions 1280', () => { var slugger = new marked.Slugger(); expect(slugger.slug('test')).toBe('test'); expect(slugger.slug('test')).toBe('test-1'); expect(slugger.slug('test')).toBe('test-2'); }); - it('should be unique when slug ends with number', function() { + it('should be unique when slug ends with number', () => { var slugger = new marked.Slugger(); expect(slugger.slug('test 1')).toBe('test-1'); expect(slugger.slug('test')).toBe('test'); expect(slugger.slug('test')).toBe('test-2'); }); - it('should be unique when slug ends with hyphen number', function() { + it('should be unique when slug ends with hyphen number', () => { var slugger = new marked.Slugger(); expect(slugger.slug('foo')).toBe('foo'); expect(slugger.slug('foo')).toBe('foo-1'); @@ -44,24 +44,24 @@ describe('Test slugger functionality', function() { expect(slugger.slug('foo')).toBe('foo-2'); }); - it('should allow non-latin chars', function() { + it('should allow non-latin chars', () => { var slugger = new marked.Slugger(); expect(slugger.slug('привет')).toBe('привет'); }); - it('should remove ampersands 857', function() { + it('should remove ampersands 857', () => { var slugger = new marked.Slugger(); expect(slugger.slug('This & That Section')).toBe('this--that-section'); }); - it('should remove periods', function() { + it('should remove periods', () => { var slugger = new marked.Slugger(); expect(slugger.slug('file.txt')).toBe('filetxt'); }); }); -describe('Test paragraph token type', function () { - it('should use the "paragraph" type on top level', function () { +describe('Test paragraph token type', () => { + it('should use the "paragraph" type on top level', () => { const md = 'A Paragraph.\n\n> A blockquote\n\n- list item\n'; const tokens = marked.lexer(md); From fd9dc21647eec8a59208eac65f0d876cc9fb4b28 Mon Sep 17 00:00:00 2001 From: Tony Brix <tony@brix.ninja> Date: Mon, 11 Mar 2019 11:16:52 -0500 Subject: [PATCH 08/12] update deps --- package-lock.json | 572 +++++++++++++++++++++------------------------- package.json | 8 +- 2 files changed, 262 insertions(+), 318 deletions(-) diff --git a/package-lock.json b/package-lock.json index 193b2f4395..bbf1e37cf9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,68 +25,18 @@ } }, "@markedjs/html-differ": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@markedjs/html-differ/-/html-differ-2.0.0.tgz", - "integrity": "sha512-Hubtx56xtJKCTZucqhlusMrAt0jmGP+ilNERR6bWD+IkkDbVEmCRNH3cqwUN1gYJqrPsqPE9gbQ/Y+oN3qYaEA==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@markedjs/html-differ/-/html-differ-2.0.1.tgz", + "integrity": "sha512-Sv1PMZ9RGt+MZqIk7p4wHiOWZo34p1s4x2AIIipmK4HeZK1Vn7Hlp+A7K73I3CQgLfvUu4ZyuU219LIal6sUrg==", "dev": true, "requires": { - "chalk": "^2.4.1", - "coa": "^2.0.1", - "diff": "1.0.8", - "lodash": "^4.17.10", - "parse5": "1.1.3", - "vow": "^0.4.18", + "chalk": "^2.4.2", + "coa": "^2.0.2", + "diff": "1.3.2", + "lodash": "^4.17.11", + "parse5": "1.5.1", + "vow": "^0.4.19", "vow-fs": "^0.3.6" - }, - "dependencies": { - "coa": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/coa/-/coa-2.0.1.tgz", - "integrity": "sha512-5wfTTO8E2/ja4jFSxePXlG5nRu5bBtL/r1HCIpJW/lzT6yDtKl0u0Z4o/Vpz32IpKmBn7HerheEZQgA9N2DarQ==", - "dev": true, - "requires": { - "q": "^1.1.2" - } - }, - "lodash": { - "version": "4.17.10", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", - "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==", - "dev": true - }, - "q": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", - "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=", - "dev": true - }, - "vow": { - "version": "0.4.18", - "resolved": "https://registry.npmjs.org/vow/-/vow-0.4.18.tgz", - "integrity": "sha512-7QGozxlOhour77BCQbbyW5XFP8ioIz/DPK67IyO3DnJtF0WXrXueMwqrYFM9yqyfgENcyxL+vktz2oJeZfdWtw==", - "dev": true - }, - "vow-fs": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/vow-fs/-/vow-fs-0.3.6.tgz", - "integrity": "sha1-LUxZviLivyYY3fWXq0uqkjvnIA0=", - "dev": true, - "requires": { - "glob": "^7.0.5", - "uuid": "^2.0.2", - "vow": "^0.4.7", - "vow-queue": "^0.4.1" - } - }, - "vow-queue": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/vow-queue/-/vow-queue-0.4.3.tgz", - "integrity": "sha512-/poAKDTFL3zYbeQg7cl4BGcfP4sGgXKrHnRFSKj97dteUFu8oyXMwIcdwu8NSx/RmPGIuYx1Bik/y5vU4H/VKw==", - "dev": true, - "requires": { - "vow": "^0.4.17" - } - } } }, "@types/concat-stream": { @@ -113,6 +63,12 @@ "integrity": "sha512-NOLEgsT6UiDTjnWG5Hd2Mg25LRyz/oe8ql3wbjzgSFeRzRROhPmtlsvIrei4B46UjERF0td9SZ1ZXPLOdcrBHg==", "dev": true }, + "@types/q": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/@types/q/-/q-1.5.1.tgz", + "integrity": "sha512-eqz8c/0kwNi/OEHQfvIuJVLTst3in0e7uTKeuY+WL/zfKn0xVujOTp42bS/vUUokhK5P2BppLd9JXMOMHcgbjA==", + "dev": true + }, "@types/qs": { "version": "6.5.1", "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.5.1.tgz", @@ -126,9 +82,9 @@ "dev": true }, "acorn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.0.5.tgz", - "integrity": "sha512-i33Zgp3XWtmZBMNvCr4azvOFeWVw1Rk6p3hfi3LUDvIFraOMywb1kAtrbi+med14m4Xfpqm3zRZMT+c0FNE7kg==", + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.1.1.tgz", + "integrity": "sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA==", "dev": true }, "acorn-jsx": { @@ -138,9 +94,9 @@ "dev": true }, "ajv": { - "version": "6.7.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.7.0.tgz", - "integrity": "sha512-RZXPviBTtfmtka9n9sy1N5M5b82CbxWIR6HIis4s3WQTXDJamc/0gpCWNGz6EWdWp4DOfjzJfhz/AS9zVPjjWg==", + "version": "6.10.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz", + "integrity": "sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==", "dev": true, "requires": { "fast-deep-equal": "^2.0.1", @@ -150,9 +106,9 @@ } }, "ansi-escapes": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz", - "integrity": "sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", + "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", "dev": true }, "ansi-regex": { @@ -213,12 +169,6 @@ "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 - }, "callsites": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.0.0.tgz", @@ -232,34 +182,14 @@ "dev": true }, "chalk": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", - "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, "requires": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", "supports-color": "^5.3.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } } }, "chardet": { @@ -268,12 +198,6 @@ "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", "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", @@ -289,6 +213,17 @@ "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", "dev": true }, + "coa": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/coa/-/coa-2.0.2.tgz", + "integrity": "sha512-q5/jG+YQnSy4nRTV4F7lPepBJZ8qBNJJDBuJdoejDyLXgmL7IEo+Le2JDZudFTFt7mrCqIRaSjws4ygRCTCAXA==", + "dev": true, + "requires": { + "@types/q": "^1.5.1", + "chalk": "^2.4.1", + "q": "^1.1.2" + } + }, "color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -412,14 +347,6 @@ "dev": true, "requires": { "ms": "^2.1.1" - }, - "dependencies": { - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", - "dev": true - } } }, "deep-is": { @@ -435,20 +362,26 @@ "dev": true }, "diff": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/diff/-/diff-1.0.8.tgz", - "integrity": "sha1-NDJ2MI7Jkbe8giZ+1VvBQR+XFmY=", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-1.3.2.tgz", + "integrity": "sha1-/Qeh8fiRUZ2ZBaTJqJ3PWnC2YDc=", "dev": true }, "doctrine": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", - "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", "dev": true, "requires": { "esutils": "^2.0.2" } }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, "entities": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz", @@ -471,47 +404,46 @@ "dev": true }, "eslint": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.12.0.tgz", - "integrity": "sha512-LntwyPxtOHrsJdcSwyQKVtHofPHdv+4+mFwEe91r2V13vqpM8yLr7b1sW+Oo/yheOPkWYsYlYJCkzlFAt8KV7g==", + "version": "5.15.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.15.1.tgz", + "integrity": "sha512-NTcm6vQ+PTgN3UBsALw5BMhgO6i5EpIjQF/Xb5tIh3sk9QhrFafujUOczGz4J24JBlzWclSB9Vmx8d+9Z6bFCg==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", - "ajv": "^6.5.3", + "ajv": "^6.9.1", "chalk": "^2.1.0", "cross-spawn": "^6.0.5", "debug": "^4.0.1", - "doctrine": "^2.1.0", - "eslint-scope": "^4.0.0", + "doctrine": "^3.0.0", + "eslint-scope": "^4.0.2", "eslint-utils": "^1.3.1", "eslint-visitor-keys": "^1.0.0", - "espree": "^5.0.0", + "espree": "^5.0.1", "esquery": "^1.0.1", "esutils": "^2.0.2", - "file-entry-cache": "^2.0.0", + "file-entry-cache": "^5.0.1", "functional-red-black-tree": "^1.0.1", "glob": "^7.1.2", "globals": "^11.7.0", "ignore": "^4.0.6", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", - "inquirer": "^6.1.0", + "inquirer": "^6.2.2", "js-yaml": "^3.12.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.3.0", - "lodash": "^4.17.5", + "lodash": "^4.17.11", "minimatch": "^3.0.4", "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", "regexpp": "^2.0.1", "semver": "^5.5.1", "strip-ansi": "^4.0.0", "strip-json-comments": "^2.0.1", - "table": "^5.0.2", + "table": "^5.2.3", "text-table": "^0.2.0" } }, @@ -539,17 +471,23 @@ "requires": { "ms": "2.0.0" } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true } } }, "eslint-module-utils": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.2.0.tgz", - "integrity": "sha1-snA2LNiLGkitMIl2zn+lTphBF0Y=", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.3.0.tgz", + "integrity": "sha512-lmDJgeOOjk8hObTysjqH7wyMi+nsHwwvfBykwfhjR1LNdd7C2uFJBvx4OpWYpXOw4df1yE1cDEVd1yLHitk34w==", "dev": true, "requires": { "debug": "^2.6.8", - "pkg-dir": "^1.0.0" + "pkg-dir": "^2.0.0" }, "dependencies": { "debug": { @@ -560,6 +498,12 @@ "requires": { "ms": "2.0.0" } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true } } }, @@ -574,21 +518,21 @@ } }, "eslint-plugin-import": { - "version": "2.14.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.14.0.tgz", - "integrity": "sha512-FpuRtniD/AY6sXByma2Wr0TXvXJ4nA/2/04VPlfpmUDPOpOY264x+ILiwnrk/k4RINgDAyFZByxqPUbSQ5YE7g==", + "version": "2.16.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.16.0.tgz", + "integrity": "sha512-z6oqWlf1x5GkHIFgrSvtmudnqM6Q60KM4KvpWi5ubonMjycLjndvd5+8VAZIsTlHC03djdgJuyKG6XO577px6A==", "dev": true, "requires": { "contains-path": "^0.1.0", - "debug": "^2.6.8", + "debug": "^2.6.9", "doctrine": "1.5.0", - "eslint-import-resolver-node": "^0.3.1", - "eslint-module-utils": "^2.2.0", - "has": "^1.0.1", - "lodash": "^4.17.4", - "minimatch": "^3.0.3", + "eslint-import-resolver-node": "^0.3.2", + "eslint-module-utils": "^2.3.0", + "has": "^1.0.3", + "lodash": "^4.17.11", + "minimatch": "^3.0.4", "read-pkg-up": "^2.0.0", - "resolve": "^1.6.0" + "resolve": "^1.9.0" }, "dependencies": { "debug": { @@ -610,20 +554,11 @@ "isarray": "^1.0.0" } }, - "lodash": { - "version": "4.17.10", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", - "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==", + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true - }, - "resolve": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.1.tgz", - "integrity": "sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA==", - "dev": true, - "requires": { - "path-parse": "^1.0.5" - } } } }, @@ -687,9 +622,9 @@ } }, "eslint-scope": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.0.tgz", - "integrity": "sha512-1G6UTDi7Jc1ELFwnR58HV4fK9OQK4S6N985f166xqXxpjU6plxFISJa2Ba9KCQuFa8RCnj/lSFJbHo7UFDBnUA==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.2.tgz", + "integrity": "sha512-5q1+B/ogmHl8+paxtOKx38Z8LtWkVGuNt3+GQNErqwLl6ViNp/gdJGMCjZNxZ8j/VYjDNZ2Fo+eQc1TAVPIzbg==", "dev": true, "requires": { "esrecurse": "^4.1.0", @@ -709,12 +644,12 @@ "dev": true }, "espree": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-5.0.0.tgz", - "integrity": "sha512-1MpUfwsdS9MMoN7ZXqAr9e9UKdVHDcvrJpyx7mm1WuQlx/ygErEQBzgi5Nh5qBHIoYweprhtMkTCb9GhcAIcsA==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-5.0.1.tgz", + "integrity": "sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A==", "dev": true, "requires": { - "acorn": "^6.0.2", + "acorn": "^6.0.7", "acorn-jsx": "^5.0.0", "eslint-visitor-keys": "^1.0.0" } @@ -794,37 +729,40 @@ } }, "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=", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", + "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", "dev": true, "requires": { - "flat-cache": "^1.2.1", - "object-assign": "^4.0.1" + "flat-cache": "^2.0.1" } }, "find-up": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", "dev": true, "requires": { - "path-exists": "^2.0.0", - "pinkie-promise": "^2.0.0" + "locate-path": "^2.0.0" } }, "flat-cache": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.4.tgz", - "integrity": "sha512-VwyB3Lkgacfik2vhqR4uv2rvebqmDvFu4jlN/C1RzWoJEo8I7z4Q404oiqYCkq41mni8EzQnm95emU9seckwtg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", + "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", "dev": true, "requires": { - "circular-json": "^0.3.1", - "graceful-fs": "^4.1.2", - "rimraf": "~2.6.2", - "write": "^0.2.1" + "flatted": "^2.0.0", + "rimraf": "2.6.3", + "write": "1.0.3" } }, + "flatted": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.0.tgz", + "integrity": "sha512-R+H8IZclI8AAkSBRQJLVOsxwAoHd6WC40b4QTNWIjzAa6BXOBfQcM587MXDTVPeYaopFNWHUFLx7eNmHDSxMWg==", + "dev": true + }, "form-data": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", @@ -890,15 +828,15 @@ "dev": true }, "globals": { - "version": "11.10.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.10.0.tgz", - "integrity": "sha512-0GZF1RiPKU97IHUO5TORo9w1PwrH/NBPl+fS7oMLdaTRiYmYbwK4NWoZWrAdd0/abG9R2BU+OiwyQpTpE6pdfQ==", + "version": "11.11.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.11.0.tgz", + "integrity": "sha512-WHq43gS+6ufNOEqlrDBxVEbb8ntfXrfAUU2ZOpCxrBdGKW3gyv8mCxAfIBD0DroPKGrJ2eSsXsLtY9MPntsyTw==", "dev": true }, "graceful-fs": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "version": "4.1.15", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", + "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==", "dev": true }, "has": { @@ -993,39 +931,39 @@ "dev": true }, "inquirer": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.2.1.tgz", - "integrity": "sha512-088kl3DRT2dLU5riVMKKr1DlImd6X7smDhpXUCkJDCKvTEJeRiXh0G132HG9u5a+6Ylw9plFRY7RuTnwohYSpg==", + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.2.2.tgz", + "integrity": "sha512-Z2rREiXA6cHRR9KBOarR3WuLlFzlIfAEIiB45ll5SSadMg7WqOh1MKEjjndfuH5ewXdixWCxqnVfGOQzPeiztA==", "dev": true, "requires": { - "ansi-escapes": "^3.0.0", - "chalk": "^2.0.0", + "ansi-escapes": "^3.2.0", + "chalk": "^2.4.2", "cli-cursor": "^2.1.0", "cli-width": "^2.0.0", - "external-editor": "^3.0.0", + "external-editor": "^3.0.3", "figures": "^2.0.0", - "lodash": "^4.17.10", + "lodash": "^4.17.11", "mute-stream": "0.0.7", "run-async": "^2.2.0", - "rxjs": "^6.1.0", + "rxjs": "^6.4.0", "string-width": "^2.1.0", "strip-ansi": "^5.0.0", "through": "^2.3.6" }, "dependencies": { "ansi-regex": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.0.0.tgz", - "integrity": "sha512-iB5Dda8t/UqpPI/IjsejXu5jOGDrzn41wJyljwPH65VCIbk6+1BzFIMJGFwTNrYXT1CrD+B4l19U7awiQ8rk7w==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true }, "strip-ansi": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.0.0.tgz", - "integrity": "sha512-Uu7gQyZI7J7gn5qLn1Np3G9vcYGTVqB+lFTytnDJv83dd8T22aGH451P3jueT2/QemInJDfxHB5Tde5OzgG1Ow==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.1.0.tgz", + "integrity": "sha512-TjxrkPONqO2Z8QDCpeE2j6n0M6EwxzyDgzEeGp+FbdvaJAt//ClYi6W5my+3ROlC/hZX2KACUwDfK49Ka5eDvg==", "dev": true, "requires": { - "ansi-regex": "^4.0.0" + "ansi-regex": "^4.1.0" } } } @@ -1036,15 +974,6 @@ "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-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", @@ -1085,12 +1014,6 @@ "integrity": "sha512-3/xSmG/d35hf80BEN66Y6g9Ca5l/Isdeg/j6zvbTYlTzeKinzmaTM4p9am5kYqOmE05D7s1t8FGjzdSnbUbceA==", "dev": true }, - "jasmine2-custom-message": { - "version": "0.9.3", - "resolved": "https://registry.npmjs.org/jasmine2-custom-message/-/jasmine2-custom-message-0.9.3.tgz", - "integrity": "sha512-ImGW7VN9GDDPpZCwuNEpipf4cFxg7k802GN82AnesziKNPmcYwxbh4lSVcu7LqHQoVnwORDBqX3vjYKKmOzdOw==", - "dev": true - }, "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -1158,14 +1081,6 @@ "requires": { "p-locate": "^2.0.0", "path-exists": "^3.0.0" - }, - "dependencies": { - "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 - } } }, "lodash": { @@ -1256,9 +1171,9 @@ } }, "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", "dev": true }, "mute-stream": { @@ -1289,23 +1204,17 @@ } }, "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==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", "dev": true, "requires": { "hosted-git-info": "^2.1.4", - "is-builtin-module": "^1.0.0", + "resolve": "^1.10.0", "semver": "2 || 3 || 4 || 5", "validate-npm-package-license": "^3.0.1" } }, - "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 - }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -1393,19 +1302,16 @@ } }, "parse5": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-1.1.3.tgz", - "integrity": "sha1-i6tY0GUl8A5ON9dVEW64LnJB8UI=", + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-1.5.1.tgz", + "integrity": "sha1-m387DeMr543CQBsXVzzK8Pb1nZQ=", "dev": true }, "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" - } + "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", @@ -1426,9 +1332,9 @@ "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=", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", "dev": true }, "path-type": { @@ -1446,36 +1352,15 @@ "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=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", + "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", "dev": true, "requires": { - "find-up": "^1.0.0" + "find-up": "^2.1.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", @@ -1509,6 +1394,12 @@ "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true }, + "q": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", + "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=", + "dev": true + }, "qs": { "version": "6.5.1", "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", @@ -1534,17 +1425,6 @@ "requires": { "find-up": "^2.0.0", "read-pkg": "^2.0.0" - }, - "dependencies": { - "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" - } - } } }, "regexpp": { @@ -1560,12 +1440,12 @@ "dev": true }, "resolve": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.5.0.tgz", - "integrity": "sha512-hgoSGrc3pjzAPHNBg+KnFcK2HwlHTs/YrAGUr6qgTVUZmXv1UEXXl0bZNBKMA9fud6lRYFdPGz0xXxycPzmmiw==", + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.0.tgz", + "integrity": "sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg==", "dev": true, "requires": { - "path-parse": "^1.0.5" + "path-parse": "^1.0.6" } }, "resolve-from": { @@ -1603,9 +1483,9 @@ } }, "rxjs": { - "version": "6.3.3", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.3.3.tgz", - "integrity": "sha512-JTWmoY9tWCs7zvIk/CvRjhjGaOd+OVBM987mxFo+OW66cGpdKjZcpmc74ES1sB//7Kl/PAe8+wEakuhG4pcgOw==", + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.4.0.tgz", + "integrity": "sha512-Z9Yfa11F6B9Sg/BK9MnqnQ+aQYicPLtilXBp2yUtDt2JRCE0h26d33EnfO3ZxoNxG0T92OUucP3Ct7cpfkdFfw==", "dev": true, "requires": { "tslib": "^1.9.0" @@ -1651,9 +1531,9 @@ "dev": true }, "slice-ansi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.0.0.tgz", - "integrity": "sha512-4j2WTWjp3GsZ+AOagyzVbzp4vWGtZ0hEZ/gDY/uTvm6MTxUfTUIsnMIFb1bn8o0RuXiqUw15H1bue8f22Vw2oQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", "dev": true, "requires": { "ansi-styles": "^3.2.0", @@ -1668,9 +1548,9 @@ "dev": true }, "spdx-correct": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.0.tgz", - "integrity": "sha512-N19o9z5cEyc8yQQPukRCZ9EUmb4HUpnrmaL/fxS2pBo2jbfcFRVuFZ/oFC+vZz0MNNk0h80iMn5/S6qGZOL5+g==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", + "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", "dev": true, "requires": { "spdx-expression-parse": "^3.0.0", @@ -1678,9 +1558,9 @@ } }, "spdx-exceptions": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz", - "integrity": "sha512-4K1NsmrlCU1JJgUrtgEeTVyfx8VaYea9J9LvARxhbHtVtohPs/gFGG5yy49beySjlIMhhXZ4QqujIZEfS4l6Cg==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", + "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==", "dev": true }, "spdx-expression-parse": { @@ -1694,9 +1574,9 @@ } }, "spdx-license-ids": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz", - "integrity": "sha512-2+EPwgbnmOIl8HjGBXXMd9NAu02vLjOO1nWw4kmeRDFyHn+M/ETfHxQUK0oXg8ctgVnl9t3rosNVsZ1jG61nDA==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.3.tgz", + "integrity": "sha512-uBIcIl3Ih6Phe3XHK1NqboJLdGfwr1UN3k6wSD1dZpmPsIkb8AGNbZYJ1fOBk834+Gxy8rpfDxrS6XLEMZMY2g==", "dev": true }, "sprintf-js": { @@ -1742,6 +1622,15 @@ "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", "dev": true }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, "sync-request": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/sync-request/-/sync-request-6.0.0.tgz", @@ -1763,15 +1652,43 @@ } }, "table": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/table/-/table-5.2.0.tgz", - "integrity": "sha512-hAdBBAMCZl4/U3eQhsPN2Z8wRJC98lpRhDW2I86VQbPBqyj4E681VhvUkfb90qUJ4rnRfu8t4/8SGHPsAH1ygg==", + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/table/-/table-5.2.3.tgz", + "integrity": "sha512-N2RsDAMvDLvYwFcwbPyF3VmVSSkuF+G1e+8inhBLtHpvwXGw4QRPEZhihQNeEN0i1up6/f6ObCJXNdlRG3YVyQ==", "dev": true, "requires": { - "ajv": "^6.6.1", + "ajv": "^6.9.1", "lodash": "^4.17.11", - "slice-ansi": "2.0.0", - "string-width": "^2.1.1" + "slice-ansi": "^2.1.0", + "string-width": "^3.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.1.0.tgz", + "integrity": "sha512-TjxrkPONqO2Z8QDCpeE2j6n0M6EwxzyDgzEeGp+FbdvaJAt//ClYi6W5my+3ROlC/hZX2KACUwDfK49Ka5eDvg==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } } }, "text-table": { @@ -1890,6 +1807,33 @@ "spdx-expression-parse": "^3.0.0" } }, + "vow": { + "version": "0.4.19", + "resolved": "https://registry.npmjs.org/vow/-/vow-0.4.19.tgz", + "integrity": "sha512-S+0+CiQlbUhTNWMlJdqo/ARuXOttXdvw5ACGyh1W97NFHUdwt3Fzyaus03Kvdmo733dwnYS9AGJSDg0Zu8mNfA==", + "dev": true + }, + "vow-fs": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/vow-fs/-/vow-fs-0.3.6.tgz", + "integrity": "sha1-LUxZviLivyYY3fWXq0uqkjvnIA0=", + "dev": true, + "requires": { + "glob": "^7.0.5", + "uuid": "^2.0.2", + "vow": "^0.4.7", + "vow-queue": "^0.4.1" + } + }, + "vow-queue": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/vow-queue/-/vow-queue-0.4.3.tgz", + "integrity": "sha512-/poAKDTFL3zYbeQg7cl4BGcfP4sGgXKrHnRFSKj97dteUFu8oyXMwIcdwu8NSx/RmPGIuYx1Bik/y5vU4H/VKw==", + "dev": true, + "requires": { + "vow": "^0.4.17" + } + }, "vuln-regex-detector": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/vuln-regex-detector/-/vuln-regex-detector-1.3.0.tgz", @@ -1921,9 +1865,9 @@ "dev": true }, "write": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", - "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", + "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", "dev": true, "requires": { "mkdirp": "^0.5.1" diff --git a/package.json b/package.json index 4898340dc3..a1ef0139a6 100644 --- a/package.json +++ b/package.json @@ -30,18 +30,17 @@ ], "devDependencies": { "commonmark": "0.x", - "eslint": "^5.12.0", + "eslint": "^5.15.1", "eslint-config-standard": "^12.0.0", - "eslint-plugin-import": "^2.14.0", + "eslint-plugin-import": "^2.16.0", "eslint-plugin-node": "^8.0.1", "eslint-plugin-promise": "^4.0.1", "eslint-plugin-standard": "^4.0.0", "eslint-plugin-vuln-regex-detector": "^1.0.4", "front-matter": "^3.0.1", "glob-to-regexp": "^0.4.0", - "@markedjs/html-differ": "^2.0.0", + "@markedjs/html-differ": "^2.0.1", "jasmine": "^3.3.1", - "jasmine2-custom-message": "^0.9.3", "markdown": "0.x", "markdown-it": "8.x", "uglify-js": "^3.4.9" @@ -56,6 +55,7 @@ "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", + "test:node4": "npx node@4 ./node_modules/jasmine/bin/jasmine.js --config=jasmine.json", "bench": "node test --bench", "lint": "eslint --fix bin/marked .", "build": "uglifyjs lib/marked.js -cm --comments /Copyright/ -o marked.min.js", From b169e7bc1a617728fce5600efb064adb3b9324eb Mon Sep 17 00:00:00 2001 From: Tony Brix <tony@brix.ninja> Date: Mon, 11 Mar 2019 11:20:33 -0500 Subject: [PATCH 09/12] add excerpt length constant --- test/helpers/helpers.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/helpers/helpers.js b/test/helpers/helpers.js index 5395a5310f..c5ef733e91 100644 --- a/test/helpers/helpers.js +++ b/test/helpers/helpers.js @@ -2,6 +2,8 @@ const marked = require('../../'); const HtmlDiffer = require('@markedjs/html-differ').HtmlDiffer; const htmlDiffer = new HtmlDiffer({ignoreSelfClosingSlash: true}); +const EXCERPT_LENGTH = 30; + beforeEach(() => { marked.setOptions(marked.getDefaults()); @@ -22,12 +24,12 @@ beforeEach(() => { for (var i = 0; i < expectedHtml.length; i++) { if (actualHtml[i] !== expectedHtml[i]) { actualHtml = actualHtml.substring( - Math.max(i - 30, 0), - Math.min(i + 30, actualHtml.length)); + Math.max(i - EXCERPT_LENGTH, 0), + Math.min(i + EXCERPT_LENGTH, actualHtml.length)); expectedHtml = expectedHtml.substring( - Math.max(i - 30, 0), - Math.min(i + 30, expectedHtml.length)); + Math.max(i - EXCERPT_LENGTH, 0), + Math.min(i + EXCERPT_LENGTH, expectedHtml.length)); break; } From 775d08db5a608878b3d9682e42601c4fddd7e33b Mon Sep 17 00:00:00 2001 From: Tony Brix <tony@brix.ninja> Date: Mon, 11 Mar 2019 13:41:33 -0500 Subject: [PATCH 10/12] move redos tests to /redos folder --- test/index.js | 23 ++++++++++++++++++++--- test/new/redos_html_closing.html | 0 test/new/redos_nolink.html | 0 test/{new => redos}/link_redos.html | 0 test/{new => redos}/link_redos.md | 0 test/redos/redos_html_closing.html | 1 + test/{new => redos}/redos_html_closing.md | 0 test/redos/redos_nolink.html | 1 + test/{new => redos}/redos_nolink.md | 0 9 files changed, 22 insertions(+), 3 deletions(-) delete mode 100644 test/new/redos_html_closing.html delete mode 100644 test/new/redos_nolink.html rename test/{new => redos}/link_redos.html (100%) rename test/{new => redos}/link_redos.md (100%) create mode 100644 test/redos/redos_html_closing.html rename test/{new => redos}/redos_html_closing.md (100%) create mode 100644 test/redos/redos_nolink.html rename test/{new => redos}/redos_nolink.md (100%) diff --git a/test/index.js b/test/index.js index 29b19bc5de..0a3541bc09 100644 --- a/test/index.js +++ b/test/index.js @@ -176,6 +176,17 @@ function testFile(engine, file, filename, index) { l = html.length; + if (l === 0 && text.length > 0) { + text = text.substring(0, Math.min(30, text.length)); + + console.log(' failed in %dms at offset %d. Near: "%s".\n', prettyElapsedTime(elapsed), 0, text); + + console.log('\nActual:\n%s\n', text.trim() || text); + console.log('\nExpected:\n\n'); + + return false; + } + for (j = 0; j < l; j++) { if (text[j] !== html[j]) { text = text.substring( @@ -188,7 +199,7 @@ function testFile(engine, file, filename, index) { 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('\nActual:\n%s\n', text.trim() || text); console.log('\nExpected:\n%s\n', html.trim() || html); return false; @@ -346,11 +357,11 @@ function time(options) { */ function fix() { - ['compiled_tests', 'original', 'new'].forEach(function(dir) { + ['compiled_tests', 'original', 'new', 'redos'].forEach(function(dir) { try { fs.mkdirSync(path.resolve(__dirname, dir)); } catch (e) { - ; + // directory already exists } }); @@ -435,6 +446,12 @@ function fix() { fs.writeFileSync(path.resolve(__dirname, 'compiled_tests', file), fs.readFileSync(path.resolve(__dirname, 'new', file))); }); + + // cp redos/* tests/ + fs.readdirSync(path.resolve(__dirname, 'redos')).forEach(function(file) { + fs.writeFileSync(path.resolve(__dirname, 'compiled_tests', file), + fs.readFileSync(path.resolve(__dirname, 'redos', file))); + }); } /** diff --git a/test/new/redos_html_closing.html b/test/new/redos_html_closing.html deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/test/new/redos_nolink.html b/test/new/redos_nolink.html deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/test/new/link_redos.html b/test/redos/link_redos.html similarity index 100% rename from test/new/link_redos.html rename to test/redos/link_redos.html diff --git a/test/new/link_redos.md b/test/redos/link_redos.md similarity index 100% rename from test/new/link_redos.md rename to test/redos/link_redos.md diff --git a/test/redos/redos_html_closing.html b/test/redos/redos_html_closing.html new file mode 100644 index 0000000000..543e775acb --- /dev/null +++ b/test/redos/redos_html_closing.html @@ -0,0 +1 @@ +<p><tag "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ""<" />a'a</p> diff --git a/test/new/redos_html_closing.md b/test/redos/redos_html_closing.md similarity index 100% rename from test/new/redos_html_closing.md rename to test/redos/redos_html_closing.md diff --git a/test/redos/redos_nolink.html b/test/redos/redos_nolink.html new file mode 100644 index 0000000000..5915375324 --- /dev/null +++ b/test/redos/redos_nolink.html @@ -0,0 +1 @@ +<p>![[[][[][[][[][[][[][[][[][[][[][[][[][[][[][[][[][[][[][[][[][[][[][[][[][[][[][[][[][[][[][[][[][[][[][[][[][[][[][[][[][[][[][[]!\</p> diff --git a/test/new/redos_nolink.md b/test/redos/redos_nolink.md similarity index 100% rename from test/new/redos_nolink.md rename to test/redos/redos_nolink.md From df310a8cb3413c3ba8f70ba9aedc2091a231b6bb Mon Sep 17 00:00:00 2001 From: Tony Brix <tony@brix.ninja> Date: Mon, 11 Mar 2019 13:48:14 -0500 Subject: [PATCH 11/12] remove header ids from original tests --- test/index.js | 14 ------------- .../original/markdown_documentation_syntax.md | 20 +++++++++---------- test/original/ordered_and_unordered_lists.md | 3 +++ 3 files changed, 13 insertions(+), 24 deletions(-) diff --git a/test/index.js b/test/index.js index 0a3541bc09..7e8f5e3af3 100644 --- a/test/index.js +++ b/test/index.js @@ -404,20 +404,6 @@ function fix() { .replace(/&__QUOT__;/g, '"') .replace(/&__APOS__;/g, '\''); - // add heading id's - html = html.replace(/<(h[1-6])>([^<]+)<\/\1>/g, function(s, h, text) { - var id = text - .replace(/'/g, '\'') - .replace(/"/g, '"') - .replace(/>/g, '>') - .replace(/</g, '<') - .replace(/&/g, '&'); - - id = id.toLowerCase().replace(/[^\w]+/g, '-'); - - return '<' + h + ' id="' + id + '">' + text + '</' + h + '>'; - }); - fs.writeFileSync(file, html); }); diff --git a/test/original/markdown_documentation_syntax.md b/test/original/markdown_documentation_syntax.md index 09a9ee41a7..e3bd4a7f65 100644 --- a/test/original/markdown_documentation_syntax.md +++ b/test/original/markdown_documentation_syntax.md @@ -1,5 +1,6 @@ --- pedantic: true +headerIds: false --- Markdown: Syntax @@ -258,7 +259,7 @@ wrap the text and put a `>` before every line: > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet, > consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. > Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. - > + > > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse > id sem consectetuer libero luctus adipiscing. @@ -285,12 +286,12 @@ Blockquotes can contain other Markdown elements, including headers, lists, and code blocks: > ## This is a header. - > + > > 1. This is the first list item. > 2. This is the second list item. - > + > > Here's some example code: - > + > > return shell_exec("echo $input | $markdown_script"); Any decent text editor should make email-style quoting easy. For @@ -535,7 +536,7 @@ following lines will produce a horizontal rule: *** ***** - + - - - --------------------------------------- @@ -636,7 +637,7 @@ multiple words in the link text: Visit [Daring Fireball][] for more information. And then define the link: - + [Daring Fireball]: http://daringfireball.net/ Link definitions can be placed anywhere in your Markdown document. I @@ -760,13 +761,13 @@ one after the opening, one before the closing. This allows you to place literal backtick characters at the beginning or end of a code span: A single backtick in a code span: `` ` `` - + A backtick-delimited string in a code span: `` `foo` `` will produce: <p>A single backtick in a code span: <code>`</code></p> - + <p>A backtick-delimited string in a code span: <code>`foo`</code></p> With a code span, ampersands and angle brackets are encoded as HTML @@ -837,7 +838,7 @@ use regular HTML `<img>` tags. Markdown supports a shortcut style for creating "automatic" links for URLs and email addresses: simply surround the URL or email address with angle brackets. What this means is that if you want to show the actual text of a URL or email address, and also have it be a clickable link, you can do this: <http://example.com/> - + Markdown will turn this into: <a href="http://example.com/">http://example.com/</a> @@ -889,4 +890,3 @@ Markdown provides backslash escapes for the following characters: - minus sign (hyphen) . dot ! exclamation mark - diff --git a/test/original/ordered_and_unordered_lists.md b/test/original/ordered_and_unordered_lists.md index ea2b9c00d0..d11fb5d88b 100644 --- a/test/original/ordered_and_unordered_lists.md +++ b/test/original/ordered_and_unordered_lists.md @@ -1,3 +1,6 @@ +--- +headerIds: false +--- ## Unordered Asterisks tight: From 47607728dbfcea4d959c8b10d77b684221a3416a Mon Sep 17 00:00:00 2001 From: Tony Brix <tony@brix.ninja> Date: Tue, 12 Mar 2019 09:34:51 -0500 Subject: [PATCH 12/12] fix tests --- test/new/table_cells.html | 2 +- test/specs/original/specs-spec.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/new/table_cells.html b/test/new/table_cells.html index 83bbc45989..694f7dddea 100644 --- a/test/new/table_cells.html +++ b/test/new/table_cells.html @@ -14,7 +14,7 @@ <table><thead><tr><th>1</th><th>2</th></tr></thead><tbody><tr><td></td><td>2</td></tr></tbody></table> -<table><thead><tr><th>1</th><th>2</th></tr></thead><tbody><tr><td>1|\\</td><td>2|\\</td></tr></tbody></table> +<table><thead><tr><th>1</th><th>2</th></tr></thead><tbody><tr><td>1|\</td><td>2|\</td></tr></tbody></table> <table><thead><tr><th>1</th><th>2</th></tr></thead><tbody><tr><td></td><td>2</td></tr></tbody></table> diff --git a/test/specs/original/specs-spec.js b/test/specs/original/specs-spec.js index a3a1df437c..82d300a56b 100644 --- a/test/specs/original/specs-spec.js +++ b/test/specs/original/specs-spec.js @@ -6,7 +6,7 @@ it('should run spec tests', () => { if (!specTests(['', '', '--stop'])) { // if tests fail rerun tests and show output console.log.and.callThrough(); - specTests(); + specTests([]); fail(); } });