Emoji: Replace subdivision and transgender flags when only the flag test fails - #13581
Open
Jiwoon-Kim wants to merge 1 commit into
Open
Jiwoon-Kim wants to merge 1 commit into
Jiwoon-Kim wants to merge 1 commit into
Conversation
…est fails. With `everythingExceptFlag`, `wp-emoji.js` replaced only country, rainbow and pirate flags, although the flag support test also checks the transgender flag and the England flag. England, Scotland, Wales and the transgender flag were left as text a browser cannot draw. Adds subdivision tag sequences and the transgender flag to the list, with a QUnit page covering each kind of flag. See #63451. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When a browser passes the
emojisupport test but fails theflagtest,settings.supports.everythingExceptFlagis true andwp-emoji.jsreplaces only what matches its flag list: country flags (regional indicator pairs) and the rainbow and pirate flags. Theflagtest itself checks three sequences, the transgender flag, the Sark flag and the England flag, and the first and last of those are not on the list. So on a system that fails the test because of them, England, Scotland, Wales and the transgender flag are left to a font that cannot draw them; England shows as a plain black flag. That is the report in Core Trac #63451.This adds the two missing kinds to the list:
1f3f4-e0067-e0062-e0065-e006e-e0067-e007ffor England);1f3f3-fe0f-200d-26a7-fe0f.A black or white flag on its own is not a flag sequence and is still left as text, as before.
The bug is hidden at the moment because Core Trac #66104 makes the
emojitest fail in every browser, so everything is replaced. Once Core Trac #66104 is committed, browsers that draw Emoji 17 but not these flags return toeverythingExceptFlag, and the report comes back.Testing: a new QUnit page,
tests/qunit/wp-includes/js/emoji-flags.html, loadswp-emoji.jswitheverythingExceptFlagand checks, throughwp.emoji.parse(), that country, England, Scotland, Wales, transgender, rainbow and pirate flags each become one image with the expected code, and that a non-flag emoji and a lone black flag stay text. With trunk'swp-emoji.js, 8 of its 16 assertions fail (England, Scotland, Wales and transgender); with this change all pass. The page is separate from theemoji.htmlpage proposed in #13568 for Core Trac #66120, so the two pull requests do not touch the same test file.jshintpasses on both changed scripts.Trac ticket: https://core.trac.wordpress.org/ticket/63451
Use of AI Tools
This pull request was prepared with Claude Code (Anthropic). It read the flag test and replacement list, confirmed the icon codes by running Core's
twemoji.js, wrote the fix and the QUnit tests, and ran the tests and lint checks locally.