We are importing a bunch of posts, and the content often contains text like @global or similar (the topic of our discourse instance is related to programming, and @ is a symbol in that language).
Is there a nice and clean way to suppress pinging users? I don’t mind pre-processing the posts before importing.
As a kinda dirty workaround, I found that inserting an empty bbcode tag after the @ works (like @[b][/b]global). It just doesn’t feel like a very good solution and would require me to parse/tokenize the markdown, since the bbcode should not be inserted if the string is within a code block. So it is not a good solution. A zero-width space is also not a solution as that will lead to weird errors when users copy the code snippet into their own source code.
Sure if the @name is in a codeblock then it’s not a problem. The problem is detecting when it is and when it isn’t, so that I can prevent the ping outside of codeblocks by inserting the invisible [b][/b] tag between @ and the name. It would indeed require a full markdown parser/tokenizer.
Hmm, does that still apply even when the post is later rebaked or would that lead to random pings in that event?