better handle auto-closing tags