abarrak / linux-sysops-handbook

Essentials of Linux system administration.
https://abarrak.gitbook.io/linux-sysops-handbook
496 stars 58 forks source link

Index links not working on Gitbook site #3

Closed andresf91 closed 2 years ago

andresf91 commented 2 years ago

Using Chrome 98 on macOS 10.15.7:

  1. Visit https://abarrak.gitbook.io/linux-sysops-handbook/
  2. Click on any link of the index.
  3. Link fails.

Markdown headers create an anchor with the text of the link. However, GitHub and Gitbook render them differently. So links work on the former but do not on the latter.

GitHub renders the ## header with an anchor that does not include the dot in the list. Eg. ## 1. Processes -> "1-processes".

GitBook renders it with the dot. "## 1. Processes" -> "1.-processes".

There may not be a solution for both cases if there is a dot present in the header. Check my test in this fork: https://github.com/andresf91/linux-sysops-handbook/tree/andresf91-patch-1

A solution could be to replace the dots in the headers with a hyphen, like "1 - Processes" in the headers.

abarrak commented 2 years ago

Hi @andresf91,

Thanks for reporting this. It’s confirmed to be the case in gitbook. Gladly will accept your suggested solution if you have time and PR it, which sounds will solve it 👍🏻

Aron-Polner commented 2 years ago

The links still don't work for me on the gitbook page. With that I mean when clicking links in the "Table of Contents". Clicking on the links to the right works and it works while reading the README here on Github.

abarrak commented 2 years ago

True, seems the issue is not resolved. I wonder if we can find another workaround or report this discrepancy to Gitbook in markdown hash anchors rendering.