Files
Jam Balaya 0d838fa69d Fix Unicode nickname matching (#5121)
## What changed

- Match nickname tokens with Unicode letters and numbers while
preserving IRC nickname characters.
- Use Unicode-aware word boundaries for nickname highlights.
- Add regression coverage for Polish text, Unicode nicknames, and
existing IRC nickname characters.

## Why

The previous regular expressions used ASCII-only character classes. This
caused a one-character nickname such as `D` to be detected inside words
containing Polish diacritics, for example `dzięki`.

## Before / after

| Before (v4.5.2) | After (this PR) |
|:---:|:---:|
|
![Before](https://raw.githubusercontent.com/JamBalaya56562/thelounge/pr5121-assets/pr5121-before.png)
|
![After](https://raw.githubusercontent.com/JamBalaya56562/thelounge/pr5121-assets/pr5121-after.png)
|

| Scenario | Before | After |
|---|---|---|
| Nick `Ądam42` appears in a message | Not recognized as a nick —
rendered as plain text (no color, not clickable) | Recognized and
colored like any other nick |
| `Ćadam` / `adamć` with your nick `adam` | Falsely highlighted as a
mention of you | Not highlighted |
| Genuine mention `hey adam` | Highlighted | Highlighted (no regression)
|

<sub>Screenshots are a faithful reproduction rendered with TheLounge's
real <code>client/css/style.css</code> and the actual old/new regexes
(not a live IRC capture).</sub>

## Validation

- Direct Unicode nickname extraction and boundary checks with Node.js 24
- Full Vitest/lint suite not run because repository dependencies were
unavailable and dependency installation stalled in the local environment

Fixes #4930
2026-07-15 20:16:44 -07:00
..