-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Fix the "converters" header link in the README #291
Conversation
Added an anchor in the converters section heading for the link from the encodings section to point to (previously, the id didn't exist so the link didn't do anything)
I don't understand what this do. All headers in Github markdown have links Can you please elaborate or record a video showing the difference? Thanks. |
Closing due to the lack of feedback from the OP. If you want to continue the discussion, please comment here mentioning one of the project members. |
@FagnerMartinsBrack sorry for the delay, I've added a screengrab (below) unless it gets compressed, full size you should be able to see the difference - the left is the version in this PR, the right if the current master. |
Shouldn't it be |
Probably the fix is in the link, not the header. The link should point to |
It looks like this typo has existed since June 2016 when it was added. See the "Encoding" section in the context of that revision. |
In that revision and previous ones I looked at it doesn't appear to have an anchor or name. The github markdown generator does add a custom |
Maybe Github does some magic, the important thing is that it works even without an (Don't ask me why)
That's not what we should link to. That's Github generated markup. We shouldn't be adding to the project's Markdown level something that is of knowledge of Github only. Github can change the In this case, the best approach is to simulate the same link that Github adds when you click on the anchor in the left side of the title, see the image below: That link points to https://github.com/js-cookie/js-cookie/tree/4e77d05b59692b664fe869f3e2dd54b77c13badf#converters The likelihood of Github supporting their header generated anchor format is much higher than supporting a consistent generated HTML markup. Since they don't explicitly document that anchor and how link to them (or at least I'm not aware of any docs about it) this is still internal, but it's using an internal that if changed will also break several other projects out there. For that reason, it's safer than inspecting the HTML markup and linking to a custom anchor tag like The Given the tradeoffs, fixing the line 145 to point to Make sense? |
@FagnerMartinsBrack as discussed, I attempted with a change to #converters but that doesn't help either - you can see this at https://github.com/a2wd/js-cookie/blob/master/README.md#converters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@FagnerMartinsBrack as discussed, I attempted with a change to #converters but that doesn't help either - you can see this at https://github.com/a2wd/js-cookie/blob/master/README.md#converters
It doesn't work with your link because you have changes in the header where there's an additional space on it before the tag you have added in the markdown, so the header anchor is interpreted as #converters-
instead of #converters
. Here's the same link you posted but now working: https://github.com/a2wd/js-cookie/blob/master/README.md#converters-
By the way, according to the contributing guidelines, we require PRs to be open using a topic/feature branch instead of master
. See this for additional info: https://help.github.com/articles/about-pull-requests/
README.md
Outdated
@@ -225,7 +225,7 @@ Cookies.get('name'); // => 'value' | |||
Cookies.remove('name', { secure: true }); | |||
``` | |||
|
|||
## Converters | |||
## Converters <a name="converter"></a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As explained in the submitted review, if you remove <a name="converter"></a>
, then the link will just work.
Ping @a2wd. Are you still looking into this? |
Again, sorry for the delay - this is now done and working 👍 |
Added an anchor in the converters section heading for the link from the encodings section to point to (previously, the anchor tag/name attribute didn't exist so the link didn't do anything)