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

Blank lines in the template generate empty divs #92

Closed
campezzi opened this issue Mar 10, 2016 · 5 comments
Closed

Blank lines in the template generate empty divs #92

campezzi opened this issue Mar 10, 2016 · 5 comments
Labels

Comments

@campezzi
Copy link

When writing a template, leaving a blank line between two elements generates an empty <div> in the resulting HTML code. This only seems to happen if the blank line contains a certain number of whitespace characters, a common scenario when using editors that auto-indent. This doesn't seem to be the desired behavior (it does not happen in the Ruby implementation of Slim).

Example:

  p First Paragraph

  p Second Paragraph

(note: GitHub is stripping white spaces, but that blank line between the two p elements includes 2 white spaces, preserving indentation of said elements)

Generates:

<p>First Paragraph</p>
<div></div>
<p>Second Paragraph</p>
@lpil
Copy link
Contributor

lpil commented Mar 10, 2016

Thanks for the report :)

@campezzi
Copy link
Author

No problem. I'll try to take a look at the code later and see if I can contribute a fix!

@doomspork
Copy link
Member

@campezzi the fix for this will be released later this weekend 👍

@doomspork
Copy link
Member

@campezzi 0.12.2 has been released with this fix.

@campezzi
Copy link
Author

Thanks, I'll give it a go!

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

No branches or pull requests

3 participants