Be careful when passing a string pattern to String::replace:

```javascript
> "a'b'c'd'e".replace("'", '%27')
'a%27b\'c\'d\'e'
```

We should use a regular expression instead, with the `g` flag:

```javascript
> "a'b'c'd'e".replace(/'/g, '%27')
'a%27b%27c%27d%27e'
```