Use the built-in github extension set ...and notice pass rate goes down? Hrm…
diff --git a/pkgs/markdown/tool/gfm_stats.json b/pkgs/markdown/tool/gfm_stats.json index 183aa1f..04e3836 100644 --- a/pkgs/markdown/tool/gfm_stats.json +++ b/pkgs/markdown/tool/gfm_stats.json
@@ -1,22 +1,22 @@ { "ATX headings": { - "32": "strict", + "32": "fail", "33": "strict", "34": "strict", "35": "strict", - "36": "strict", - "37": "strict", + "36": "fail", + "37": "fail", "38": "fail", "39": "strict", "40": "loose", "41": "fail", - "42": "strict", - "43": "loose", - "44": "strict", - "45": "loose", - "46": "loose", - "47": "strict", - "48": "strict", + "42": "fail", + "43": "fail", + "44": "fail", + "45": "fail", + "46": "fail", + "47": "fail", + "48": "fail", "49": "fail" }, "Autolinks": { @@ -69,14 +69,14 @@ "308": "fail" }, "Blank lines": { - "188": "strict" + "188": "fail" }, "Block quotes": { - "196": "loose", - "197": "loose", - "198": "loose", + "196": "fail", + "197": "fail", + "198": "fail", "199": "strict", - "200": "loose", + "200": "fail", "201": "loose", "202": "loose", "203": "loose", @@ -285,7 +285,7 @@ "106": "fail", "107": "loose", "108": "strict", - "109": "strict", + "109": "fail", "110": "strict", "111": "strict", "112": "strict", @@ -306,8 +306,8 @@ "636": "strict", "637": "strict", "638": "loose", - "639": "strict", - "640": "strict" + "639": "fail", + "640": "fail" }, "HTML blocks": { "115": "strict", @@ -386,7 +386,7 @@ "81": "strict", "82": "loose", "83": "strict", - "84": "strict", + "84": "fail", "85": "strict", "86": "loose", "87": "strict" @@ -415,7 +415,7 @@ "174": "loose", "175": "strict", "176": "strict", - "177": "loose", + "177": "fail", "178": "strict", "179": "loose" }, @@ -553,7 +553,7 @@ "265": "loose", "266": "loose", "267": "loose", - "268": "loose" + "268": "fail" }, "Lists": { "271": "loose", @@ -618,29 +618,29 @@ "624": "fail" }, "Setext headings": { - "50": "strict", - "51": "strict", - "52": "strict", - "53": "loose", + "50": "fail", + "51": "fail", + "52": "fail", + "53": "fail", "54": "strict", - "55": "strict", + "55": "fail", "56": "loose", "57": "strict", - "58": "loose", - "59": "strict", - "60": "loose", + "58": "fail", + "59": "fail", + "60": "fail", "61": "loose", "62": "fail", "63": "loose", - "64": "strict", - "65": "strict", + "64": "fail", + "65": "fail", "66": "strict", "67": "strict", "68": "loose", "69": "strict", "70": "loose", - "71": "loose", - "72": "strict", + "71": "fail", + "72": "fail", "73": "strict", "74": "strict", "75": "strict" @@ -655,12 +655,12 @@ "467": "strict" }, "Tables (extension)": { - "189": "fail", + "189": "loose", "190": "fail", - "191": "fail", + "191": "loose", "192": "fail", "193": "fail", - "194": "strict", + "194": "fail", "195": "fail" }, "Tabs": { @@ -673,7 +673,7 @@ "7": "loose", "8": "strict", "9": "fail", - "10": "strict", + "10": "fail", "11": "fail" }, "Textual content": { @@ -698,7 +698,7 @@ "26": "loose", "27": "loose", "28": "strict", - "29": "strict", + "29": "fail", "30": "fail", "31": "loose" }
diff --git a/pkgs/markdown/tool/gfm_stats.txt b/pkgs/markdown/tool/gfm_stats.txt index e5f625f..d741636 100644 --- a/pkgs/markdown/tool/gfm_stats.txt +++ b/pkgs/markdown/tool/gfm_stats.txt
@@ -1,31 +1,31 @@ - 15 of 18 – 83.3% ATX headings + 5 of 18 – 27.8% ATX headings 15 of 19 – 78.9% Autolinks 0 of 11 – 0.0% Autolinks (extension) 8 of 13 – 61.5% Backslash escapes - 1 of 1 – 100.0% Blank lines - 22 of 25 – 88.0% Block quotes + 0 of 1 – 0.0% Blank lines + 18 of 25 – 72.0% Block quotes 14 of 16 – 87.5% Code spans 0 of 1 – 0.0% Disallowed Raw HTML (extension) 79 of 128 – 61.7% Emphasis and strong emphasis 10 of 12 – 83.3% Entity and numeric character references - 24 of 27 – 88.9% Fenced code blocks - 15 of 15 – 100.0% Hard line breaks + 23 of 27 – 85.2% Fenced code blocks + 13 of 15 – 86.7% Hard line breaks 42 of 42 – 100.0% HTML blocks 21 of 22 – 95.5% Images - 11 of 12 – 91.7% Indented code blocks + 10 of 12 – 83.3% Indented code blocks 1 of 1 – 100.0% Inlines - 20 of 23 – 87.0% Link reference definitions + 19 of 23 – 82.6% Link reference definitions 56 of 84 – 66.7% Links - 44 of 48 – 91.7% List items + 43 of 48 – 89.6% List items 18 of 24 – 75.0% Lists 8 of 8 – 100.0% Paragraphs 1 of 1 – 100.0% Precedence 15 of 21 – 71.4% Raw HTML - 25 of 26 – 96.2% Setext headings + 13 of 26 – 50.0% Setext headings 2 of 2 – 100.0% Soft line breaks 1 of 3 – 33.3% Strikethrough (extension) - 1 of 7 – 14.3% Tables (extension) - 6 of 11 – 54.5% Tabs + 2 of 7 – 28.6% Tables (extension) + 5 of 11 – 45.5% Tabs 3 of 3 – 100.0% Textual content - 17 of 19 – 89.5% Thematic breaks - 495 of 643 – 77.0% TOTAL + 16 of 19 – 84.2% Thematic breaks + 461 of 643 – 71.7% TOTAL
diff --git a/pkgs/markdown/tool/stats.dart b/pkgs/markdown/tool/stats.dart index 3d17613..e6a785a 100644 --- a/pkgs/markdown/tool/stats.dart +++ b/pkgs/markdown/tool/stats.dart
@@ -8,7 +8,7 @@ import 'package:collection/collection.dart'; import 'package:html/dom.dart'; import 'package:html/parser.dart' show parseFragment; -import 'package:markdown/markdown.dart' show markdownToHtml; +import 'package:markdown/markdown.dart' show markdownToHtml, ExtensionSet; import 'package:path/path.dart' as p; // Locate the "tool" directory. Use mirrors so that this works with the test @@ -28,7 +28,8 @@ negatable: false) ..addFlag('verbose', defaultsTo: false, help: 'verbose output', negatable: false) - ..addOption('flavor', allowed: ['common_mark', 'gfm'], defaultsTo: 'common_mark') + ..addOption('flavor', + allowed: ['common_mark', 'gfm'], defaultsTo: 'common_mark') ..addFlag('help', defaultsTo: false, negatable: false); ArgResults options; @@ -61,6 +62,11 @@ final testPrefix = options['flavor']; + ExtensionSet extensionSet; + if (testPrefix == 'gfm') { + extensionSet = ExtensionSet.gitHub; + } + var sections = _loadCommonMarkSections(testPrefix); var scores = new SplayTreeMap<String, SplayTreeMap<int, CompareLevel>>( @@ -74,7 +80,8 @@ var nestedMap = scores.putIfAbsent( section, () => new SplayTreeMap<int, CompareLevel>()); - nestedMap[e.example] = _compareResult(e, verbose); + nestedMap[e.example] = + _compareResult(e, verbose, extensionSet: extensionSet); } }); @@ -87,10 +94,11 @@ } } -CompareLevel _compareResult(CommonMarkTestCase expected, bool verboseFail) { +CompareLevel _compareResult(CommonMarkTestCase expected, bool verboseFail, + {ExtensionSet extensionSet}) { String output; try { - output = markdownToHtml(expected.markdown); + output = markdownToHtml(expected.markdown, extensionSet: extensionSet); } catch (err, stackTrace) { if (verboseFail) { printVerboseFailure(