einars/js-beautify — pull request #403 by eleith (2014-02-09 02:51:02+00:00)
Title: preserve single spacing and treat img as inline element

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

```
this is a test image
```

will beautify incorrectly to

```
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.