Skip to content

fix(content): parse hashtags containing non-ASCII Unicode letters#398

Open
dmnyc wants to merge 1 commit into
mainfrom
fix/hashtag-unicode-truncation
Open

fix(content): parse hashtags containing non-ASCII Unicode letters#398
dmnyc wants to merge 1 commit into
mainfrom
fix/hashtag-unicode-truncation

Conversation

@dmnyc

@dmnyc dmnyc commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • combinedRegex's hashtag pattern matched an ASCII-only character class ([a-zA-Z0-9_-]), so tags with umlauts, accents, or non-Latin letters stopped matching at the first non-ASCII codepoint — the rest of the tag rendered as plain, untappable text
  • Switched to \p{L} (Unicode letter property) so hashtags with any script parse as a single token, matching the composer's existing ComposerTextStyling.hashtagRegex which already used \p{L}\p{N}

Reproduction

#Kreuzworträtsel → was #Kreuzwortr (tappable) + ätsel (plain text); now the full tag is tappable. Same fix applies to #Weltbürger, #MuskelbasierteMobilität, and any hashtag with non-ASCII letters (CJK included).

Fixes #396

Test plan

  • Build succeeds, installed and ran on simulator
  • Verified fix against reported examples with a standalone regex test (Kreuzworträtsel, MuskelbasierteMobilität, Weltbürger, café, 日本語 all now match in full)
  • Manually confirm the reported note renders hashtags correctly in-app

combinedRegex's hashtag pattern matched an ASCII-only character class
([a-zA-Z0-9_-]), so tags with umlauts, accents, or non-Latin letters
(e.g. #Kreuzworträtsel, #Weltbürger) stopped matching at the first
non-ASCII codepoint — the rest of the tag rendered as plain, untappable
text. Switch to \p{L} (Unicode letter property) so hashtags with any
script parse as a single token, matching the composer's existing
ComposerTextStyling.hashtagRegex which already used \p{L}\p{N}.

Fixes #396
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.

Hashtags containing non-ASCII characters (ä, ü, ö, etc.) get truncated mid-word (cross-platform — needs Android fix too)

1 participant