Skip to content

Commit

Permalink
Update safe
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamingr committed Jul 5, 2015
1 parent f0d717b commit 0cdaae4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion EscapedChars.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,7 @@ TODO(benjamingr) add reasoning for "safe with extra set" characters here.

This proposal escapes a maximal set of characters and ensures compatibility with edge cases like passing the result to `eval`.

TODO(benjamingr) add reasoning for "safe" characters here
|Character | Why escape it?
|-----------|--------------|
| `/` | So that `eval("/"+RegExp.espace("/")+"/")` will produce as a valid regular expression. More generally so that regular expressions will be passable to `eval` if sent from elsewhere with `/`. Note that [data](https://github.com/benjamingr/RegExp.escape/tree/master/data) indicates this is not a common use case. |
| [`WhiteSpace`](http://www.ecma-international.org/ecma-262/6.0/index.html#table-32) | So that `eval("/"+RegExp.espace("/")+"/")` will produce as a valid regular expression. More generally so that regular expressions will be passable to `eval` if sent from elsewhere with `/`. Note that [data](https://github.com/benjamingr/RegExp.escape/tree/master/data) indicates this is not a common use case. |

0 comments on commit 0cdaae4

Please sign in to comment.