fix(email): keep trailing combining marks and variation selectors - #6373
adhyaay-karnwal wants to merge 1 commit into
Conversation
Subject and snippet cleanup treated Unicode combining marks and variation selectors as invisible, so a decomposed accent or an emoji presentation selector at the end of a string was stripped. Restrict the trailing-noise set to whitespace and format controls. Combining Grapheme Joiner stays in that set with the other joiners.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review. 📝 SummarySummary by CodeRabbit
WalkthroughThe change updates Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The change preserves trailing combining marks and variation selectors while continuing to remove the intended trailing formatting noise. 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Fixes #5705.
remove_trailing_special_charstreated the combining-mark ranges and variation selectors as invisible, then truncated everything after the last character outside those ranges. A trailing decomposed accent (e+ U+0301) lost its accent, and an emoji variation selector could be stripped.The trailing-noise predicate is now limited to whitespace and formatting controls (zero-width spaces/joiners, BOM, NBSP, word joiner, and the existing general-punctuation format ranges). Combining marks and variation selectors are preserved.
U+034F COMBINING GRAPHEME JOINER stays in the noise set: it is a joiner/format control, not a meaning-bearing accent, which matches the issue's request to keep joiner cleanup intact.
Note
Low Risk
Narrow change to subject/snippet trailing cleanup with added regression tests; improves display correctness without touching auth or data paths.
Overview
Fixes incorrect truncation of email subjects/snippets that end with decomposed accents or emoji variation selectors.
is_invisible_charinclean_subject_snippet.rsno longer treats combining diacritical marks or variation selectors as trailing noise, soremove_trailing_special_charsstops before those characters instead of stripping them. Zero-width spaces, BOM, NBSP, word joiner, U+034F grapheme joiner, and the existing general-punctuation format ranges are still removed from the end.New unit tests cover preserved
café/naïve-style trailing marks, emoji with U+FE0F, and format controls still stripped after a combining mark.Reviewed by Cursor Bugbot for commit cc63e46. Bugbot is set up for automated code reviews on this repo. Configure here.