[HtmlFormatter] Improving type checking method for choosing html element id.