tidy html fragment that in js code