strip encapsulation and replace in everything it finds