From http://fastwp.de/snippets/html-minify/