[codex] Prevent Telegram market symbol auto-links - #125
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 65fb0eb5c3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| except ImportError: # pragma: no cover - compatibility with older pinned shared wheels | ||
| _merge_strategy_plugin_i18n = None | ||
|
|
||
| _TELEGRAM_MARKET_SYMBOL_LINK_RE = re.compile(r"(?<![A-Za-z0-9_])([A-Z0-9]{1,12})\.([A-Z]{2,4})(?![A-Za-z0-9_])") |
There was a problem hiding this comment.
Preserve URLs when suppressing symbol auto-links
When a Telegram message contains an uppercase URL or domain such as https://SOXL.US/report or https://EXAMPLE.COM, this regex still matches the hostname/path segment and _break_telegram_market_symbol_auto_links inserts \u2060 into the URL. That changes the actual link target and can make real links in arbitrary sender messages unusable, even though only standalone market symbols should be altered.
Useful? React with 👍 / 👎.
Summary
Validation