mirror of
https://github.com/zulip/zulip.git
synced 2026-06-03 21:01:43 +08:00
The client previously translated linkifier regexes to native JavaScript RegExp via `python_to_js_linkifier`, which could not preserve re2 semantics: named groups had to be rewritten, Perl flags were silently stripped, and the trailing word-boundary used JS `\w` (which includes `_`) instead of the server's `[^\pL\pN]`. `contains_problematic_linkifier` had to fall back to server-side rendering whenever a pattern might match differently on the client. re2js is a JavaScript port of the same re2 engine the server uses, allowing the client to execute user patterns directly without translation. This lets us delete the regex translator and the `contains_problematic_linkifier` fallback, align the client's boundary handling with the server, expand local echo to cover linkifier matches that previously required a server round trip, and extend RE2's linear-time matching guarantee to user-supplied regexes on the client, eliminating linkifier-driven ReDoS exposure. |
||
|---|---|---|
| .. | ||
| marked.cjs | ||
| marked.d.cts | ||