Split part of getOpeningHtmlTag out to getHtmlAttributes

Change-Id: Iad198ec4f3c6a2a5c9471ffc788d26094bf8c66d
Merge "Split part of getOpeningHtmlTag out to getHtmlAttributes"