Correctly handle void/non-void elements in html