Skip to content

Regex highlighting breaks when emojis are present #552

@cyriltobler

Description

@cyriltobler

When using a regex pattern that highlights text containing emojis, the match highlighting appears incorrect. Instead of highlighting only the intended characters, the highlighting becomes misaligned due to emojis being counted incorrectly in the string.

Image

Expected Behavior:
The regex should highlight the entire line after the first uppercase letter, regardless of emojis.

Actual Behavior:
The highlighter forgets to highlight as many characters as there are emojis.

  • With 1 emoji → 1 character is not highlighted
  • With 2 emojis → 2 characters are not highlighted
  • With 3 emojis → 3 characters are not highlighted

Environment:

  • only in PCRE

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions