Unless I misunderstand what this does, I'll have an HTML file where I have added white space in some places for readability (e.g. an extra line space after a bootstrap row div). I run beautify and it removes ALL empty lines in the document.
BEFORE:

AFTER

If you happen to be using htmlbeautifier, unfortunately the behavior you're looking for is not yet an option: https://github.com/threedaymonk/htmlbeautifier/issues/5.
Let me know if htmlbeautifier supports this option and I can add it to Atom Beautify.
I was working in this last night, is a pain in the ass... the problem is because the look up of newline is used recursive in the parser method so basically you can't modify the behavior of the single case of newlines because the same method is used every time that a newline is need it, so after many hours dissecting the code i think the only way would be to rewrite it or read the file two times a rescue from there the newlines, maybe i miss something, the code was kinda complex and i had troubles to get it at first, by the way, i add an option to transform spaces to tabs, since i couldn't make it, at least "it's something", check my repo if anyone want it and i made the pull request on htmlbeautifier, regards!
@prettydiff maybe it would be best to reprecate htmlbeautifier in favour of Pretty Diff?
Pretty Diff supports the preserving of empty lines with the option preserve. But Pretty Diff will only preserve each instance as a single empty line opposed to a plurality of consecutive empty lines.
In Pretty Diff this code with option preserve:
<p>
<a>some text</a></p>
Will become this:
<p>
<a>some text</a></p>
Hello everyone, I'm facing same issue. HTMLBeautifier breaks the empty lines, which makes a long file really hard to read/navigate. But PrettyDiff wont indent ERB Tags, only HTML ones, while HTMLBeautifier does the indent and nested identation:
<%= %>
<% %>
<%# %>
I'm using PrettyDiff by now, you know if ERB tags are planned to be supported?
@unmultimedio Pretty Diff should support that. I recommend opening a bug with some code samples to https://github.com/prettydiff/prettydiff/issues
@Glavin001 The latest version of htmlbeautifier (1.3.0) added the --keep-blank-lines option that accepts an integer.
Awesome to hear, @mkozono . Pull Requests welcome!
Most helpful comment
Let me know if
htmlbeautifiersupports this option and I can add it to Atom Beautify.