Closed istiak-tridip closed 1 year ago
Oh beautiful, thanks for digging in and submitting a fix + snapshot test.
@fbartho it sounds like we were hitting this: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#specifying_a_string_as_the_replacement
Ah! I didn't know there was extra special escapes in that case. Thanks for replying!
Fixes #100
When replacing a string if the provided replacement is a string it will replace the original string using pattern matching. In the vue preprocessor, the
$
in the code is seen as a regex pattern. Passing a function as a replacement escapes that issue.