-
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
Added tests for consistency when a markdown follows a markup without blank line #514
Conversation
Phpunit failed, but this is the purpose of this consistency test... |
Nice spot! IMO the tests should be positive for not processing markdown immediately after HTML markup (since that follows behaviour expected by CommonMark). |
I'll commit the inverted test, but perhaps @erusev has a specific point of view. For me, it doesn't matter, since I use Markdown Extra, and I need this check here. @erusev, about Markdown Extra, there were no new release since two years, and I'm waiting 1.7.0 of parsedown to fix last issues. Do you plan something or, just missing time? |
@Daniel-KM if you push those inverted tests, I'll target #489 at your branch, so these tests can pass (hopefully). |
@aidantwoods Here are the new tests. |
I've made a PR to your branch, once that's merged you can add the text "Fixes #488" to your the initial description here, so that you can trigger that issue to auto-close (since that was the aim of my PR when targeted at this branch – which will now be part of this one). |
To say a bit about the changes contained in this PR: Parsedown currently has a concept of HTML block depth, and will stop processing markdown while the markdown is inside HTML according to the tracked depth. The changes here essentially swap this model for the CommonMark approach which says (roughly speaking) that a HTML block is a line that starts with a HTML tag and that keeps being a HTML block until the next blank line. Markdown should not be processed unless there is at least one line break between the HTML block and the markdown to be processed. This means that markdown can be processed inside HTML tags provided there is a sufficient gap, but acts to limit accidental processing of actual HTML. One test case in Parsedown's test suite related to these changes failed because it disagreed with the result for the same input to the CommonMark reference parser, this was changed to match the CommonMark result, and so now passes. |
When a markdown follows a markup, sometime it is processed, sometime not. The difference occurs when there are one or two markups followed by a markdown. See erusev/parsedown-extra#44 too for markdown extra.
Fixes #488