website icon indicating copy to clipboard operation
website copied to clipboard

[docs/zustand] Question marks in links removed in Github, not docs

Open chrisk-7777 opened this issue 3 years ago • 2 comments

Hey 👋

A PR was raised on Zustand docs (https://github.com/pmndrs/zustand/pull/1398), and an interesting tidbit came up. When it comes to a "?" in a documentation title/subtitle, Github (I believe incorrectly) strips them. Whereas this project (correctly) keeps them.

For context, one of the goals of the Zustand docs is for the docs and links to work across both Github and the docs site. I don't know if the same applies to the other pmndrs projects.

The example from the PR is:

See [How can I check if my store has been hydrated?](#how-can-i-check-if-my-store-has-been-hydrated?)

If the user is viewing the md in Github it won't correctly link to the right spot on the page (because the ? is stripped in the final output). If the user is viewing the page on the docs site it works correctly.

However, if we go the other way:

See [How can I check if my store has been hydrated?](#how-can-i-check-if-my-store-has-been-hydrated)

It will work in Github but not the docs site.

Before I raise a PR @CodyJasonBennett I wanted to get your input. What would you leans towards?

  • Stripping the "?" within the docs to align with Github?
  • Leave it as a known limitation with GH?
  • Other?

chrisk-7777 avatar Oct 31 '22 13:10 chrisk-7777

I would prefer if we could have section links on the site be forgiving to cases like this. We can then align with GitHub without consequence.

CodyJasonBennett avatar Nov 01 '22 14:11 CodyJasonBennett

Thanks Cody, I'll get a PR organised so section links align with GH

chrisk-7777 avatar Nov 02 '22 01:11 chrisk-7777