digitalsparky / jekyll-minifier

Jekyll HTML/XML/CSS/JS Minifier utilising yui-compressor, and htmlcompressor
GNU General Public License v3.0
245 stars 25 forks source link

Remove whitespace between HTML tags #25

Closed ghost closed 6 years ago

ghost commented 7 years ago

Running jekyll-minifier 0.1.1, and after minifying my build looks like this:

<!doctype html> <html> <head> <meta charset="utf-8"/> <meta name="viewport"...

The spaces in between the tags should be removed, it would cut down a bit on build sizes (especially for larger sites).

Birch-san commented 7 years ago

This part of the readme looks relevant:

jekyll-minifier:
  remove_intertag_spaces: true      # Default: false

You'll want to set it to true.

I expect the spaces are used to support the HTML feature where any whitespace between tags results in innerText of " ". Whereas if you reduce whitespace to 0: you actually end up with a different document.