Fix error when parsing HTML as JSON