Skip to content

fix(web): handle emoji variation selectors in tag parsing#5774

Open
gitkeniwo wants to merge 1 commit intousememos:mainfrom
gitkeniwo:fix/tag-emoji-parsing
Open

fix(web): handle emoji variation selectors in tag parsing#5774
gitkeniwo wants to merge 1 commit intousememos:mainfrom
gitkeniwo:fix/tag-emoji-parsing

Conversation

@gitkeniwo
Copy link
Copy Markdown
Contributor

@gitkeniwo gitkeniwo commented Mar 24, 2026

This PR closes #5495 and fixes frontend tag parsing to keep emoji sequences that include Variation Selector-16 (\p{M}) and Zero Width Joiner (\u200D).

The test case is

#🤔/🤔 #🤔/text #🀄️/text #🀄️/🀄️ #🀄️test/🀄️ #test🀄️test/🀄️
image

Summary by CodeRabbit

  • Improvements
    • Enhanced tag character support to recognize Unicode combining marks and special formatting characters, enabling more flexible and diverse tag naming conventions.

@gitkeniwo gitkeniwo requested a review from a team as a code owner March 24, 2026 02:23
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 24, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3f51f2ab-3fd0-421d-9f3f-cba17bc92d0c

📥 Commits

Reviewing files that changed from the base of the PR and between 6a03917 and 2d1de0f.

📒 Files selected for processing (1)
  • web/src/utils/remark-plugins/remark-tag.ts

📝 Walkthrough

Walkthrough

The change extends tag-character validation in the remark tag parser to recognize Unicode combining marks and the zero-width joiner character as valid tag components, enabling proper parsing of emojis with variation selectors in tag names.

Changes

Cohort / File(s) Summary
Tag Character Validation
web/src/utils/remark-plugins/remark-tag.ts
Extended isTagChar to accept Unicode combining marks (\p{M}) and zero-width joiner (\u200D) as valid tag characters, fixing parsing of emojis with variation selectors.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Poem

🐰 A hop, skip, and emoji bound,
Where variation selectors hide without a sound,
Unicode marks now stand tall,
In tags they'll parse through it all! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix(web): handle emoji variation selectors in tag parsing' directly addresses the core issue: supporting emojis with variation selectors (VS16) in tag parsing, which matches the primary change.
Linked Issues check ✅ Passed The code change successfully addresses issue #5495 by extending isTagChar to recognize Unicode combining marks (\p{M}) that include VS16 and zero-width joiner (\u200D), enabling proper tag parsing for emojis with variation selectors.
Out of Scope Changes check ✅ Passed All changes in the pull request are directly scoped to fixing tag parsing for emojis with variation selectors as specified in issue #5495, with no unrelated modifications.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tag parsing truncates emojis with variation selectors

1 participant