Google's standard template language (soy / closure-templates) does mininfy whitespace by default [1]. However, it does not omit optional tags. I think this is why the style guide is written as it is.
Still, I agree that both types of optimization / minification should be done by the tooling layer.