Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is another PR for "Human readable format" now renamed
ignore.blanklines
This one is shorter and simpler, and addresses some questions with the original PR.
Why not use
ignore.whitespaces
?No combination of
ignore.whitespaces
actually removes blank lines and only blank lines. While you can disable specific types of whitespace, that's all it does (As far as I can tell, correct if I'm wrong)Using something like my jekyll menu as an example, the uncompressed version generates 100 blank lines for every line with content. This is the horror of liquid, and one of the reasons JCH is so popular :)
Removing only newlines would lead to several hundred spaces between content, and removing only spaces would still leave 100 blank lines (Though with less spaces I suppose it would have a smaller file size)
I can't think many people want the ability to remove arbitrary whitespace - certainly not as many as want to remove blank lines.
Performance concerns of moving comment parsing above whitespace collapse
While moving comment parsing above whitespace collapse does have a small (Less than 1.5% by my bench) performance penalty, getting rid of
ignore.whitespaces
offsets that and goes on to give a further 10% performance improvement.These benches came from Jekyll 3 but Jekyll 2.0 showed similar numbers.
Edit: I just checked 866399a from before either of our whitespace patches and there's still a good 10% performance improvement over that in this patch. Probably due to other changes that occurred in the meanwhile like changing the case to a pair of ifs in a capture.
Subjectiveness of "Human readable"
As the switch in this patch only removes blank lines and leaves other whitespace alone, this will not affect the output enough to raise indent style issues (Indents will be the same as the source file), and it's simple enough not to raise other issues (We're not claiming to parse and rewrite the DOM here!)