showdownjs / showdown

A bidirectional Markdown to HTML to Markdown converter written in Javascript
http://www.showdownjs.com/
MIT License
14.19k stars 1.56k forks source link

Add updated CommonMark Tests #918

Closed mansona closed 2 years ago

mansona commented 2 years ago

Hey folks 👋 I'm opening this PR to try to open a conversation about supporting the CommonMark spec. I know by running these tests that there is a long way to go with some of these edge-cases but I thought I would open up the conversation at least 👍

This is mostly continuing on from conversations like https://github.com/showdownjs/showdown/issues/620 just now a few years later when the wider community has moved forward a little bit

codeclimate[bot] commented 2 years ago

Code Climate has analyzed commit f191442e and detected 0 issues on this pull request.

View more on Code Climate.

tivie commented 2 years ago

Ugh. Lots of tests failing. 😅

Thank you for your contribution. I think for version 3.0 we should try to comply with commonmark spec as much as possible. For most part, showdown is already compliant (lists are the only exception, i think).

mansona commented 2 years ago

Yea I guess there are quite a lot of failing tests, but on the plus side there are a lot more passing tests 🎉

If commonmark compliance is something that we care about maybe I could start picking away at some of these tests? I would imagine that a lot of them could be grouped into particular issues that we could start addressing 👍

tivie commented 2 years ago

The good news is that a big chunk of the tests were failing because of formatting issues (such as tabs being replaced with arrows for visibility, or html styling stuff such as newlines, which are invisible in html, added after <li> tags.

The bad news is that some stuff will actually reduce compliance with the github spec. Which is weird since github is a superset of markdown. 🤷