Repository navigation
Commit 484a007
fix(feishu): replace longer mention keys first to avoid prefix collisions
Feishu assigns sequential, non-zero-padded mention keys (@_user_1, @_user_2, ...
@_user_10, @_user_11). normalizeMentions replaced each key with a global regex,
so once a message mentions 10+ users the @_user_1 replacement also matched the
@_user_1 prefix inside @_user_10/@_user_11/..., corrupting the longer-keyed
users. Replace longer keys first so a shorter key can never match inside a
longer one (the longer key is already substituted by the time the shorter key's
turn comes), which also correctly handles a key immediately followed by text.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>1 parent d3dc7aa commit 484a007
2 files changed
Lines changed: 34 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
277 | 277 | | |
278 | 278 | | |
279 | 279 | | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
280 | 284 | | |
281 | | - | |
| 285 | + | |
| 286 | + | |
282 | 287 | | |
283 | 288 | | |
284 | 289 | | |
| |||
0 commit comments