Temporarily substitute tokens in the given string with placeholders
Description
Temporarily substitute tokens in the given string with placeholders,
then put them back after transforming the string.
Useful for protecting tokens, like templates in HTML, from being
mutated when the string is transformed in some way,
like from a formatter/beautifier.