validates if html code is valid