Replace innerHTML with safe html parsing