Fixes for moving HtmlFormatter class to core

Updates from core change Ic276e1604c5718e8568e120ddfb9a8fc13a682fc

Change-Id: Ie0e05a4c45181e608f5143dd1f9370fcc45fff06