-
Notifications
You must be signed in to change notification settings - Fork 868
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
Unexpected (?) behavior change in parsing newlines #1041
Comments
Besides being different. Does this present issues? The HTML parsing was rewritten in 3.0. The old code was very difficult to maintain. With that said the new parser may have a couple of corner cases that got missed. This is obviously a change, but I also think this behavior is more sane with block elements. If I recall, I think this particular case is expected. But @waylan can probably speak better to it than I. If this was happening with an inline element, it would definitely be a problem. |
See Babelmark. It appears that the various implementations are split down the middle with half including the script within the As @facelessuser noted, the HTML parser in 3.3 is a complete rewrite, We started over completely from scratch. It would have been more work to get the old behavior in this case. However, as the reference implementation behaves this way, I left it as-is. I should note the following section of the rules
To be clear, Perhaps if the tag was a A paragraph.
<div>foo</div> was rendered as <p>A paragraph.
<div>foo</div></p> that would be invalid HTML and a browser would interpret it as <p>A paragraph.
</p>
<div>foo</p>
<p></p> In other words, it would close the <p>A paragraph.</p>
<div>foo</div> We get the same behavior for all block-level tags, therefore, the current behavior for Finally, I will note that almost all implementations agree with the rendering in the |
Thanks @waylan for the detailed explanation! I agree that following the reference is always better. I was searching a confirmation that the change was intentional, so I'll change the failing tests in accordance with the new behavior. |
The following code:
produces different output between markdown 3.2.2 and 3.3.1
This is 3.2.2:
And this is 3.3.1:
Note how the paragraph is closed before the <script> tag in 3.3.1. In 3.2.2 that required a double
\n
.Is this change expected?
The text was updated successfully, but these errors were encountered: