For prettier I think the right call is to keep strings encoded the same way the user did it (we have the raw string)
-
-
but we need to be able to change single quotes to double quotes and vis-versa to satisfy the quote setting
2 replies 0 retweets 0 likes -
Isn't that as easy as replacing \" and \' in raw string on changes?
4 replies 0 retweets 0 likes -
Replying to @RReverser @Vjeux
and `'` (and backticks for template literals) — ideally you’d handle them all.
1 reply 0 retweets 0 likes -
Well if you want to change any escape, then you just don't need original raw string at all, can reencode parsed result.
1 reply 0 retweets 0 likes -
As a side-effect, emoji escapes and such will turn into actual emoji chars, but that's probably for better :)
1 reply 0 retweets 0 likes -
Replying to @RReverser @mathias
it's tricky, at first we put the unencoded version but we don't really want to have invisible characters in your source
1 reply 0 retweets 0 likes -
now we encode everything but all the emojis are unreadable
2 replies 0 retweets 0 likes -
Replying to @RReverser @mathias
but, not all the tooling has great support for unicode, so I don't want to output unicode if the user didn't put it
4 replies 0 retweets 1 like
An easy but hacky solution would be to use jsesc with `es6: true` and then operate on jsesc’s output: replace any \xNN,
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
JavaScript, HTML, CSS, HTTP, performance, security, Bash, Unicode, i18n, macOS.