replace innerHTML/outerHTML with json html serialization to eliminate normalization issues