Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comply with CommonMark 0.31.2 #412

Closed
Witiko opened this issue Feb 29, 2024 · 0 comments · Fixed by #416
Closed

Comply with CommonMark 0.31.2 #412

Witiko opened this issue Feb 29, 2024 · 0 comments · Fixed by #416
Assignees
Labels
commonmark Related to making the syntax of markdown follow the CommonMark spec
Milestone

Comments

@Witiko
Copy link
Owner

Witiko commented Feb 29, 2024

In #220, @lostenderman added support for CommonMark 0.30. On 2024-01-28, @jgm released CommonMark 0.31.2.

We should review the diff of the spec and the test cases:

$ diff \
> <(wget -qO - https://spec.commonmark.org/0.30/spec.json | grep -Ev '"(start_line|end_line|example)": ')
> <(wget -qO - https://spec.commonmark.org/0.31.2/spec.json | grep -Ev '"(start_line|end_line|example)": ')
98,99c98,99
<     "markdown": "<http://example.com?find=\\*>\n",
<     "html": "<p><a href=\"http://example.com?find=%5C*\">http://example.com?find=\\*</a></p>\n",
---
>     "markdown": "<https://example.com?find=\\*>\n",
>     "html": "<p><a href=\"https://example.com?find=%5C*\">https://example.com?find=\\*</a></p>\n",
1723,1724c1723,1724
<     "markdown": "`<http://foo.bar.`baz>`\n",
<     "html": "<p><code>&lt;http://foo.bar.</code>baz&gt;`</p>\n",
---
>     "markdown": "`<https://foo.bar.`baz>`\n",
>     "html": "<p><code>&lt;https://foo.bar.</code>baz&gt;`</p>\n",
1728,1729c1728,1729
<     "markdown": "<http://foo.bar.`baz>`\n",
<     "html": "<p><a href=\"http://foo.bar.%60baz\">http://foo.bar.`baz</a>`</p>\n",
---
>     "markdown": "<https://foo.bar.`baz>`\n",
>     "html": "<p><a href=\"https://foo.bar.%60baz\">https://foo.bar.`baz</a>`</p>\n",
1767a1768,1772
>     "markdown": "*$*alpha.\n\n*£*bravo.\n\n*€*charlie.\n",
>     "html": "<p>*$*alpha.</p>\n<p>*£*bravo.</p>\n<p>*€*charlie.</p>\n",
>     "section": "Emphasis and strong emphasis"
>   },
>   {
2393,2394c2398,2399
<     "markdown": "**a<http://foo.bar/?q=**>\n",
<     "html": "<p>**a<a href=\"http://foo.bar/?q=**\">http://foo.bar/?q=**</a></p>\n",
---
>     "markdown": "**a<https://foo.bar/?q=**>\n",
>     "html": "<p>**a<a href=\"https://foo.bar/?q=**\">https://foo.bar/?q=**</a></p>\n",
2398,2399c2403,2404
<     "markdown": "__a<http://foo.bar/?q=__>\n",
<     "html": "<p>__a<a href=\"http://foo.bar/?q=__\">http://foo.bar/?q=__</a></p>\n",
---
>     "markdown": "__a<https://foo.bar/?q=__>\n",
>     "html": "<p>__a<a href=\"https://foo.bar/?q=__\">https://foo.bar/?q=__</a></p>\n",
2498,2499c2503,2504
<     "markdown": "[link](#fragment)\n\n[link](http://example.com#fragment)\n\n[link](http://example.com?foo=3#frag)\n",
<     "html": "<p><a href=\"#fragment\">link</a></p>\n<p><a href=\"http://example.com#fragment\">link</a></p>\n<p><a href=\"http://example.com?foo=3#frag\">link</a></p>\n",
---
>     "markdown": "[link](#fragment)\n\n[link](https://example.com#fragment)\n\n[link](https://example.com?foo=3#frag)\n",
>     "html": "<p><a href=\"#fragment\">link</a></p>\n<p><a href=\"https://example.com#fragment\">link</a></p>\n<p><a href=\"https://example.com?foo=3#frag\">link</a></p>\n",
2623,2624c2628,2629
<     "markdown": "[foo<http://example.com/?search=](uri)>\n",
<     "html": "<p>[foo<a href=\"http://example.com/?search=%5D(uri)\">http://example.com/?search=](uri)</a></p>\n",
---
>     "markdown": "[foo<https://example.com/?search=](uri)>\n",
>     "html": "<p>[foo<a href=\"https://example.com/?search=%5D(uri)\">https://example.com/?search=](uri)</a></p>\n",
2683,2684c2688,2689
<     "markdown": "[foo<http://example.com/?search=][ref]>\n\n[ref]: /uri\n",
<     "html": "<p>[foo<a href=\"http://example.com/?search=%5D%5Bref%5D\">http://example.com/?search=][ref]</a></p>\n",
---
>     "markdown": "[foo<https://example.com/?search=][ref]>\n\n[ref]: /uri\n",
>     "html": "<p>[foo<a href=\"https://example.com/?search=%5D%5Bref%5D\">https://example.com/?search=][ref]</a></p>\n",
2968,2969c2973,2974
<     "markdown": "<http://foo.bar.baz/test?q=hello&id=22&boolean>\n",
<     "html": "<p><a href=\"http://foo.bar.baz/test?q=hello&amp;id=22&amp;boolean\">http://foo.bar.baz/test?q=hello&amp;id=22&amp;boolean</a></p>\n",
---
>     "markdown": "<https://foo.bar.baz/test?q=hello&id=22&boolean>\n",
>     "html": "<p><a href=\"https://foo.bar.baz/test?q=hello&amp;id=22&amp;boolean\">https://foo.bar.baz/test?q=hello&amp;id=22&amp;boolean</a></p>\n",
2993,2994c2998,2999
<     "markdown": "<http://../>\n",
<     "html": "<p><a href=\"http://../\">http://../</a></p>\n",
---
>     "markdown": "<https://../>\n",
>     "html": "<p><a href=\"https://../\">https://../</a></p>\n",
3003,3004c3008,3009
<     "markdown": "<http://foo.bar/baz bim>\n",
<     "html": "<p>&lt;http://foo.bar/baz bim&gt;</p>\n",
---
>     "markdown": "<https://foo.bar/baz bim>\n",
>     "html": "<p>&lt;https://foo.bar/baz bim&gt;</p>\n",
3008,3009c3013,3014
<     "markdown": "<http://example.com/\\[\\>\n",
<     "html": "<p><a href=\"http://example.com/%5C%5B%5C\">http://example.com/\\[\\</a></p>\n",
---
>     "markdown": "<https://example.com/\\[\\>\n",
>     "html": "<p><a href=\"https://example.com/%5C%5B%5C\">https://example.com/\\[\\</a></p>\n",
3033,3034c3038,3039
<     "markdown": "< http://foo.bar >\n",
<     "html": "<p>&lt; http://foo.bar &gt;</p>\n",
---
>     "markdown": "< https://foo.bar >\n",
>     "html": "<p>&lt; https://foo.bar &gt;</p>\n",
3048,3049c3053,3054
<     "markdown": "http://example.com\n",
<     "html": "<p>http://example.com</p>\n",
---
>     "markdown": "https://example.com\n",
>     "html": "<p>https://example.com</p>\n",
3118,3124c3123,3124
<     "markdown": "foo <!-- this is a\ncomment - with hyphen -->\n",
<     "html": "<p>foo <!-- this is a\ncomment - with hyphen --></p>\n",
<     "section": "Raw HTML"
<   },
<   {
<     "markdown": "foo <!-- not a comment -- two hyphens -->\n",
<     "html": "<p>foo &lt;!-- not a comment -- two hyphens --&gt;</p>\n",
---
>     "markdown": "foo <!-- this is a --\ncomment - with hyphens -->\n",
>     "html": "<p>foo <!-- this is a --\ncomment - with hyphens --></p>\n",
3128,3129c3128,3129
<     "markdown": "foo <!--> foo -->\n\nfoo <!-- foo--->\n",
<     "html": "<p>foo &lt;!--&gt; foo --&gt;</p>\n<p>foo &lt;!-- foo---&gt;</p>\n",
---
>     "markdown": "foo <!--> foo -->\n\nfoo <!---> foo -->\n",
>     "html": "<p>foo <!--> foo --&gt;</p>\n<p>foo <!---> foo --&gt;</p>\n",

Then, we should update our own test cases and the parser if necessary.

@Witiko Witiko added this to the 3.4.2 milestone Feb 29, 2024
@Witiko Witiko self-assigned this Feb 29, 2024
@Witiko Witiko added the commonmark Related to making the syntax of markdown follow the CommonMark spec label Feb 29, 2024
@Witiko Witiko modified the milestones: 3.4.2, 3.5.0 Mar 8, 2024
@Witiko Witiko assigned lostenderman and unassigned Witiko Mar 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
commonmark Related to making the syntax of markdown follow the CommonMark spec
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants