outaTiME/grunt-replace — pull request #26 by warpech (2013-04-25 10:10:29+00:00)
Title: escape $ before performing regexp replace

Recently I found a problem when using your Grunt task.

When the replaced `value` contains a `$'` string (or any other [special replacement pattern](https://developer.mozilla.org/en/docs/JavaScript/Reference/Global_Objects/String/replace)), it is not escaped and therefore malforms the result.

Specifically, with document:

@key

And value:

Something $' like this

I was getting output:

Something like this

Because `$'` inserts the remaining part of the document. Of course the desired output was:

Something $' like this

This pull request contains a fix and a test for it.