We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
For some code inputs containing escaped unicode emojis, SWC minifier will output unescaped unicode emojis.
Example input:
console.log("\\"\\\\uD83D\\\\uDE42\\"");
import swc from '@swc/core'; const input = ` console.log("\\"\\\\uD83D\\\\uDE42\\""); `; console.log('input'); console.log(input); eval(input); console.log('\n'); const output = await swc.minify(input); console.log('output'); console.log(output.code); eval(output.code); Runnable playground: https://stackblitz.com/edit/stackblitz-starters-gpln2upu Output: ❯ node index.js input console.log("\"\\uD83D\\uDE42\""); "\uD83D\uDE42" output console.log('"\uD83D\uDE42"'); "🙂"
https://play.swc.rs/?version=1.11.18&code=H4sIAAAAAAAAA1OKiSl1sTB2UQIAWPmpCAkAAAA%3D&config=H4sIAAAAAAAAA1VQuW7DMAzd8xWC0KkorCBjpgxdM3YqMrAyfcGSDJJGawT590qOY8uT%2Fch3ifeDUsYo%2Fca2QQf6rHQjMvDZmI6DL55jlkBYBKoN%2F1qy%2BiOqNIeRLF5h4KgSGnGedmwjvMffCAYgRlpxEk1e4C%2FFyDQgW2oHme3mbYk2EMSw3FKpx%2FOjhcBzFcjljj3WYKfPl3InzC2vKFCCwIswr%2Ff2QDVK6oZ8Op6OS6%2F4Cmk4j7y4UI49snmP02%2B9odsae7HBV229MFaQEbgBwnIhrOC2a%2FQDjF%2FUp0qF4eXw83IJ3U6dzpl4NjgXfMd6Y7a%2Brab1Lo%2FDP5Tvfnb0AQAA
After being minified, if the unicode chars are escaped, they should also be escaped in the output
\\uD83D is not equivalent to \uD83D
\\uD83D
\uD83D
\\uD83D should remain \\uD83D
\\uD83D is unescaped to \uD83D
1.11.18
Prettier website bug: prettier/prettier#17308
Docusaurus bug report: facebook/docusaurus#11047
The text was updated successfully, but these errors were encountered:
kdy1
Successfully merging a pull request may close this issue.
Describe the bug
For some code inputs containing escaped unicode emojis, SWC minifier will output unescaped unicode emojis.
Example input:
Input code
Config
Link to the code that reproduces this issue
https://play.swc.rs/?version=1.11.18&code=H4sIAAAAAAAAA1OKiSl1sTB2UQIAWPmpCAkAAAA%3D&config=H4sIAAAAAAAAA1VQuW7DMAzd8xWC0KkorCBjpgxdM3YqMrAyfcGSDJJGawT590qOY8uT%2Fch3ifeDUsYo%2Fca2QQf6rHQjMvDZmI6DL55jlkBYBKoN%2F1qy%2BiOqNIeRLF5h4KgSGnGedmwjvMffCAYgRlpxEk1e4C%2FFyDQgW2oHme3mbYk2EMSw3FKpx%2FOjhcBzFcjljj3WYKfPl3InzC2vKFCCwIswr%2Ff2QDVK6oZ8Op6OS6%2F4Cmk4j7y4UI49snmP02%2B9odsae7HBV229MFaQEbgBwnIhrOC2a%2FQDjF%2FUp0qF4eXw83IJ3U6dzpl4NjgXfMd6Y7a%2Brab1Lo%2FDP5Tvfnb0AQAA
SWC Info output
After being minified, if the unicode chars are escaped, they should also be escaped in the output
\\uD83D
is not equivalent to\uD83D
Expected behavior
\\uD83D
should remain\\uD83D
Actual behavior
\\uD83D
is unescaped to\uD83D
Version
1.11.18
Additional context
Prettier website bug: prettier/prettier#17308
Docusaurus bug report: facebook/docusaurus#11047
The text was updated successfully, but these errors were encountered: