010101 yep, that's a common practice in Twitter and Instagram. It would be great if you could fix it 🙂

    Arnold Done.

    Version 3.5 released

    • Adds back underscore and also hyphen support... because, why not? 🙂
      6 days later

      @010101this is great have you consider the possibility of building an extension based on this. We can pull out the search result and display a list a related post links based on hashtag

        huuduy216 I’m sorry I do not understand if this is a question or not. You can click a hashtag and it runs a search finding other posts with that word.

          010101 yes you can. I'm saying that have you ever thought of making it ever better, completely out of scope of this extension better. We would make an extension that can display related post based on their hashtag.

            huuduy216 Gotcha. Yes, I think/hope that one day a developer will come along and make a really nice/fancy hashtag solution. Something on par with Twitter. But, I won’t be able to do that. 😅

              8 days later

              This extension isn't compatible with beta 14+. Unless someone wants to adopt this extension, or give me the exact code to patch it, I think it'll have to go to the extension graveyard 💀 . From what I've read so far I assume it is due to Mithril 2.0. More specifically due to config no longer being a lifecyle hook? I don't have the skills to update it even though it's probably relatively simple. I tried making some guesses after reading some docs, but no luck.

              I feel bad because I do think there are several people that use this. But, we'll have to wait for a developer to possibly, one day, create a new hashtag extension. One that is probably way better than this one.

                010101 CommentPost.prototype.config is now CommentPost.prototype.oncreate and CommentPost.prototype.onupdate. There's no longer an isInitalized parameter, instead oncreate is called once, and onupdate is called for subsequent redraws.

                Basically

                extend(CommentPost.prototype, 'config', function (out, isInitialized, vnode) {
                    // [the code]
                });

                becomes

                extend(CommentPost.prototype, 'oncreate', function (out, vnode) {
                    // [the code]
                });
                extend(CommentPost.prototype, 'onupdate', function (out, vnode) {
                    // [the code]
                });

                A function can be used to not repeat the code.

                Or, when isInitialized is used:

                extend(CommentPost.prototype, 'config', function (out, isInitialized, vnode) {
                    if (isInitialized) return;
                    // [the code]
                });

                becomes

                extend(CommentPost.prototype, 'oncreate', function (out, vnode) {
                    // [the code]
                });

                EDIT: ignore my previous edit referencing super, it only applies if you were creating your own components.

                  clarkwinkelmann Thank you for being willing to help! The problem is that this is one of those extensions done the wrong way where everything is in the extend.php file.

                  This isn't working:

                  <script>
                  flarum.core.compat.extend.extend(flarum.core.compat['components/CommentPost'].prototype, 'oncreate', function (output, context) {
                      if (context.customExtLastContentHtml !== context.contentHtml) {
                  
                             // [the code]    
                  
                     context.customExtLastContentHtml = context.contentH tml;
                    });
                  </script>

                  Original code that did work until beta 14:

                  <script>
                    flarum.core.compat.extend.extend(flarum.core.compat['components/CommentPost'].prototype, 'config', function(output, isInitialized, context) {
                      if (context.customExtLastContentHtml !== context.contentHtml) {
                  
                                      // [the code]    
                  
                     context.customExtLastContentHtml = context.contentH tml;
                    });
                  </script>

                    010101 So it will not be updated?
                    Or you not sure about that?
                    Maybe you could go on Discord and try ask some help on devs.

                    I would help if i had knowledge for that, but i do not!
                    Im sure they will find some minutes to give a hand

                    Good luck

                    010101 The arguments to oncreate are different than those to config. Replace the second argument with vnode. Then, where you need to access the DOM element, use vnode.dom

                    Version 3.7 released

                    • Updated version constraints in composer.json
                    • Updated Mithril Lifecyle hook which means - now compatible with beta 14

                      010101 awesome, thank you very much for your effort and time to keep the extension 😄

                      2 months later
                      3 months later
                      • Beta 16 ready
                      • Now updates both on full page refresh and after editing a post

                      Update with:
                      composer require zerosonesfun/hashtags

                        010101 Found a serious bug. Anytime I'm trying to reply to someone, the message is created insite a code line