{"action":"created","issue":{"url":"https://api.github.com/repos/erusev/parsedown/issues/423","repository_url":"https://api.github.com/repos/erusev/parsedown","labels_url":"https://api.github.com/repos/erusev/parsedown/issues/423/labels{/name}","comments_url":"https://api.github.com/repos/erusev/parsedown/issues/423/comments","events_url":"https://api.github.com/repos/erusev/parsedown/issues/423/events","html_url":"https://github.com/erusev/parsedown/pull/423","id":175071143,"number":423,"title":"Fix CommonMark test","user":{"login":"PhrozenByte","id":920356,"avatar_url":"https://avatars.githubusercontent.com/u/920356?v=3","gravatar_id":"","url":"https://api.github.com/users/PhrozenByte","html_url":"https://github.com/PhrozenByte","followers_url":"https://api.github.com/users/PhrozenByte/followers","following_url":"https://api.github.com/users/PhrozenByte/following{/other_user}","gists_url":"https://api.github.com/users/PhrozenByte/gists{/gist_id}","starred_url":"https://api.github.com/users/PhrozenByte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PhrozenByte/subscriptions","organizations_url":"https://api.github.com/users/PhrozenByte/orgs","repos_url":"https://api.github.com/users/PhrozenByte/repos","events_url":"https://api.github.com/users/PhrozenByte/events{/privacy}","received_events_url":"https://api.github.com/users/PhrozenByte/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-05T13:24:48Z","updated_at":"2016-09-05T14:58:21Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/erusev/parsedown/pulls/423","html_url":"https://github.com/erusev/parsedown/pull/423","diff_url":"https://github.com/erusev/parsedown/pull/423.diff","patch_url":"https://github.com/erusev/parsedown/pull/423.patch"},"body":"I was wondering what CommonMark examples are still violated by Parsedown, but the current test is broken (its regex matching the CommonMark examples doesn't work correctly). That is why I've developed a working one.\r\n\r\nParsedown currently passes 287 of 616 examples (i.e. 329 failures). Here's a complete `phpunit` run: http://pastebin.com/uLaJpBWf\r\n```\r\nFFF.FFFFF........FF.....F.F..F...F....FF....FF..F....FFF.F..FFF  63 / 616 ( 10%)\r\n....FFFF....F..FFF.FFFFFFFFFFF.FFF.FFFFFFFFFFFFFF.F.FFFFFFFFF.. 126 / 616 ( 20%)\r\nFF.FFFF...FF...F.FFFFFF.F.F.FF.FFFF.F.F.F.FF..FFF.FF......FF... 189 / 616 ( 30%)\r\n.F..FFFFF...F...F..F..FFFF.F.....FFFFFF.FFFFF.F.FFFFFFF.FFFFF.. 252 / 616 ( 40%)\r\n.FFFF.FFFF.F.FF.FFFFFFFFFFF.FF.F.FFF.F.FFFFFFFFFFF.FFFFF.F...FF 315 / 616 ( 51%)\r\n..FFF..FF..FFF...FFF.F...FFFF.F.F..F..FF..FFFFFFF.FF....FF.FFF. 378 / 616 ( 61%)\r\n...FFF.....FF.....FFF...............F..FF.......F..FF......F... 441 / 616 ( 71%)\r\nFFFFFFFFFFFF..FF..FFF.FFFF.FFFFF.FF....F..FFFF..FFF..F..FFF.FFF 504 / 616 ( 81%)\r\n.FFFFF.FFF.......F...F...F.....FFFFF.FF....F.F.FF.......FF.F.F. 567 / 616 ( 92%)\r\n.FF.FF....FF.F..FF.....FFF..F.F..F.F.....F.......\r\n\r\nFAILURES!\r\nTests: 616, Assertions: 616, Failures: 329.\r\n```\r\n\r\nOne of the main reasons for that many failures is that Parsedown omits whitespaces where whitespaces shouldn't be omitted according to the CommonMark specs. However, many of these whitespaces don't matter when the page is viewed by a browser. That's the reason why I've created the `test/CommonMarkTestWeak.php`: This test cleans up the HTML markup before comparison, so examples which would normally fail due to actually invisible differences (e.g. superfluous whitespaces), don't fail. However, cleanup relies on block element detection. The detection doesn't work correctly when a element's `display` CSS property is manipulated. According to that this test should be only a interim solution on Parsedown's way to full CommonMark compatibility.\r\n\r\nParsedown currently passes 338 of 616 examples (i.e. 278 failures) when less aggressively compared. Here's a complete phpunit run: http://pastebin.com/CRNbXSdq\r\n\r\n```\r\nFFF.F.F...........F.....F.F..F...F.....F....FF..F.....FF....FFF  63 / 616 ( 10%)\r\n....F.FF........FF..........FF.FF..FFF...F.F...FF...FFFFFFFFF.. 126 / 616 ( 20%)\r\nFF.FFFF...FF...F.FFFF.F.F.F..F.FFFF.F.F.F.FF..F.F.FF........... 189 / 616 ( 30%)\r\n....FFFFF...F...F..F..F..F.F......FFFFF.FF.FF.F.FFF...F.FFF.F.. 252 / 616 ( 40%)\r\n.FFFF.FFFF.F.FF.FFFFFFF.F.F....F.FFF.F...FFFFFFFFF.FFFFF......F 315 / 616 ( 51%)\r\n..FFF..FF..FFF...FFF.F...FFFF.F.F..F..FF..FFFFFFF.FF....FF.FFF. 378 / 616 ( 61%)\r\n...FFF.....FF.....FFF...............F..FF.......F..FF......F... 441 / 616 ( 71%)\r\nFFFFFFFFFFFF..FF..FFF.FFFF.FFFFF.FF....F..FFFF..FFF..F..FFF.FFF 504 / 616 ( 81%)\r\n.FFFFF.FFF.......F...F...F.....FFFFF.FF....F.F.FF.......FF.F.F. 567 / 616 ( 92%)\r\n.FF.FF....FF.F..FF.....FFF..F.F..F.F.............\r\n\r\nFAILURES!\r\nTests: 616, Assertions: 616, Failures: 278.\r\n```\r\n\r\nPlease note that fulfilling all CommonMark spec examples doesn't make Parsedown fully compatible to CommonMark. There are many more things to consider. However, making the examples work is a good starting point.\r\n\r\nPlease also note that Parsedown not only fails examples which represent \"cases that are quite uncommon\" (according to the `README.md`) - some of the failed tests are quite important (e.g. hard line breaks, #334)."},"comment":{"url":"https://api.github.com/repos/erusev/parsedown/issues/comments/244765922","html_url":"https://github.com/erusev/parsedown/pull/423#issuecomment-244765922","issue_url":"https://api.github.com/repos/erusev/parsedown/issues/423","id":244765922,"user":{"login":"PhrozenByte","id":920356,"avatar_url":"https://avatars.githubusercontent.com/u/920356?v=3","gravatar_id":"","url":"https://api.github.com/users/PhrozenByte","html_url":"https://github.com/PhrozenByte","followers_url":"https://api.github.com/users/PhrozenByte/followers","following_url":"https://api.github.com/users/PhrozenByte/following{/other_user}","gists_url":"https://api.github.com/users/PhrozenByte/gists{/gist_id}","starred_url":"https://api.github.com/users/PhrozenByte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PhrozenByte/subscriptions","organizations_url":"https://api.github.com/users/PhrozenByte/orgs","repos_url":"https://api.github.com/users/PhrozenByte/repos","events_url":"https://api.github.com/users/PhrozenByte/events{/privacy}","received_events_url":"https://api.github.com/users/PhrozenByte/received_events","type":"User","site_admin":false},"created_at":"2016-09-05T14:58:21Z","updated_at":"2016-09-05T14:58:21Z","body":"Yes, exactly.\r\n```\r\n276) CommonMarkTestWeak::testExample with data set #597 ('Hard line breaks', 'foo\\\\\r\nbaz', '<p>foo<br />\r\nbaz</p>')\r\nFailed asserting that two strings are equal.\r\n--- Expected\r\n+++ Actual\r\n@@ @@\r\n-'<p>foo<br />\r\n+'<p>foo\\\r\n baz</p>'\r\n```\r\n\r\nHowever, I have to be honest: I didn't read all failing examples, just a bunch of them. I was focusing on making the tests work :smile:"}}
{"actor":{"display_login":"PhrozenByte"}}