Compact the documentation according to HTML and not source

The documentation's source can be a template, which can
become much longer when expanded. So the condition for
compacting should be HTML and not source.

Bug: 48099
Change-Id: I09c813d36c52932cb4d2eb5ca7a3cd1828e0e05e
Merge "Compact the documentation according to HTML and not source"