Hashtag linked categories do not show up properly in the composer

 #javascript

JS - 1. Getting Started ...
 #javascript:getting-started-v2 

JS - 2. Code your own adventure
 #javascript:javascript-beginner-en-x9DnD 

JS - 3. Intro to Functions
 #javascript:javascript-beginner-en-6LzGd 

JS - 4. RPS
 #javascript:javascript-beginner-en-Bthev-mskY8

(works only in the codecademy site, but you might get the idea)

In the composer, not all of these links look live. After you submit the post they appear fine. If you go back into the composer they will not look live again.

The ones that aren’t showing as live have this class (in the composer):

class="hashtag hashtag-tested tag-hashtag-tested"

The ones that do show live have:

class="hashtag"

This is an image demo:

Note that only the first two are showing live (clickable). But when you submit the post, they all appear live.

This is the relevant JavaScript category over those forums, if it’s needed.


Credits to @AlbionsRefuge for the initial draft :slight_smile:

2 Likes

I got the relevant files after some manual digging. They are these three:

https://github.com/discourse/discourse/blob/fb6bd10d4c8002659a8775e6d90c845ae1d92f58/app/assets/javascripts/discourse/dialects/category_hashtag_dialect.js

https://github.com/discourse/discourse/blob/350f1685e52a72d4edeb12c38e292d7e77df168b/app/assets/javascripts/discourse/lib/category-hashtags.js.es6

The following file adds the "hashtag-tested" class:
https://github.com/discourse/discourse/blob/c2c1aea381833c167243be2ee3bb70749b08b528/app/assets/javascripts/discourse/lib/link-category-hashtags.js.es6

Now, it should be probably easy to find the bug.

2 Likes

I’ll have a look next week.

2 Likes

Thanks for reporting @GaurangTandon :slight_smile: Turns out category slugs are case sensitive but my query wasn’t.

Fixed in
https://github.com/discourse/discourse/commit/6d64b6d39f864947ea1fa52985dc669cd324c481

4 Likes