-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Make parsedown 'CommonMark' ready/compliant #213
Comments
To answer your question I guess it's not fully compliant. There are decisions made in Standard Markdown which are not very popular and Parsedown and other libraries should be tested against it. But what I think we should all do in the following months is not make all Markdown parsers including Parsedown compliant with this spec, but instead work on the actual specification. It is not yet stable pending public review and improvements. We should concentrate to make it the best and then work on the parsers when it reaches a stable release. |
I agree with @hkdobrev. Markdown Standard looks promising and I'd love for Parsedown to be compliant with it, but before that, the spec would have to become a bit more stable. |
@hkdobrev: I agree — The spec is best considered as descriptive first, prescriptive second. |
I have added a test suite to test against the Standard Markdown spec. Here it is: https://github.com/hkdobrev/parsedown/commit/6f1fac982335c6c7571f009b10a78ee8f2bad9c5 Currently there is about 40% compatibility (174/441 tests). I hope this will go way up when HTML formatting differences are uniformed. @erusev You could create a new branch (as this should not break any bugfix releases and is not fully backwards compatible) and open a pull request from here: https://github.com/hkdobrev/parsedown/compare/standard-markdown?expand=1 I hope we could improve the testing together (e.g. the assert message could use the section as in the JavaScript test runner, the spec file could be downloaded etc.) and the begin improving the compatibility with the spec with more pull requests. EDIT: Compatibility is just 40% not 60%. Got it backwards. |
If you'd like a version of your test HTML files that are CommonMark compliant, I built a conversion script for this pull request. https://github.com/thephpleague/markdown/pull/9 Go ahead and steal those. Also, is it ok that I "liberated" the original test files? Not sure where or how to list attribution, but I'm making no bones about taking them. :) |
The latest version passes 57% of the tests. @philsturgeon Thanks, I'll have a look. |
Cracking! Are you willing to break BC in order to support CommonMark for the next major version, or is this going to be "another flavour"? ---Sent from Boxer | http://getboxer.com On 3 December 2014 21:36:35 GMT-5, Emanuil Rusev notifications@github.com wrote:The latest version passes 57% of the tests. @philsturgeon Thanks, I'll have a look. —Reply to this email directly or view it on GitHub. |
@philsturgeon The changes that affect backward compatibility should be minor. I'll probably have options / setters that deal with them. |
Awesome, keep up the good work! ---Sent from Boxer | http://getboxer.com On 4 December 2014 06:44:27 GMT-5, Emanuil Rusev notifications@github.com wrote:@philsturgeon The changes that affect backward compatibility should be minor. I'll probably have options that deal with them. —Reply to this email directly or view it on GitHub. |
I keep coming back to this issue every few weeks, especially as higher-order frameworks are favouring embedding CommonMark libs now as their default implementations. ParseDown still has way better performance and combined with CommonMark compliance, it would be a big win. Hope there can be a single flag to turn CommonMark compliance on/off and get full test coverage. At the moment 276 of 598 tests failed for CommonMark. The tests themselves need updating as well. |
@aleemb the next version will have much better compliance |
@erusev glad to hear it. I first test drove Parsedown following your HN comment some months back and was really impressed by the commitment to perf. There isn't any branch for the dev version. Do you plan to do internal dev and then release it to master? Just curious as to the progress of it and your release process. |
There's an outstanding pull request from my fork which adds some commonmark compliance features: Test results on my branch: Tests: 653, Assertions: 657, Failures: 247. |
@anthonywilliams can I just ask what testsuite are you using to get to 653 tests (the common mark suite seems to have 599 at the moment which is similar to the number aleemb mentioned - so i'm just wondering where the difference is coming from) |
@erusev - and does "next version will have better support" mean work has started or it's worthwhile looking at antony's current pull request and giving feedback/additional fixes? |
@grangeway i have thoughts on what the implementation should look like, but before i go on with the implementation, I'd like to finish "save mode" |
in which case, will leave it to you :) |
@grangeway I just ran "phpunit --bootstrap test/bootstrap.php test" in the working directory |
I'm going to close this for the same reasoning as in #588: CommonMark (or more specifically the GitHub flavoured extension) is definitely a goal. But as mentioned in #588 (comment) there are some things that Parsedown won't be able to get right without major compromises in speed (or at least a complete design overhaul: this would almost certainly involve Parsedown having to do a lot more work than it currently does). Assuming the absence of a complete rewrite, this issue would technically never be closable as resolved (in a fully-compliant sense). As an acknowledgement of this limitation I'm closing it more as a "won't-fix". That said, still please open issues for individual non-compliances, hopefully we can get most of them fixed :) For a list of issues solved recently—most aiming at CommonMark compliance—take a look at: https://github.com/erusev/parsedown/milestone/2?closed=1 |
Is parsedown CommonMark ready/compliant?
Edit: Standard markdown is now CommonMark
source: http://blog.codinghorror.com/standard-markdown-is-now-common-markdown/
The text was updated successfully, but these errors were encountered: