-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
CommonMark Tests #1160
CommonMark Tests #1160
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
Where did you get the JSON file? Is that from CommonMark and what version of the spec?
-
I like the idea of constructing the tests from the JSON but we should not add another manual build/test/publish step. And we definitely don't want to require any maintainers to install php in order to update the tests.
|
The manual build step comes from creating the tests every time a new version of the spec comes out. I say we should just create a script to load and run the json file instead of building the tests. That way when a new version of the spec comes out all we have to do is copy the new json file. |
@UziTech: Part of me wants to agree with that. For examples we aren't going to comply with are you thinking we would have something like an array of examples we aren't complying with? var noComply = [];
var shouldComplyButFail = []; |
We could add something to the json like:
|
We could. Though, if we have to modify the JSON I think we would be slipping back to a pre-build step, yeah? 0.29 gets released, we modify that JSON. I could take what @davisjam has put together.
Doesn't require modifying the JSON. Allows test bed to cover all the things while indicating broken things and examples we have no intention of covering. This would put a little bit more burden back on the developers to read the JSON to find out exactly what we're not in compliance with (something they get for free by doing it the longer way). @UziTech: Check the spec now. 407 failures, if I didn't mess something up, which is quite possible. Basically Marked only passes 30% of the spec. |
@UziTech: Been looking at some of the failing tests. Looks like it could be an XHTML versus HTML5 issue. For self-closing elements XHTML says to add a forward slash, HTML5 doesn't have this requirement. It looks like Marked is spitting out the proper HTML5 but the HTML from the spec has the trailing slash.
Debating on have the script remove the trailing slash. Thoughts?? |
hmm ... I'm thinking this might be a better question for @Feder1co5oave. Would it be easier to remove the slashes from the json file every time we update the spec? or would it be easier to add slashes in marked to copy the spec? I don't think the spec requires them. |
A third option could be coming up with some AST sort of approach for comparing them instead of comparing strings. |
|
Enabling XHTML mode solves the closing slash issue. I used this in my last
pr.
Space is ignored by the current comparing algorithm.
My old pr to use html-differ uses parse5 under the hood to compare html,
that's an AST.
Il mer 28 mar 2018, 01:35 Josh Bruce <notifications@github.com> ha scritto:
…
1. Removing the slash from the JSON should be a matter of string
replacement...can't imagine it being too difficult.
2. Might be able to set the XTHML option to true?? Right now it's
marked out of the box, which is X?HTML false. Having said that, not sure if
our XHTML implementation uses the same spacing.
3. Lost me on the acronym...AST??
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1160 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AByGhNz91c2Jz2nC6iQRSwPTxuBabsCNks5tisy1gaJpZM4S5wuY>
.
|
|
Added Would like to get feedback, if any, on this as a viable solution for the future from @UziTech and @Feder1co5oave. Tagging in the rest of the core team as well. |
Add tests from CommonMark spec
Marked version: 0.3.18
Markdown flavor: CommonMark
Description
Putting a script together in PHP (it's what I know and this should be a one time deal) to generate the test cases. However, the test harness does not seem to run all files in the
integration
folder. Given the number of test cases from the specs, think it would be better to divide the tests by flavor and section.@UziTech: Thoughts??
Contributor
Committer
In most cases, this should be a different person than the contributor.