-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Some HTML <div> content wrapped in <p> unnecessarily #2247
Comments
Not a bug, I think, just the result of the addition of "native divs."
With `native_divs`, pandoc parses whatever is inside the div tags just
as it would have parsed it by itself, and sticks the result in the Div
container.
|
Thanks again @jgm for clarifying. Yes, I can get the expected results with |
I just checked: This raises the question why you're seeing a difference between 1.13.0.1 and 1.14. Clearly something changed in how I believe this is due to 598d3ee, see #1591. |
I didn't see that it was in 1.13 - yes, it's better not to change the default. Yes, it does look like it is related to the change prompted by #1591. I'm sorry, I cannot see (don't know Haskell yet) from the diff in the reader why it affects only inline HTML elements. F.ex. With the following input h1 doesn't get wrapped in <div>
<h1>testing</h1>
</div> while iframe in the following does: <div>
<iframe src="http://www.w3schools.com"></iframe>
</div> BTW, it looks like it happens when the inline element is indented (i.e. does not start at the left margin). |
The h1 doesn't get wrapped because this by itself would be an HTML block, not a paragraph:
The iframe does get wrapped because this would not be parsed as an HTML block; the iframe tags get parsed as inline HTML:
You can check this using
Unfortunately iframe is one of those tags that can be used either in block or inline contexts. In CommonMark we're working out a better way of dealing with these, so authors will at least have the option of getting them treated as block tags. |
F. ex.
With Pandoc 1.14.0.4
results in:
where as Pandoc 1.13.0.1 produces expected output:
The text was updated successfully, but these errors were encountered: