-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'Allow newlines' option #20
Comments
What’s your use case exactly? |
I have a field in my database that I want to allow real newline characters. |
For now this can be solved with: var escaped = string.split('\n').map(function(line) {
return jsesc(line);
}).join('\n'); I’m worried that this is not common enough to extend the API for. Also, |
Yeah I like the whitelist idea. Good call. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
jsesc should have an option to allow newline characters:
So if the string contains a newline character (
\n
), it would not be replaced by\\n
The text was updated successfully, but these errors were encountered: