diff --git a/package.json b/package.json index fd4d70853..cce26a444 100644 --- a/package.json +++ b/package.json @@ -135,7 +135,7 @@ "browserslist-to-esbuild": "2.1.1", "buffer": "6.0.3", "c8": "10.1.3", - "commonmark.json": "0.31.0", + "commonmark-test-suite": "0.1.0", "cross-env": "10.1.0", "cspell": "9.3.2", "enquirer": "2.4.1", diff --git a/scripts/clean-markdown-legacy-spec.js b/scripts/clean-markdown-legacy-spec.js index 4103b5fc7..bc5b75983 100644 --- a/scripts/clean-markdown-legacy-spec.js +++ b/scripts/clean-markdown-legacy-spec.js @@ -1,19 +1,25 @@ import fs from "node:fs/promises"; -import { commonmark } from "commonmark.json"; +import commonmarkTestSuite from "commonmark-test-suite"; -const existing = new Set(commonmark.map(({ markdown }) => markdown.trim())); -const DIRECTORY = new URL( - "../tests/format/markdown/legacy-spec/", - import.meta.url, +const existing = new Set( + Object.values(commonmarkTestSuite).flatMap((release) => + release.testCases.map(({ markdown }) => markdown.trim()), + ), ); -for (const file of await fs.readdir(DIRECTORY, { withFileTypes: true })) { - if (!file.isFile()) { - continue; - } - const fileUrl = new URL(file.name, DIRECTORY); - const content = await fs.readFile(fileUrl, "utf8"); - if (existing.has(content.trim())) { - await fs.rm(new URL(file.name, DIRECTORY)); +const DIRECTORIES = [ + new URL("../tests/format/markdown/spec-legacy/", import.meta.url), +]; + +for (const directory of DIRECTORIES) { + for (const file of await fs.readdir(directory, { withFileTypes: true })) { + if (!file.isFile()) { + continue; + } + const fileUrl = new URL(file.name, directory); + const content = await fs.readFile(fileUrl, "utf8"); + if (existing.has(content.trim())) { + await fs.rm(new URL(file.name, directory)); + } } } diff --git a/tests/format/markdown/commonmark-test-suite-legacy/__snapshots__/format.test.js.snap b/tests/format/markdown/commonmark-test-suite-legacy/__snapshots__/format.test.js.snap new file mode 100644 index 000000000..d390d4c5b --- /dev/null +++ b/tests/format/markdown/commonmark-test-suite-legacy/__snapshots__/format.test.js.snap @@ -0,0 +1,1613 @@ +// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing + +exports[`snippet: 0.13/example-170.md (List items) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +- foo + + bar + +- foo + + + bar + +- \`\`\` + foo + + + bar + \`\`\` + +=====================================output===================================== +- foo + + bar + +- foo + + bar + +- \`\`\` + foo + + + bar + \`\`\` + +================================================================================ +`; + +exports[`snippet: 0.13/example-195.md (List items) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +- + +=====================================output===================================== +- + +================================================================================ +`; + +exports[`snippet: 0.15/example-46.md (Setext headers) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +Foo + --- + +=====================================output===================================== +Foo --- + +================================================================================ +`; + +exports[`snippet: 0.15/example-449.md (Links) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +[foo\`]: /url + +[foo\`]\` + +=====================================output===================================== +[foo\`]: /url + +[foo\`]\` + +================================================================================ +`; + +exports[`snippet: 0.15/example-521.md (Hard line breaks) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +foo + +=====================================output===================================== +foo + +================================================================================ +`; + +exports[`snippet: 0.15/example-523.md (Hard line breaks) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +### foo + +=====================================output===================================== +### foo + +================================================================================ +`; + +exports[`snippet: 0.17/example-384.md (Emphasis and strong emphasis) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +**a + +=====================================output===================================== +**a + +================================================================================ +`; + +exports[`snippet: 0.17/example-385.md (Emphasis and strong emphasis) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +__a + +=====================================output===================================== +**a + +================================================================================ +`; + +exports[`snippet: 0.17/example-421.md (Links) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +[foo + +=====================================output===================================== +[foo + +================================================================================ +`; + +exports[`snippet: 0.17/example-433.md (Links) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +[foo + +[ref]: /uri + +=====================================output===================================== +[foo + +[ref]: /uri + +================================================================================ +`; + +exports[`snippet: 0.17/example-483.md (Autolinks) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== + + +=====================================output===================================== + + +================================================================================ +`; + +exports[`snippet: 0.18/example-281.md (Emphasis and strong emphasis) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +"aa"_"bb"_"cc" + +=====================================output===================================== +"aa"_"bb"_"cc" + +================================================================================ +`; + +exports[`snippet: 0.19/example-25.md (ATX headers) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +#5 bolt + +=====================================output===================================== +#5 bolt + +================================================================================ +`; + +exports[`snippet: 0.19/example-242.md (Entities) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +# Ӓ Ϡ � + +=====================================output===================================== +# Ӓ Ϡ � + +================================================================================ +`; + +exports[`snippet: 0.20/example-103.md (HTML blocks) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== + + +=====================================output===================================== + + +================================================================================ +`; + +exports[`snippet: 0.20/example-104.md (HTML blocks) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +'; +?> + +=====================================output===================================== +'; +?> + +================================================================================ +`; + +exports[`snippet: 0.20/example-105.md (HTML blocks) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== + + +=====================================output===================================== + + +================================================================================ +`; + +exports[`snippet: 0.20/example-244.md (Entities) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +  & © Æ Ď ¾ ℋ ⅆ ∲ + +=====================================output===================================== +  & © Æ Ď ¾ ℋ ⅆ +∲ + +================================================================================ +`; + +exports[`snippet: 0.22/example-29.md (ATX headers) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +#5 bolt + +#foobar + +=====================================output===================================== +#5 bolt + +#foobar + +================================================================================ +`; + +exports[`snippet: 0.22/example-73.md (Indented code blocks) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +# Header + foo +Header +------ + foo +---- + +=====================================output===================================== +# Header + + foo + +## Header + + foo + +--- + +================================================================================ +`; + +exports[`snippet: 0.22/example-275.md (Backslash escapes) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +\\*not emphasized* +\\
not a tag +\\[not a link](/foo) +\\\`not code\` +1\\. not a list +\\* not a list +\\# not a header +\\[foo]: /url "not a reference" + +=====================================output===================================== +\\*not emphasized\\* \\
not a tag \\[not a link](/foo) \\\`not code\` 1\\. not a +list \\* not a list \\# not a header \\[foo]: /url "not a reference" + +================================================================================ +`; + +exports[`snippet: 0.22/example-289.md (Entities) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +  &x; &#; &#x; &ThisIsWayTooLongToBeAnEntityIsntIt; &hi?; + +=====================================output===================================== +  &x; &#; &#x; &ThisIsWayTooLongToBeAnEntityIsntIt; &hi?; + +================================================================================ +`; + +exports[`snippet: 0.22/example-455.md (Links) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +[link](#fragment) + +[link](http://example.com#fragment) + +[link](http://example.com?foo=bar&baz#fragment) + +=====================================output===================================== +[link](#fragment) + +[link](http://example.com#fragment) + +[link](http://example.com?foo=bar&baz#fragment) + +================================================================================ +`; + +exports[`snippet: 0.22/example-531.md (Images) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +![foo] [bar] + +[bar]: /url + +=====================================output===================================== +![foo] [bar] + +[bar]: /url + +================================================================================ +`; + +exports[`snippet: 0.22/example-532.md (Images) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +![foo] [bar] + +[BAR]: /url + +=====================================output===================================== +![foo] [bar] + +[BAR]: /url + +================================================================================ +`; + +exports[`snippet: 0.22/example-563.md (Raw HTML) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== + + + +foo + + +=====================================output===================================== + + + +foo + + +================================================================================ +`; + +exports[`snippet: 0.22/example-569.md (Raw HTML) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== + + + +=====================================output===================================== + + + +================================================================================ +`; + +exports[`snippet: 0.22/example-577.md (Raw HTML) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== + + +=====================================output===================================== + + +================================================================================ +`; + +exports[`snippet: 0.22/example-578.md (Raw HTML) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== + + +=====================================output===================================== + + +================================================================================ +`; + +exports[`snippet: 0.23/example-58.md (Setext headings) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +Foo +Bar +--- + +Foo +Bar +=== + +=====================================output===================================== +Foo Bar + +--- + +Foo Bar === + +================================================================================ +`; + +exports[`snippet: 0.23/example-292.md (Entity and numeric character references) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +  &x; &#; &#x; +&ThisIsWayTooLongToBeAnEntityIsntIt; &hi?; + +=====================================output===================================== +  &x; &#; &#x; &ThisIsWayTooLongToBeAnEntityIsntIt; &hi?; + +================================================================================ +`; + +exports[`snippet: 0.23/example-301.md (Entity and numeric character references) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== + + +=====================================output===================================== + + +================================================================================ +`; + +exports[`snippet: 0.23/example-558.md (Autolinks) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== + + +=====================================output===================================== + + +================================================================================ +`; + +exports[`snippet: 0.24/example-5.md (Tabs) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +> foo bar + +=====================================output===================================== +> foo bar + +================================================================================ +`; + +exports[`snippet: 0.25/example-33.md (ATX headings) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +# foo + +=====================================output===================================== +# foo + +================================================================================ +`; + +exports[`snippet: 0.25/example-134.md (HTML blocks) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +

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

+import Text.HTML.TagSoup
+
+main :: IO ()
+main = print $ parseTags tags
+
+ +================================================================================ +`; + +exports[`snippet: 0.25/example-135.md (HTML blocks) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== + + +=====================================output===================================== + + +================================================================================ +`; + +exports[`snippet: 0.25/example-136.md (HTML blocks) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== + + +=====================================output===================================== + + +================================================================================ +`; + +exports[`snippet: 0.25/example-143.md (HTML blocks) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== + + +=====================================output===================================== + + +================================================================================ +`; + +exports[`snippet: 0.25/example-144.md (HTML blocks) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +'; + +?> + +=====================================output===================================== +'; + +?> + +================================================================================ +`; + +exports[`snippet: 0.25/example-146.md (HTML blocks) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== + + +=====================================output===================================== + + +================================================================================ +`; + +exports[`snippet: 0.25/example-222.md (List items) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +- foo + + bar + +- foo + + + bar + +- \`\`\` + foo + + + bar + \`\`\` + +- baz + + + \`\`\` + foo + + + bar + \`\`\` + +=====================================output===================================== +- foo + + bar + +- foo + + bar + +- \`\`\` + foo + + + bar + \`\`\` + +- baz + - \`\`\` + foo + + + bar + \`\`\` + +================================================================================ +`; + +exports[`snippet: 0.25/example-224.md (List items) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +- Foo + + bar + + baz + +=====================================output===================================== +- Foo + + bar + + baz + +================================================================================ +`; + +exports[`snippet: 0.25/example-253.md (List items) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +- foo + - bar + - baz + +=====================================output===================================== +- foo + - bar + - baz + +================================================================================ +`; + +exports[`snippet: 0.25/example-254.md (List items) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +- foo + - bar + - baz + +=====================================output===================================== +- foo +- bar +- baz + +================================================================================ +`; + +exports[`snippet: 0.25/example-265.md (Lists) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +- foo + + + bar +- baz + +=====================================output===================================== +- foo + + bar + +- baz + +================================================================================ +`; + +exports[`snippet: 0.25/example-267.md (Lists) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +- foo +- bar + + +- baz +- bim + +=====================================output===================================== +- foo +- bar + +- baz +- bim + +================================================================================ +`; + +exports[`snippet: 0.25/example-268.md (Lists) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +- foo + + notcode + +- foo + + + code + +=====================================output===================================== +- foo + + notcode + +- foo + + code + +================================================================================ +`; + +exports[`snippet: 0.25/example-441.md (Emphasis and strong emphasis) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +**foo*bar** + +=====================================output===================================== +**foo\\*bar** + +================================================================================ +`; + +exports[`snippet: 0.27/example-465.md (Links) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +[link]((foo)and(bar)) + +=====================================output===================================== +[link](<(foo)and(bar)>) + +================================================================================ +`; + +exports[`snippet: 0.27/example-467.md (Links) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +[link](foo(and\\(bar\\))) + +=====================================output===================================== +[link]() + +================================================================================ +`; + +exports[`snippet: 0.27/example-468.md (Links) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +[link]() + +=====================================output===================================== +[link]() + +================================================================================ +`; + +exports[`snippet: 0.27/example-561.md (Images) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +\\!\\[foo] + +[foo]: /url "title" + +=====================================output===================================== +\\!\\[foo] + +[foo]: /url "title" + +================================================================================ +`; + +exports[`snippet: 0.28/example-162.md (Link reference definitions) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +[Foo bar]: + +'title' + +[Foo bar] + +=====================================output===================================== +[Foo bar]: my%20url "title" + +[Foo bar] + +================================================================================ +`; + +exports[`snippet: 0.28/example-273.md (Lists) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +- a + - b + - c + - d + - e + - f + - g + - h +- i + +=====================================output===================================== +- a +- b +- c +- d +- e +- f +- g +- h +- i + +================================================================================ +`; + +exports[`snippet: 0.28/example-291.md (Backslash escapes) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +\\*not emphasized* +\\
not a tag +\\[not a link](/foo) +\\\`not code\` +1\\. not a list +\\* not a list +\\# not a heading +\\[foo]: /url "not a reference" + +=====================================output===================================== +\\*not emphasized\\* \\
not a tag \\[not a link](/foo) \\\`not code\` 1\\. not a +list \\* not a list \\# not a heading \\[foo]: /url "not a reference" + +================================================================================ +`; + +exports[`snippet: 0.28/example-303.md (Entity and numeric character references) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +# Ӓ Ϡ � � + +=====================================output===================================== +# Ӓ Ϡ � � + +================================================================================ +`; + +exports[`snippet: 0.28/example-305.md (Entity and numeric character references) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +  &x; &#; &#x; +&ThisIsNotDefined; &hi?; + +=====================================output===================================== +  &x; &#; &#x; &ThisIsNotDefined; &hi?; + +================================================================================ +`; + +exports[`snippet: 0.28/example-315.md (Code spans) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +\`\` foo \` bar \`\` + +=====================================output===================================== +\`\`foo \` bar \`\` + +================================================================================ +`; + +exports[`snippet: 0.28/example-318.md (Code spans) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +\`foo bar + baz\` + +=====================================output===================================== +\`foo bar baz\` + +================================================================================ +`; + +exports[`snippet: 0.28/example-319.md (Code spans) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +\`a  b\` + +=====================================output===================================== +\`a  b\` + +================================================================================ +`; + +exports[`snippet: 0.28/example-320.md (Code spans) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +\`foo \`\` bar\` + +=====================================output===================================== +\`foo \`\` bar\` + +================================================================================ +`; + +exports[`snippet: 0.28/example-592.md (Raw HTML) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +< a>< +foo> + +=====================================output===================================== +< a>< foo> + +================================================================================ +`; + +exports[`snippet: 0.29/example-314.md (Entity and numeric character references) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +  &x; &#; &#x; +� +&#abcdef0; +&ThisIsNotDefined; &hi?; + +=====================================output===================================== +  &x; &#; &#x; � &#abcdef0; &ThisIsNotDefined; &hi?; + +================================================================================ +`; + +exports[`snippet: 0.29/example-531.md (Links) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +[foo *bar][ref] + +[ref]: /uri + +=====================================output===================================== +[foo \\*bar][ref] + +[ref]: /uri + +================================================================================ +`; + +exports[`snippet: 0.29/example-536.md (Links) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +[Толпой][Толпой] is a Russian word. + +[ТОЛПОЙ]: /url + +=====================================output===================================== +[Толпой][Толпой] is a Russian word. + +[ТОЛПОЙ]: /url + +================================================================================ +`; + +exports[`snippet: 0.29/example-637.md (Hard line breaks) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +\`code +span\` + +=====================================output===================================== +\`code span\` + +================================================================================ +`; + +exports[`snippet: 0.30/example-20.md (Backslash escapes) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== + + +=====================================output===================================== + + +================================================================================ +`; + +exports[`snippet: 0.30/example-345.md (Code spans) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +\`\` + +=====================================output===================================== +\`\` + +================================================================================ +`; + +exports[`snippet: 0.30/example-346.md (Code spans) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +\` + +=====================================output===================================== +\` + +================================================================================ +`; + +exports[`snippet: 0.30/example-479.md (Emphasis and strong emphasis) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +**a + +=====================================output===================================== +**a + +================================================================================ +`; + +exports[`snippet: 0.30/example-480.md (Emphasis and strong emphasis) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +__a + +=====================================output===================================== +**a + +================================================================================ +`; + +exports[`snippet: 0.30/example-500.md (Links) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +[link](#fragment) + +[link](http://example.com#fragment) + +[link](http://example.com?foo=3#frag) + +=====================================output===================================== +[link](#fragment) + +[link](http://example.com#fragment) + +[link](http://example.com?foo=3#frag) + +================================================================================ +`; + +exports[`snippet: 0.30/example-525.md (Links) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +[foo + +=====================================output===================================== +[foo + +================================================================================ +`; + +exports[`snippet: 0.30/example-537.md (Links) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +[foo + +[ref]: /uri + +=====================================output===================================== +[foo + +[ref]: /uri + +================================================================================ +`; + +exports[`snippet: 0.30/example-594.md (Autolinks) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== + + +=====================================output===================================== + + +================================================================================ +`; + +exports[`snippet: 0.30/example-599.md (Autolinks) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== + + +=====================================output===================================== + + +================================================================================ +`; + +exports[`snippet: 0.30/example-601.md (Autolinks) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== + + +=====================================output===================================== + + +================================================================================ +`; + +exports[`snippet: 0.30/example-602.md (Autolinks) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== + + +=====================================output===================================== + + +================================================================================ +`; + +exports[`snippet: 0.30/example-607.md (Autolinks) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +< http://foo.bar > + +=====================================output===================================== +< http://foo.bar > + +================================================================================ +`; + +exports[`snippet: 0.30/example-610.md (Autolinks) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +http://example.com + +=====================================output===================================== +http://example.com + +================================================================================ +`; + +exports[`snippet: 0.30/example-624.md (Raw HTML) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +foo + +=====================================output===================================== +foo + +================================================================================ +`; + +exports[`snippet: 0.30/example-625.md (Raw HTML) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +foo + +=====================================output===================================== +foo + +================================================================================ +`; + +exports[`snippet: 0.30/example-626.md (Raw HTML) - {"proseWrap":"always"} format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 +proseWrap: "always" + | printWidth +=====================================input====================================== +foo foo --> + +foo + +=====================================output===================================== +foo foo --> + +foo + +================================================================================ +`; diff --git a/tests/format/markdown/commonmark-test-suite-legacy/format.test.js b/tests/format/markdown/commonmark-test-suite-legacy/format.test.js new file mode 100644 index 000000000..96ad7c24a --- /dev/null +++ b/tests/format/markdown/commonmark-test-suite-legacy/format.test.js @@ -0,0 +1,45 @@ +import commonmarkTestSuite from "commonmark-test-suite"; + +const BUGS = new Set(); + +const exclude = new Set( + commonmarkTestSuite.latest.testCases.map(({ markdown }) => markdown), +); +const testCases = []; +for (const release of Object.values(commonmarkTestSuite)) { + if (release === commonmarkTestSuite.latest) { + continue; + } + + for (const testCase of release.testCases) { + const { markdown } = testCase; + if (exclude.has(markdown)) { + continue; + } + exclude.add(markdown); + testCases.push({ version: release.version, ...testCase }); + } +} + +runFormatTest( + { + importMeta: import.meta, + snippets: testCases + .map(({ version, section, markdown: input, example }) => { + const filename = `${version}/example-${example}.md`; + + if (BUGS.has(filename)) { + return; + } + + return { + name: `${filename} (${section})`, + filename, + code: input, + }; + }) + .filter(Boolean), + }, + ["markdown"], + { proseWrap: "always" }, +); diff --git a/tests/format/markdown/commonmark-test-suite/format.test.js b/tests/format/markdown/commonmark-test-suite/format.test.js index af88ead54..228ac9292 100644 --- a/tests/format/markdown/commonmark-test-suite/format.test.js +++ b/tests/format/markdown/commonmark-test-suite/format.test.js @@ -1,4 +1,4 @@ -import { commonmark as commonmarkTestSuite } from "commonmark.json"; +import commonmarkTestSuite from "commonmark-test-suite"; const BUGS = new Set([ "example-11.md", @@ -18,15 +18,16 @@ const BUGS = new Set([ runFormatTest( { importMeta: import.meta, - snippets: commonmarkTestSuite - .map(({ section, markdown: input }, index) => { - const filename = `example-${index + 1}.md`; + snippets: commonmarkTestSuite.latest.testCases + .map(({ section, markdown: input, example }) => { + const filename = `example-${example}.md`; + if (BUGS.has(filename)) { return; } return { - name: `example-${index + 1}.md (${section})`, + name: `${filename} (${section})`, filename, code: input, }; diff --git a/tests/format/markdown/spec-legacy/__snapshots__/format.test.js.snap b/tests/format/markdown/spec-legacy/__snapshots__/format.test.js.snap index caff7db09..e053af992 100644 --- a/tests/format/markdown/spec-legacy/__snapshots__/format.test.js.snap +++ b/tests/format/markdown/spec-legacy/__snapshots__/format.test.js.snap @@ -66,21 +66,6 @@ proseWrap: "always" ================================================================================ `; -exports[`example-33.md - {"proseWrap":"always"} format 1`] = ` -====================================options===================================== -parsers: ["markdown"] -printWidth: 80 -proseWrap: "always" - | printWidth -=====================================input====================================== -# foo - -=====================================output===================================== -# foo - -================================================================================ -`; - exports[`example-46.md - {"proseWrap":"always"} format 1`] = ` ====================================options===================================== parsers: ["markdown"] @@ -106,181 +91,6 @@ proseWrap: "always" ================================================================================ `; -exports[`example-134.md - {"proseWrap":"always"} format 1`] = ` -====================================options===================================== -parsers: ["markdown"] -printWidth: 80 -proseWrap: "always" - | printWidth -=====================================input====================================== -

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

-import Text.HTML.TagSoup
-
-main :: IO ()
-main = print $ parseTags tags
-
- -================================================================================ -`; - -exports[`example-135.md - {"proseWrap":"always"} format 1`] = ` -====================================options===================================== -parsers: ["markdown"] -printWidth: 80 -proseWrap: "always" - | printWidth -=====================================input====================================== - - -=====================================output===================================== - - -================================================================================ -`; - -exports[`example-136.md - {"proseWrap":"always"} format 1`] = ` -====================================options===================================== -parsers: ["markdown"] -printWidth: 80 -proseWrap: "always" - | printWidth -=====================================input====================================== - - -=====================================output===================================== - - -================================================================================ -`; - -exports[`example-143.md - {"proseWrap":"always"} format 1`] = ` -====================================options===================================== -parsers: ["markdown"] -printWidth: 80 -proseWrap: "always" - | printWidth -=====================================input====================================== - - -=====================================output===================================== - - -================================================================================ -`; - -exports[`example-144.md - {"proseWrap":"always"} format 1`] = ` -====================================options===================================== -parsers: ["markdown"] -printWidth: 80 -proseWrap: "always" - | printWidth -=====================================input====================================== -'; - -?> - -=====================================output===================================== -'; - -?> - -================================================================================ -`; - -exports[`example-146.md - {"proseWrap":"always"} format 1`] = ` -====================================options===================================== -parsers: ["markdown"] -printWidth: 80 -proseWrap: "always" - | printWidth -=====================================input====================================== - - -=====================================output===================================== - - -================================================================================ -`; - -exports[`example-159.md - {"proseWrap":"always"} format 1`] = ` -====================================options===================================== -parsers: ["markdown"] -printWidth: 80 -proseWrap: "always" - | printWidth -=====================================input====================================== -[Foo bar]: - -'title' - -[Foo bar] - -=====================================output===================================== -[Foo bar]: my%20url "title" - -[Foo bar] - -================================================================================ -`; - exports[`example-215.md - {"proseWrap":"always"} format 1`] = ` ====================================options===================================== parsers: ["markdown"] @@ -299,735 +109,3 @@ two ================================================================================ `; - -exports[`example-222.md - {"proseWrap":"always"} format 1`] = ` -====================================options===================================== -parsers: ["markdown"] -printWidth: 80 -proseWrap: "always" - | printWidth -=====================================input====================================== -- foo - - bar - -- foo - - - bar - -- \`\`\` - foo - - - bar - \`\`\` - -- baz - - + \`\`\` - foo - - - bar - \`\`\` - -=====================================output===================================== -- foo - - bar - -- foo - - bar - -- \`\`\` - foo - - - bar - \`\`\` - -- baz - - \`\`\` - foo - - - bar - \`\`\` - -================================================================================ -`; - -exports[`example-224.md - {"proseWrap":"always"} format 1`] = ` -====================================options===================================== -parsers: ["markdown"] -printWidth: 80 -proseWrap: "always" - | printWidth -=====================================input====================================== -- Foo - - bar - - baz - -=====================================output===================================== -- Foo - - bar - - baz - -================================================================================ -`; - -exports[`example-253.md - {"proseWrap":"always"} format 1`] = ` -====================================options===================================== -parsers: ["markdown"] -printWidth: 80 -proseWrap: "always" - | printWidth -=====================================input====================================== -- foo - - bar - - baz - -=====================================output===================================== -- foo - - bar - - baz - -================================================================================ -`; - -exports[`example-254.md - {"proseWrap":"always"} format 1`] = ` -====================================options===================================== -parsers: ["markdown"] -printWidth: 80 -proseWrap: "always" - | printWidth -=====================================input====================================== -- foo - - bar - - baz - -=====================================output===================================== -- foo -- bar -- baz - -================================================================================ -`; - -exports[`example-265.md - {"proseWrap":"always"} format 1`] = ` -====================================options===================================== -parsers: ["markdown"] -printWidth: 80 -proseWrap: "always" - | printWidth -=====================================input====================================== -- foo - - - bar -- baz - -=====================================output===================================== -- foo - - bar - -- baz - -================================================================================ -`; - -exports[`example-267.md - {"proseWrap":"always"} format 1`] = ` -====================================options===================================== -parsers: ["markdown"] -printWidth: 80 -proseWrap: "always" - | printWidth -=====================================input====================================== -- foo -- bar - - -- baz -- bim - -=====================================output===================================== -- foo -- bar - -- baz -- bim - -================================================================================ -`; - -exports[`example-268.md - {"proseWrap":"always"} format 1`] = ` -====================================options===================================== -parsers: ["markdown"] -printWidth: 80 -proseWrap: "always" - | printWidth -=====================================input====================================== -- foo - - notcode - -- foo - - - code - -=====================================output===================================== -- foo - - notcode - -- foo - - code - -================================================================================ -`; - -exports[`example-269.md - {"proseWrap":"always"} format 1`] = ` -====================================options===================================== -parsers: ["markdown"] -printWidth: 80 -proseWrap: "always" - | printWidth -=====================================input====================================== -- a - - b - - c - - d - - e - - f - - g - - h -- i - -=====================================output===================================== -- a -- b -- c -- d -- e -- f -- g -- h -- i - -================================================================================ -`; - -exports[`example-287.md - {"proseWrap":"always"} format 1`] = ` -====================================options===================================== -parsers: ["markdown"] -printWidth: 80 -proseWrap: "always" - | printWidth -=====================================input====================================== -\\*not emphasized* -\\
not a tag -\\[not a link](/foo) -\\\`not code\` -1\\. not a list -\\* not a list -\\# not a heading -\\[foo]: /url "not a reference" - -=====================================output===================================== -\\*not emphasized\\* \\
not a tag \\[not a link](/foo) \\\`not code\` 1\\. not a -list \\* not a list \\# not a heading \\[foo]: /url "not a reference" - -================================================================================ -`; - -exports[`example-293.md - {"proseWrap":"always"} format 1`] = ` -====================================options===================================== -parsers: ["markdown"] -printWidth: 80 -proseWrap: "always" - | printWidth -=====================================input====================================== - - -=====================================output===================================== - - -================================================================================ -`; - -exports[`example-299.md - {"proseWrap":"always"} format 1`] = ` -====================================options===================================== -parsers: ["markdown"] -printWidth: 80 -proseWrap: "always" - | printWidth -=====================================input====================================== -# Ӓ Ϡ � � - -=====================================output===================================== -# Ӓ Ϡ � � - -================================================================================ -`; - -exports[`example-301.md - {"proseWrap":"always"} format 1`] = ` -====================================options===================================== -parsers: ["markdown"] -printWidth: 80 -proseWrap: "always" - | printWidth -=====================================input====================================== -  &x; &#; &#x; -&ThisIsNotDefined; &hi?; - -=====================================output===================================== -  &x; &#; &#x; &ThisIsNotDefined; &hi?; - -================================================================================ -`; - -exports[`example-311.md - {"proseWrap":"always"} format 1`] = ` -====================================options===================================== -parsers: ["markdown"] -printWidth: 80 -proseWrap: "always" - | printWidth -=====================================input====================================== -\`\` foo \` bar \`\` - -=====================================output===================================== -\`\`foo \` bar \`\` - -================================================================================ -`; - -exports[`example-314.md - {"proseWrap":"always"} format 1`] = ` -====================================options===================================== -parsers: ["markdown"] -printWidth: 80 -proseWrap: "always" - | printWidth -=====================================input====================================== -\`foo bar - baz\` - -=====================================output===================================== -\`foo bar baz\` - -================================================================================ -`; - -exports[`example-315.md - {"proseWrap":"always"} format 1`] = ` -====================================options===================================== -parsers: ["markdown"] -printWidth: 80 -proseWrap: "always" - | printWidth -=====================================input====================================== -\`foo \`\` bar\` - -=====================================output===================================== -\`foo \`\` bar\` - -================================================================================ -`; - -exports[`example-321.md - {"proseWrap":"always"} format 1`] = ` -====================================options===================================== -parsers: ["markdown"] -printWidth: 80 -proseWrap: "always" - | printWidth -=====================================input====================================== -\`\` - -=====================================output===================================== -\`\` - -================================================================================ -`; - -exports[`example-322.md - {"proseWrap":"always"} format 1`] = ` -====================================options===================================== -parsers: ["markdown"] -printWidth: 80 -proseWrap: "always" - | printWidth -=====================================input====================================== -\` - -=====================================output===================================== -\` - -================================================================================ -`; - -exports[`example-441.md - {"proseWrap":"always"} format 1`] = ` -====================================options===================================== -parsers: ["markdown"] -printWidth: 80 -proseWrap: "always" - | printWidth -=====================================input====================================== -**foo*bar** - -=====================================output===================================== -**foo\\*bar** - -================================================================================ -`; - -exports[`example-452.md - {"proseWrap":"always"} format 1`] = ` -====================================options===================================== -parsers: ["markdown"] -printWidth: 80 -proseWrap: "always" - | printWidth -=====================================input====================================== -**a - -=====================================output===================================== -**a - -================================================================================ -`; - -exports[`example-453.md - {"proseWrap":"always"} format 1`] = ` -====================================options===================================== -parsers: ["markdown"] -printWidth: 80 -proseWrap: "always" - | printWidth -=====================================input====================================== -__a - -=====================================output===================================== -**a - -================================================================================ -`; - -exports[`example-463.md - {"proseWrap":"always"} format 1`] = ` -====================================options===================================== -parsers: ["markdown"] -printWidth: 80 -proseWrap: "always" - | printWidth -=====================================input====================================== -[link]((foo)and(bar)) - -=====================================output===================================== -[link](<(foo)and(bar)>) - -================================================================================ -`; - -exports[`example-465.md - {"proseWrap":"always"} format 1`] = ` -====================================options===================================== -parsers: ["markdown"] -printWidth: 80 -proseWrap: "always" - | printWidth -=====================================input====================================== -[link](foo(and\\(bar\\))) - -=====================================output===================================== -[link]() - -================================================================================ -`; - -exports[`example-466.md - {"proseWrap":"always"} format 1`] = ` -====================================options===================================== -parsers: ["markdown"] -printWidth: 80 -proseWrap: "always" - | printWidth -=====================================input====================================== -[link]() - -=====================================output===================================== -[link]() - -================================================================================ -`; - -exports[`example-468.md - {"proseWrap":"always"} format 1`] = ` -====================================options===================================== -parsers: ["markdown"] -printWidth: 80 -proseWrap: "always" - | printWidth -=====================================input====================================== -[link](#fragment) - -[link](http://example.com#fragment) - -[link](http://example.com?foo=3#frag) - -=====================================output===================================== -[link](#fragment) - -[link](http://example.com#fragment) - -[link](http://example.com?foo=3#frag) - -================================================================================ -`; - -exports[`example-492.md - {"proseWrap":"always"} format 1`] = ` -====================================options===================================== -parsers: ["markdown"] -printWidth: 80 -proseWrap: "always" - | printWidth -=====================================input====================================== -[foo - -=====================================output===================================== -[foo - -================================================================================ -`; - -exports[`example-501.md - {"proseWrap":"always"} format 1`] = ` -====================================options===================================== -parsers: ["markdown"] -printWidth: 80 -proseWrap: "always" - | printWidth -=====================================input====================================== -[foo *bar][ref] - -[ref]: /uri - -=====================================output===================================== -[foo \\*bar][ref] - -[ref]: /uri - -================================================================================ -`; - -exports[`example-504.md - {"proseWrap":"always"} format 1`] = ` -====================================options===================================== -parsers: ["markdown"] -printWidth: 80 -proseWrap: "always" - | printWidth -=====================================input====================================== -[foo - -[ref]: /uri - -=====================================output===================================== -[foo - -[ref]: /uri - -================================================================================ -`; - -exports[`example-506.md - {"proseWrap":"always"} format 1`] = ` -====================================options===================================== -parsers: ["markdown"] -printWidth: 80 -proseWrap: "always" - | printWidth -=====================================input====================================== -[Толпой][Толпой] is a Russian word. - -[ТОЛПОЙ]: /url - -=====================================output===================================== -[Толпой][Толпой] is a Russian word. - -[ТОЛПОЙ]: /url - -================================================================================ -`; - -exports[`example-555.md - {"proseWrap":"always"} format 1`] = ` -====================================options===================================== -parsers: ["markdown"] -printWidth: 80 -proseWrap: "always" - | printWidth -=====================================input====================================== -\\!\\[foo] - -[foo]: /url "title" - -=====================================output===================================== -\\!\\[foo] - -[foo]: /url "title" - -================================================================================ -`; - -exports[`example-558.md - {"proseWrap":"always"} format 1`] = ` -====================================options===================================== -parsers: ["markdown"] -printWidth: 80 -proseWrap: "always" - | printWidth -=====================================input====================================== - - -=====================================output===================================== - - -================================================================================ -`; - -exports[`example-563.md - {"proseWrap":"always"} format 1`] = ` -====================================options===================================== -parsers: ["markdown"] -printWidth: 80 -proseWrap: "always" - | printWidth -=====================================input====================================== - - -=====================================output===================================== - - -================================================================================ -`; - -exports[`example-565.md - {"proseWrap":"always"} format 1`] = ` -====================================options===================================== -parsers: ["markdown"] -printWidth: 80 -proseWrap: "always" - | printWidth -=====================================input====================================== - - -=====================================output===================================== - - -================================================================================ -`; - -exports[`example-566.md - {"proseWrap":"always"} format 1`] = ` -====================================options===================================== -parsers: ["markdown"] -printWidth: 80 -proseWrap: "always" - | printWidth -=====================================input====================================== - - -=====================================output===================================== - - -================================================================================ -`; - -exports[`example-571.md - {"proseWrap":"always"} format 1`] = ` -====================================options===================================== -parsers: ["markdown"] -printWidth: 80 -proseWrap: "always" - | printWidth -=====================================input====================================== -< http://foo.bar > - -=====================================output===================================== -< http://foo.bar > - -================================================================================ -`; - -exports[`example-574.md - {"proseWrap":"always"} format 1`] = ` -====================================options===================================== -parsers: ["markdown"] -printWidth: 80 -proseWrap: "always" - | printWidth -=====================================input====================================== -http://example.com - -=====================================output===================================== -http://example.com - -================================================================================ -`; - -exports[`example-584.md - {"proseWrap":"always"} format 1`] = ` -====================================options===================================== -parsers: ["markdown"] -printWidth: 80 -proseWrap: "always" - | printWidth -=====================================input====================================== -< a>< -foo> - -=====================================output===================================== -< a>< foo> - -================================================================================ -`; - -exports[`example-588.md - {"proseWrap":"always"} format 1`] = ` -====================================options===================================== -parsers: ["markdown"] -printWidth: 80 -proseWrap: "always" - | printWidth -=====================================input====================================== -foo - -=====================================output===================================== -foo - -================================================================================ -`; - -exports[`example-589.md - {"proseWrap":"always"} format 1`] = ` -====================================options===================================== -parsers: ["markdown"] -printWidth: 80 -proseWrap: "always" - | printWidth -=====================================input====================================== -foo - -=====================================output===================================== -foo - -================================================================================ -`; - -exports[`example-590.md - {"proseWrap":"always"} format 1`] = ` -====================================options===================================== -parsers: ["markdown"] -printWidth: 80 -proseWrap: "always" - | printWidth -=====================================input====================================== -foo foo --> - -foo - -=====================================output===================================== -foo foo --> - -foo - -================================================================================ -`; diff --git a/tests/format/markdown/spec-legacy/example-134.md b/tests/format/markdown/spec-legacy/example-134.md deleted file mode 100644 index 946242a2f..000000000 --- a/tests/format/markdown/spec-legacy/example-134.md +++ /dev/null @@ -1,6 +0,0 @@ -

-import Text.HTML.TagSoup
-
-main :: IO ()
-main = print $ parseTags tags
-
diff --git a/tests/format/markdown/spec-legacy/example-135.md b/tests/format/markdown/spec-legacy/example-135.md deleted file mode 100644 index fbe48f46e..000000000 --- a/tests/format/markdown/spec-legacy/example-135.md +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/tests/format/markdown/spec-legacy/example-136.md b/tests/format/markdown/spec-legacy/example-136.md deleted file mode 100644 index 7d6867d4b..000000000 --- a/tests/format/markdown/spec-legacy/example-136.md +++ /dev/null @@ -1,6 +0,0 @@ - diff --git a/tests/format/markdown/spec-legacy/example-143.md b/tests/format/markdown/spec-legacy/example-143.md deleted file mode 100644 index b2cdb20e2..000000000 --- a/tests/format/markdown/spec-legacy/example-143.md +++ /dev/null @@ -1,4 +0,0 @@ - diff --git a/tests/format/markdown/spec-legacy/example-144.md b/tests/format/markdown/spec-legacy/example-144.md deleted file mode 100644 index 5a7942884..000000000 --- a/tests/format/markdown/spec-legacy/example-144.md +++ /dev/null @@ -1,5 +0,0 @@ -'; - -?> diff --git a/tests/format/markdown/spec-legacy/example-146.md b/tests/format/markdown/spec-legacy/example-146.md deleted file mode 100644 index bd3b74794..000000000 --- a/tests/format/markdown/spec-legacy/example-146.md +++ /dev/null @@ -1,12 +0,0 @@ - diff --git a/tests/format/markdown/spec-legacy/example-159.md b/tests/format/markdown/spec-legacy/example-159.md deleted file mode 100644 index 408d9ceec..000000000 --- a/tests/format/markdown/spec-legacy/example-159.md +++ /dev/null @@ -1,5 +0,0 @@ -[Foo bar]: - -'title' - -[Foo bar] diff --git a/tests/format/markdown/spec-legacy/example-222.md b/tests/format/markdown/spec-legacy/example-222.md deleted file mode 100644 index dfb6d78d0..000000000 --- a/tests/format/markdown/spec-legacy/example-222.md +++ /dev/null @@ -1,24 +0,0 @@ -- foo - - bar - -- foo - - - bar - -- ``` - foo - - - bar - ``` - -- baz - - + ``` - foo - - - bar - ``` diff --git a/tests/format/markdown/spec-legacy/example-224.md b/tests/format/markdown/spec-legacy/example-224.md deleted file mode 100644 index a4d6c5e64..000000000 --- a/tests/format/markdown/spec-legacy/example-224.md +++ /dev/null @@ -1,5 +0,0 @@ -- Foo - - bar - - baz diff --git a/tests/format/markdown/spec-legacy/example-253.md b/tests/format/markdown/spec-legacy/example-253.md deleted file mode 100644 index 5cb3457ae..000000000 --- a/tests/format/markdown/spec-legacy/example-253.md +++ /dev/null @@ -1,3 +0,0 @@ -- foo - - bar - - baz diff --git a/tests/format/markdown/spec-legacy/example-254.md b/tests/format/markdown/spec-legacy/example-254.md deleted file mode 100644 index 695a24ccc..000000000 --- a/tests/format/markdown/spec-legacy/example-254.md +++ /dev/null @@ -1,3 +0,0 @@ -- foo - - bar - - baz diff --git a/tests/format/markdown/spec-legacy/example-265.md b/tests/format/markdown/spec-legacy/example-265.md deleted file mode 100644 index ba1fa6957..000000000 --- a/tests/format/markdown/spec-legacy/example-265.md +++ /dev/null @@ -1,5 +0,0 @@ -- foo - - - bar -- baz diff --git a/tests/format/markdown/spec-legacy/example-267.md b/tests/format/markdown/spec-legacy/example-267.md deleted file mode 100644 index b7e24153b..000000000 --- a/tests/format/markdown/spec-legacy/example-267.md +++ /dev/null @@ -1,6 +0,0 @@ -- foo -- bar - - -- baz -- bim diff --git a/tests/format/markdown/spec-legacy/example-268.md b/tests/format/markdown/spec-legacy/example-268.md deleted file mode 100644 index aac8f8bde..000000000 --- a/tests/format/markdown/spec-legacy/example-268.md +++ /dev/null @@ -1,8 +0,0 @@ -- foo - - notcode - -- foo - - - code diff --git a/tests/format/markdown/spec-legacy/example-269.md b/tests/format/markdown/spec-legacy/example-269.md deleted file mode 100644 index 3b69f5fe7..000000000 --- a/tests/format/markdown/spec-legacy/example-269.md +++ /dev/null @@ -1,9 +0,0 @@ -- a - - b - - c - - d - - e - - f - - g - - h -- i diff --git a/tests/format/markdown/spec-legacy/example-287.md b/tests/format/markdown/spec-legacy/example-287.md deleted file mode 100644 index 2589ca693..000000000 --- a/tests/format/markdown/spec-legacy/example-287.md +++ /dev/null @@ -1,8 +0,0 @@ -\*not emphasized* -\
not a tag -\[not a link](/foo) -\`not code` -1\. not a list -\* not a list -\# not a heading -\[foo]: /url "not a reference" diff --git a/tests/format/markdown/spec-legacy/example-293.md b/tests/format/markdown/spec-legacy/example-293.md deleted file mode 100644 index 8617b525e..000000000 --- a/tests/format/markdown/spec-legacy/example-293.md +++ /dev/null @@ -1 +0,0 @@ - diff --git a/tests/format/markdown/spec-legacy/example-299.md b/tests/format/markdown/spec-legacy/example-299.md deleted file mode 100644 index 206e59dff..000000000 --- a/tests/format/markdown/spec-legacy/example-299.md +++ /dev/null @@ -1 +0,0 @@ -# Ӓ Ϡ � � diff --git a/tests/format/markdown/spec-legacy/example-301.md b/tests/format/markdown/spec-legacy/example-301.md deleted file mode 100644 index 28ec95e4f..000000000 --- a/tests/format/markdown/spec-legacy/example-301.md +++ /dev/null @@ -1,2 +0,0 @@ -  &x; &#; &#x; -&ThisIsNotDefined; &hi?; diff --git a/tests/format/markdown/spec-legacy/example-311.md b/tests/format/markdown/spec-legacy/example-311.md deleted file mode 100644 index 2f362f8dc..000000000 --- a/tests/format/markdown/spec-legacy/example-311.md +++ /dev/null @@ -1 +0,0 @@ -`` foo ` bar `` diff --git a/tests/format/markdown/spec-legacy/example-314.md b/tests/format/markdown/spec-legacy/example-314.md deleted file mode 100644 index 3ff02a6f0..000000000 --- a/tests/format/markdown/spec-legacy/example-314.md +++ /dev/null @@ -1,2 +0,0 @@ -`foo bar - baz` diff --git a/tests/format/markdown/spec-legacy/example-315.md b/tests/format/markdown/spec-legacy/example-315.md deleted file mode 100644 index 2c292197f..000000000 --- a/tests/format/markdown/spec-legacy/example-315.md +++ /dev/null @@ -1 +0,0 @@ -`foo `` bar` diff --git a/tests/format/markdown/spec-legacy/example-321.md b/tests/format/markdown/spec-legacy/example-321.md deleted file mode 100644 index f19ec8ad2..000000000 --- a/tests/format/markdown/spec-legacy/example-321.md +++ /dev/null @@ -1 +0,0 @@ -`` diff --git a/tests/format/markdown/spec-legacy/example-322.md b/tests/format/markdown/spec-legacy/example-322.md deleted file mode 100644 index d2257e8d9..000000000 --- a/tests/format/markdown/spec-legacy/example-322.md +++ /dev/null @@ -1 +0,0 @@ -` diff --git a/tests/format/markdown/spec-legacy/example-33.md b/tests/format/markdown/spec-legacy/example-33.md deleted file mode 100644 index 437e042fc..000000000 --- a/tests/format/markdown/spec-legacy/example-33.md +++ /dev/null @@ -1 +0,0 @@ -# foo diff --git a/tests/format/markdown/spec-legacy/example-441.md b/tests/format/markdown/spec-legacy/example-441.md deleted file mode 100644 index b8c1a8783..000000000 --- a/tests/format/markdown/spec-legacy/example-441.md +++ /dev/null @@ -1 +0,0 @@ -**foo*bar** diff --git a/tests/format/markdown/spec-legacy/example-452.md b/tests/format/markdown/spec-legacy/example-452.md deleted file mode 100644 index 1c89122f1..000000000 --- a/tests/format/markdown/spec-legacy/example-452.md +++ /dev/null @@ -1 +0,0 @@ -**a diff --git a/tests/format/markdown/spec-legacy/example-453.md b/tests/format/markdown/spec-legacy/example-453.md deleted file mode 100644 index 4139e2e3f..000000000 --- a/tests/format/markdown/spec-legacy/example-453.md +++ /dev/null @@ -1 +0,0 @@ -__a diff --git a/tests/format/markdown/spec-legacy/example-463.md b/tests/format/markdown/spec-legacy/example-463.md deleted file mode 100644 index ec41195c0..000000000 --- a/tests/format/markdown/spec-legacy/example-463.md +++ /dev/null @@ -1 +0,0 @@ -[link]((foo)and(bar)) diff --git a/tests/format/markdown/spec-legacy/example-465.md b/tests/format/markdown/spec-legacy/example-465.md deleted file mode 100644 index 949df9182..000000000 --- a/tests/format/markdown/spec-legacy/example-465.md +++ /dev/null @@ -1 +0,0 @@ -[link](foo(and\(bar\))) diff --git a/tests/format/markdown/spec-legacy/example-466.md b/tests/format/markdown/spec-legacy/example-466.md deleted file mode 100644 index 7e2cbf295..000000000 --- a/tests/format/markdown/spec-legacy/example-466.md +++ /dev/null @@ -1 +0,0 @@ -[link]() diff --git a/tests/format/markdown/spec-legacy/example-468.md b/tests/format/markdown/spec-legacy/example-468.md deleted file mode 100644 index 01b72bf48..000000000 --- a/tests/format/markdown/spec-legacy/example-468.md +++ /dev/null @@ -1,5 +0,0 @@ -[link](#fragment) - -[link](http://example.com#fragment) - -[link](http://example.com?foo=3#frag) diff --git a/tests/format/markdown/spec-legacy/example-492.md b/tests/format/markdown/spec-legacy/example-492.md deleted file mode 100644 index ba1a93e48..000000000 --- a/tests/format/markdown/spec-legacy/example-492.md +++ /dev/null @@ -1 +0,0 @@ -[foo diff --git a/tests/format/markdown/spec-legacy/example-501.md b/tests/format/markdown/spec-legacy/example-501.md deleted file mode 100644 index b51b714c0..000000000 --- a/tests/format/markdown/spec-legacy/example-501.md +++ /dev/null @@ -1,3 +0,0 @@ -[foo *bar][ref] - -[ref]: /uri diff --git a/tests/format/markdown/spec-legacy/example-504.md b/tests/format/markdown/spec-legacy/example-504.md deleted file mode 100644 index 48ed51887..000000000 --- a/tests/format/markdown/spec-legacy/example-504.md +++ /dev/null @@ -1,3 +0,0 @@ -[foo - -[ref]: /uri diff --git a/tests/format/markdown/spec-legacy/example-506.md b/tests/format/markdown/spec-legacy/example-506.md deleted file mode 100644 index 9fb9ef9b3..000000000 --- a/tests/format/markdown/spec-legacy/example-506.md +++ /dev/null @@ -1,3 +0,0 @@ -[Толпой][Толпой] is a Russian word. - -[ТОЛПОЙ]: /url diff --git a/tests/format/markdown/spec-legacy/example-555.md b/tests/format/markdown/spec-legacy/example-555.md deleted file mode 100644 index 2562ee7fa..000000000 --- a/tests/format/markdown/spec-legacy/example-555.md +++ /dev/null @@ -1,3 +0,0 @@ -\!\[foo] - -[foo]: /url "title" diff --git a/tests/format/markdown/spec-legacy/example-558.md b/tests/format/markdown/spec-legacy/example-558.md deleted file mode 100644 index 69374c3d0..000000000 --- a/tests/format/markdown/spec-legacy/example-558.md +++ /dev/null @@ -1 +0,0 @@ - diff --git a/tests/format/markdown/spec-legacy/example-563.md b/tests/format/markdown/spec-legacy/example-563.md deleted file mode 100644 index 07f7f953d..000000000 --- a/tests/format/markdown/spec-legacy/example-563.md +++ /dev/null @@ -1 +0,0 @@ - diff --git a/tests/format/markdown/spec-legacy/example-565.md b/tests/format/markdown/spec-legacy/example-565.md deleted file mode 100644 index 50d772051..000000000 --- a/tests/format/markdown/spec-legacy/example-565.md +++ /dev/null @@ -1 +0,0 @@ - diff --git a/tests/format/markdown/spec-legacy/example-566.md b/tests/format/markdown/spec-legacy/example-566.md deleted file mode 100644 index 60666934f..000000000 --- a/tests/format/markdown/spec-legacy/example-566.md +++ /dev/null @@ -1 +0,0 @@ - diff --git a/tests/format/markdown/spec-legacy/example-571.md b/tests/format/markdown/spec-legacy/example-571.md deleted file mode 100644 index 3bd027800..000000000 --- a/tests/format/markdown/spec-legacy/example-571.md +++ /dev/null @@ -1 +0,0 @@ -< http://foo.bar > diff --git a/tests/format/markdown/spec-legacy/example-574.md b/tests/format/markdown/spec-legacy/example-574.md deleted file mode 100644 index 7bc94d032..000000000 --- a/tests/format/markdown/spec-legacy/example-574.md +++ /dev/null @@ -1 +0,0 @@ -http://example.com diff --git a/tests/format/markdown/spec-legacy/example-584.md b/tests/format/markdown/spec-legacy/example-584.md deleted file mode 100644 index 4a7cc2694..000000000 --- a/tests/format/markdown/spec-legacy/example-584.md +++ /dev/null @@ -1,2 +0,0 @@ -< a>< -foo> diff --git a/tests/format/markdown/spec-legacy/example-588.md b/tests/format/markdown/spec-legacy/example-588.md deleted file mode 100644 index 6d562af50..000000000 --- a/tests/format/markdown/spec-legacy/example-588.md +++ /dev/null @@ -1,2 +0,0 @@ -foo diff --git a/tests/format/markdown/spec-legacy/example-589.md b/tests/format/markdown/spec-legacy/example-589.md deleted file mode 100644 index 0c2754f00..000000000 --- a/tests/format/markdown/spec-legacy/example-589.md +++ /dev/null @@ -1 +0,0 @@ -foo diff --git a/tests/format/markdown/spec-legacy/example-590.md b/tests/format/markdown/spec-legacy/example-590.md deleted file mode 100644 index 7e97514ab..000000000 --- a/tests/format/markdown/spec-legacy/example-590.md +++ /dev/null @@ -1,3 +0,0 @@ -foo foo --> - -foo diff --git a/tests/format/markdown/spec-legacy/remark-bug/example-160.md b/tests/format/markdown/spec-legacy/remark-bug/example-160.md deleted file mode 100644 index b826fa999..000000000 --- a/tests/format/markdown/spec-legacy/remark-bug/example-160.md +++ /dev/null @@ -1,7 +0,0 @@ -[foo]: /url ' -title -line1 -line2 -' - -[foo] diff --git a/tests/format/markdown/spec-legacy/remark-bug/example-239.md b/tests/format/markdown/spec-legacy/remark-bug/example-239.md deleted file mode 100644 index 055bea79c..000000000 --- a/tests/format/markdown/spec-legacy/remark-bug/example-239.md +++ /dev/null @@ -1,8 +0,0 @@ -- - foo -- - ``` - bar - ``` -- - baz diff --git a/tests/format/markdown/spec-legacy/remark-bug/example-24.md b/tests/format/markdown/spec-legacy/remark-bug/example-24.md deleted file mode 100644 index 4cbca95c5..000000000 --- a/tests/format/markdown/spec-legacy/remark-bug/example-24.md +++ /dev/null @@ -1 +0,0 @@ - *-* diff --git a/tests/format/markdown/spec-legacy/remark-bug/example-270.md b/tests/format/markdown/spec-legacy/remark-bug/example-270.md deleted file mode 100644 index 7ab6fa4e7..000000000 --- a/tests/format/markdown/spec-legacy/remark-bug/example-270.md +++ /dev/null @@ -1,5 +0,0 @@ -1. a - - 2. b - - 3. c diff --git a/tests/format/markdown/spec-legacy/remark-bug/example-275.md b/tests/format/markdown/spec-legacy/remark-bug/example-275.md deleted file mode 100644 index 356ce0c83..000000000 --- a/tests/format/markdown/spec-legacy/remark-bug/example-275.md +++ /dev/null @@ -1,7 +0,0 @@ -- a -- ``` - b - - - ``` -- c diff --git a/tests/format/markdown/spec-legacy/remark-bug/example-323.md b/tests/format/markdown/spec-legacy/remark-bug/example-323.md deleted file mode 100644 index 91630ea73..000000000 --- a/tests/format/markdown/spec-legacy/remark-bug/example-323.md +++ /dev/null @@ -1 +0,0 @@ -```foo`` diff --git a/tests/format/markdown/spec-legacy/remark-bug/example-389.md b/tests/format/markdown/spec-legacy/remark-bug/example-389.md deleted file mode 100644 index de5072150..000000000 --- a/tests/format/markdown/spec-legacy/remark-bug/example-389.md +++ /dev/null @@ -1 +0,0 @@ -*foo **bar *baz* bim** bop* diff --git a/tests/format/markdown/spec-legacy/remark-bug/example-409.md b/tests/format/markdown/spec-legacy/remark-bug/example-409.md deleted file mode 100644 index 7bc24b7d2..000000000 --- a/tests/format/markdown/spec-legacy/remark-bug/example-409.md +++ /dev/null @@ -1 +0,0 @@ -foo *_* diff --git a/tests/format/markdown/spec-legacy/remark-bug/example-416.md b/tests/format/markdown/spec-legacy/remark-bug/example-416.md deleted file mode 100644 index c41584230..000000000 --- a/tests/format/markdown/spec-legacy/remark-bug/example-416.md +++ /dev/null @@ -1 +0,0 @@ -****foo* diff --git a/yarn.lock b/yarn.lock index fc5b7c16b..f75605cf0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3578,10 +3578,10 @@ __metadata: languageName: node linkType: hard -"commonmark.json@npm:0.31.0": - version: 0.31.0 - resolution: "commonmark.json@npm:0.31.0" - checksum: 10/457519df977443df620ef46230ca54b5ab3b5845ea85fc620ebb386eaceaafcc2dae1fa6b6785f858ddf8c55ed597e0c608c95180ea32e45bb97e52d7eb35aae +"commonmark-test-suite@npm:0.1.0": + version: 0.1.0 + resolution: "commonmark-test-suite@npm:0.1.0" + checksum: 10/d50b2e5b7ac48be29d577d1a849e26df38cce35552dd478c499b99a0de2402e4602f404c87bd1f92f404a4a688cb343d79a2261c6015a54ab78631b63e3e319c languageName: node linkType: hard @@ -7541,7 +7541,7 @@ __metadata: ci-info: "npm:4.3.1" cjk-regex: "npm:3.4.0" collapse-white-space: "npm:1.0.6" - commonmark.json: "npm:0.31.0" + commonmark-test-suite: "npm:0.1.0" cross-env: "npm:10.1.0" cspell: "npm:9.3.2" css-units-list: "npm:2.1.0"