re-usable text escaping

See https://bugs.dojotoolkit.org/ticket/8995

I made the choice to use a regexp instead of createTextNode because it really faster