Hashtag extension turns the #pXXXX part of a deleted post mention into a hashtag (Flarum 2.0)
Hi, and thanks for the extension!
I’m running Flarum 2.0 with and noticed a small display issue involving reply mentions.
What happens
When a user replies to a post, Flarum creates a post mention in this format:
@"kamildev"#p1233
If the mentioned post is later deleted, the mention is no longer rendered as a link. It appears to fall back to plain text, and the #p1233 part is then picked up by the hashtag extension and styled as a normal hashtag. The result is a broken-looking hashtag in the middle of the reply (see screenshot).
Steps to reproduce
Install and enable the hashtag extension on Flarum 2.0.
User A posts a comment.
User B replies to that comment using the reply button (this creates @"UserA"#pXXXX).
User A’s comment is deleted.
Look at User B’s reply: #pXXXX is now rendered as a hashtag.
Expected behavior
The #p123-style post reference should not be treated as a hashtag, either when it is part of a post mention or when the mention is rendered as plain text after the target post is deleted.
Possible fix
If it’s feasible, the hashtag matching could ignore patterns that match #p\d+ directly following a mention (@username), or skip text inside post mention nodes entirely. Alternatively, the pattern could simply exclude #p followed by digits only.
Happy to provide more details, test a patch, or share my setup if that helps. Thanks again!
