This repository was archived by the owner on Aug 20, 2018. It is now read-only.
refactor: use jsesc to escape special characters#62
Open
bmeurer wants to merge 1 commit into
Open
Conversation
Similar to webpack-contrib/raw-loader#36 we can use jsesc here to deal with special characters in general.
michael-ciniawsky
left a comment
Member
There was a problem hiding this comment.
Do we really need it ? Why?
| .replace(/\u2028/g, '\\u2028') | ||
| .replace(/\u2029/g, '\\u2029'); | ||
| value = JSON.stringify(value); | ||
| value = jsesc(value); |
Member
There was a problem hiding this comment.
Is jsesc(value, { json: true }) a thing/require/needed here? (I'm not familiar with this module)
Member
There was a problem hiding this comment.
See webpack-contrib/raw-loader#36 (comment) for reference
Member
There was a problem hiding this comment.
Given webpack handles json at this point, why are we updating this here?
Member
There was a problem hiding this comment.
'Native JSON Support' turned out to be mainly a push(jsonLoader) for .json if missing https://github.com/webpack/webpack/pull/3374/files#diff-6cff30a1f2b17edb1b17434da5a7d140
michael-ciniawsky
requested review from
alexander-akait,
joshwiens and
sokra
September 28, 2017 15:06
jsesc to escape special characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Similar to webpack-contrib/raw-loader#36 we can use
jsesc here to deal with special characters in general.