From 0cdaae4c2859d1f02d93e9198e24bf8e0dd91d73 Mon Sep 17 00:00:00 2001 From: Benjamin Gruenbaum Date: Sun, 5 Jul 2015 16:33:25 +0300 Subject: [PATCH] Update `safe` --- EscapedChars.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/EscapedChars.md b/EscapedChars.md index 1b821d4..b643091 100644 --- a/EscapedChars.md +++ b/EscapedChars.md @@ -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. |