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

preserve single spacing and treat img as inline element #403

Closed
wants to merge 1 commit into from

Conversation

eleith
Copy link

@eleith eleith commented Feb 9, 2014

i ran into a couple of edge cases where the HTML was not being preserved properly after it was beautified. i think it comes down to the fact that HTML does allow for single spaces to be interpreted as spaces in the content.

for example

<img src='test.jpg'> this is a test image

will beautify incorrectly to

<img src='test.jpg'>this is a test image

in digging deeper, i found a few other edge cases in similar nature (particular with spaces after tags not being preserved.

the following PR address this, and adds a few more tests to show that the library is still in a fully functional state. i also added img to the unformatted list to prevent new lines from being added after img tags, since they are inline elements much like span tags.

let me know if you are interested in additional tests or feel the changes could be cleaner.

@bitwiseman
Copy link
Member

I haven't had time to review this in depth, but thanks for submitting and including tests for you change. I'll get to this shortly.

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

Successfully merging this pull request may close these issues.

2 participants