Watched words links corrupt @mentions and #categories

I’ve just converted from @sam’s great Linkify Words theme component to the fairly new core Watched Words.

Unfortunately, this has broken any @mentions, #categories, and tags that happen to contain a Watched Word in the posts on our forum. There are quite a lot of these.

The Theme Component had pretty good logic for this - could this aspect also be incorporated into the core functionality?

4 Likes

I see, yes something is not feeling right here, @nbianca can probably have a look in a week or so.

We have DiscourseConnect → https://meta.discourse.org/t/13045

I guess the gap here is that @ and # should be treated as part of the word and #DiscourseConnect should not be auto linked?

4 Likes

If reasonably possible, the safest behaviour would seem to me to be only applying a watched words match if an @mentions, #categories or tags match has not already been made.

That would allow mention/category/tag links to be used where watched words happen to overlap while also still allowing watched words to catch something in e.g. #NotACategoryOrTag

1 Like

Words preceded by # or @ will no longer be replaced by other words or links since this PR was merged:

4 Likes