Added JS Safe protection to resx token replace logic