Silent link seems can't handle #anchor links

AI-generated summary

Don reported that silent links seem unable to handle anchor links, such as those found in a Table of Contents (TOC). Arkshine pointed out that the query should come before the hash, as per the specification, and provided a working example: [https://meta.discourse.org/t/-/93648?silent=true#hello-world-remote-12](https://meta.discourse.org/t/-/93648?silent=true#hello-world-remote-12). Don thanked Arkshine for the clarification. Additionally, sam noted a minor glitch in the implementation where multi parameters (e.g., ?hello=1&silent=true) may not work, but this is unlikely to be a common use case.

Hello :wave:

We use this new feature, silent links for Disable notifications for watched words link but it seems the silent link can’t handle anchor, like TOC.

If I add a silent link. It won’t jump to the correct position.
For example:
https://meta.discourse.org/t/-/93648#hello-world-remote-12?silent=true

without silent it works well
https://meta.discourse.org/t/-/93648#hello-world-remote-12

Is it possible to add a function to handle the anchor links?

I am not sure the good place is Contribute > Bug or Contribute > Feature but I think this feature primarily made to redirect to post and not to an anchor inside post, so I put it in Contribute > Feature instead.

Thank you :slight_smile:

I believe the query should always come before the hash.
See the specification here. :thinking:

This works: https://meta.discourse.org/t/-/93648?silent=true#hello-world-remote-12

Thanks @Arkshine :slight_smile: That was my bad. :smile: I don’t know why I thought that was the good way to use it. Thanks a lot for the clarification. :heart:

Note there is a minor glitch in my implementation: ?hello=1&silent=true (multi params) are probably not going to work, but I can’t really think of legit cases where we need multi param support and this feature.