set utility function to apply transformation and preserve markups (bbcode etc)