Summary
When adding a role or user ping inside of a code block, the ping is still created.Steps to reproduce
- Get the ID of a role or user.
- Write
<@&id>(for a role) or<@id>(for a user) inside of a code block (```), where "id" is the role or user ID - Send the message. The role or user will be pinged.


2 comments
Comment by ternera
561906415-312e1b23-afd4-4b89-b5f7-ea11c2df53dd.png
1120×188 | 31 kB
Comment by @cproudlock
packages/markdown_parser/src/parsers/InlineParsers.tsx(around lines 270-339) processes mentions unconditionally without checking whether they're inside a code block context. The block parser (BlockParsers.tsx) handles code blocks at a higher level, but the notification extraction layer doesn't consult the AST to check whether a mention node is a child of a CodeBlock node. The fix should be applied wherever mentions are extracted for notification purposes (not in the renderer, which already handles this correctly). Before triggering a notification for a mention, the code should walk up the AST to verify the mention isn't inside a CodeBlock or InlineCode node.