Skip to content
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

New (?) bug rendering divs next to paragraphs? #220

Closed
Vaguery opened this issue Feb 13, 2015 · 7 comments
Closed

New (?) bug rendering divs next to paragraphs? #220

Vaguery opened this issue Feb 13, 2015 · 7 comments
Assignees
Labels

Comments

@Vaguery
Copy link

Vaguery commented Feb 13, 2015

I just noticed (while chasing down a new Nokogiri bug) that a bunch of old blog posts are not rendering correctly. There are two symptoms, apparently:

  • a <div> that appears without a newline right before it is not recognized, and comes out HTML escaped inside its surrounding block
  • a <div> with any attribute at all is not recognized unless it is preceded by TWO newlines

Here's a gist showing the behavior

Amusingly, github parses the source correctly. View "RAW" to see the problem.

@gettalong gettalong self-assigned this Feb 13, 2015
@gettalong gettalong added the bug label Feb 13, 2015
@gettalong
Copy link
Owner

Examples 4 and 6 have to fail because the <div> tags appear inside the paragraph, and this is not allowed.

Example 7 should not fail. It is similar to 5 which is parsed correctly. So this has to do with the attribute probably.

@gettalong
Copy link
Owner

I have found the problem and this will be fixed in the next release.

Please also note that when using "parse_block_html" that the closing tag needs to be on a separate line!

@Vaguery
Copy link
Author

Vaguery commented Feb 16, 2015

Thanks!

Confused about the <div> tags appearing "inside" the paragraph. Those examples are concertedly correctly by the github parser, and there is no (explicit) requirement for a <div> to start on a new line.

Indeed, these examples were converted correctly (as a paragraph followed by a div) by kramdown a few months ago. At least I think so....

@gettalong
Copy link
Owner

Okay, I will use git bisect to see if kramdown's behaviour changed and will let you know!

@gettalong gettalong reopened this Feb 16, 2015
@gettalong
Copy link
Owner

kramdown has functioned this way since 2009, so this is not new behaviour.

However, if you can find an example where kramdown acted differently, please share it!

@Vaguery
Copy link
Author

Vaguery commented Feb 16, 2015

My mistake! Apparently it's the behavior of other renderers (github, for example), and I got confused.

@gettalong
Copy link
Owner

No problem :) Thank you for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants