How to write a function that alters the text of a given content parameter but retains everything else?

I saw this post about new featured packages and was impressed with the visual effects of Umbra, so I had a look at the code to see how it works under the hood. And what do you know, it seems the torn paper demo uses a similar technique