Search code examples
markdowngithub-flavored-markdown

How to link to section with `/` in the name in github markdown


I have the following section in my markdown code (.md file) in github:

## src/app/contextBroker/

I want to inclue a link to it from one point in the same .md file. However, it seems that / is somehow problematic. I have tried:

[src/app/contextBroker/ (Main program)](#src-app-contextBroker-)

and

[src/app/contextBroker/ (Main program)](#src/app/contextBroker/)

and the same in lowercase:

[src/app/contextBroker/ (Main program)](#src-app-contextbroker-)
[src/app/contextBroker/ (Main program)](#src/app/contextbroker/)

but no one has worked.

Any idea on the right sintax to use in this case, please?


Solution

  • Following @JJJ advice (thanks!) I have realized that it works just removing the slashes in the lowercase variant. In sum:

    [src/app/contextBroker/ (Main program)](#srcappcontextbroker)