Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Anchor is removed after redirection #154

Closed
chenjiahan opened this issue Oct 10, 2023 · 6 comments · May be fixed by #157
Closed

[Bug]: Anchor is removed after redirection #154

chenjiahan opened this issue Oct 10, 2023 · 6 comments · May be fixed by #157
Assignees
Labels
🐞 bug Something isn't working

Comments

@chenjiahan
Copy link
Member

Version

-

Details

When an English user visits https://modernjs.dev/builder/api/config-html.html#htmldisablehtmlfolder, the URL will be redirected to https://modernjs.dev/builder/en/api/config-html.html, and the hash anchor is removed.

The hash anchor may be the same between the English and Chinese documentation, so it is better to keep the hash anchor.

Reproduce link

https://modernjs.dev/builder/api/config-html.html#htmldisablehtmlfolder

Reproduce Steps

See above.

@zoolsher
Copy link
Contributor

I'll fix this

@zoolsher
Copy link
Contributor

zoolsher commented Oct 10, 2023

I didn't find a good way to fix this and I looked into the community it seems to be a common issue.

The reason is the anchor in Chinese and english are not the same and it happens to be the same in this case(both #htmldisablehtmlfolder). Vue website have the same issue.

If we simply add the anchor to the link, would it be confusing that the anchor only works sometime?

@chenjiahan @sanyuan0704 What's your opinion on this?

@chenjiahan
Copy link
Member Author

If we simply add the anchor to the link, would it be confusing that the anchor only works sometime?

Sometimes it's just a useless anchor, it's fine because it does not break anything..

@zoolsher
Copy link
Contributor

But I believe some of the community would prefer a clean url 😄

@chenjiahan
Copy link
Member Author

That's true 😂

@sanyuan0704
Copy link
Collaborator

sanyuan0704 commented Oct 10, 2023

I think the anchor can be reserved to make the experience in some cases better. The hash is computed from markdown/mdx title so we cannot ensure the hash is consistent between different languages. But from the perspective of framework, we can keep the same experience as much as possible, although not 100% accurate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants