Fixed htmlentities issue with DOM