just use Juri instance and replace whatever you need, at the end clean it before outputing it...
either with htmlentities or Clean function