Skip to content

[compiler] Fix for string attribute values with emoji #33096

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

Merged
merged 1 commit into from
May 3, 2025

Conversation

josephsavona
Copy link
Member

@josephsavona josephsavona commented May 2, 2025

Stack from ghstack (oldest at bottom):

If a JSX attribute value is a string that contains unicode or other characters that need special escaping, we wrap the attribute value in an expression container. However, our unicode to detect this only handled the basic unicode character plane, not the "astral" plane which includes emojis.

This PR updates the regex to detect such extended characters and also use an expression container.

Expands on the fix from #29141, #29648, etc.

Closes #32915.

If a JSX attribute value is a string that contains unicode or other characters that need special escaping, we wrap the attribute value in an expression container. However, our unicode to detect this only handled the basic unicode character plane, not the "astral" plane which includes emojis.

This PR updates the regex to detect such extended characters and also use an expression container.

[ghstack-poisoned]
josephsavona added a commit that referenced this pull request May 2, 2025
If a JSX attribute value is a string that contains unicode or other characters that need special escaping, we wrap the attribute value in an expression container. However, our unicode to detect this only handled the basic unicode character plane, not the "astral" plane which includes emojis.

This PR updates the regex to detect such extended characters and also use an expression container.

ghstack-source-id: 6d9c8e4
Pull Request resolved: #33096
@josephsavona josephsavona requested review from poteto and mofeiZ and removed request for poteto May 2, 2025 06:49
@josephsavona josephsavona requested a review from poteto May 2, 2025 06:51
@josephsavona josephsavona merged commit 5f3b1b4 into gh/josephsavona/77/base May 3, 2025
26 checks passed
josephsavona added a commit that referenced this pull request May 3, 2025
If a JSX attribute value is a string that contains unicode or other characters that need special escaping, we wrap the attribute value in an expression container. However, our unicode to detect this only handled the basic unicode character plane, not the "astral" plane which includes emojis.

This PR updates the regex to detect such extended characters and also use an expression container.

ghstack-source-id: 6d9c8e4
Pull Request resolved: #33096
@josephsavona josephsavona deleted the gh/josephsavona/77/head branch May 3, 2025 00:08
github-actions bot pushed a commit that referenced this pull request May 3, 2025
If a JSX attribute value is a string that contains unicode or other characters that need special escaping, we wrap the attribute value in an expression container. However, our unicode to detect this only handled the basic unicode character plane, not the "astral" plane which includes emojis.

This PR updates the regex to detect such extended characters and also use an expression container.

ghstack-source-id: 6d9c8e4
Pull Request resolved: #33096

DiffTrain build for [ac2cae5](ac2cae5)
github-actions bot pushed a commit that referenced this pull request May 3, 2025
If a JSX attribute value is a string that contains unicode or other characters that need special escaping, we wrap the attribute value in an expression container. However, our unicode to detect this only handled the basic unicode character plane, not the "astral" plane which includes emojis.

This PR updates the regex to detect such extended characters and also use an expression container.

ghstack-source-id: 6d9c8e4
Pull Request resolved: #33096

DiffTrain build for [ac2cae5](ac2cae5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants