Commit 08c42fa
fix(slack): skip @ inside email localparts when wrapping mentions (#91)
* fix(slack): skip @ inside email localparts when wrapping mentions
`SlackFormatConverter._convert_mentions_to_slack` and the AST text branch
in `_node_to_mrkdwn` rewrote `alice@example.com` to `alice<@example>.com`
because `(?<!<)@(\w+)` only skipped already-wrapped mentions, not the
localpart/domain boundary inside emails. The same one-character omission
existed in `SlackAdapter._resolve_outgoing_mentions`. Tightening the
lookbehind to `(?<![\w<])` skips both.
Real mentions still wrap:
- `Hey @alice` -> `Hey <@alice>`
- `@alice at start` -> `<@alice> at start`
Emails pass through:
- `Contact alice@example.com` -> `Contact alice@example.com`
Two regression tests in `tests/test_slack_format.py` cover the str path
and the AST path; existing mention tests untouched.
* Update src/chat_sdk/adapters/slack/adapter.py
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: patrick-chinchill <patrick@chinchill.ai>
---------
Signed-off-by: patrick-chinchill <patrick@chinchill.ai>
Co-authored-by: patrick-chinchill <patrick@chinchill.ai>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>1 parent c71442a commit 08c42fa
3 files changed
Lines changed: 20 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1651 | 1651 | | |
1652 | 1652 | | |
1653 | 1653 | | |
1654 | | - | |
| 1654 | + | |
1655 | 1655 | | |
1656 | 1656 | | |
1657 | 1657 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
203 | | - | |
| 203 | + | |
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
| |||
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
218 | | - | |
| 218 | + | |
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
202 | 219 | | |
203 | 220 | | |
204 | 221 | | |
| |||
0 commit comments