How do I make linked references to sections of the same document using Markdown where the heading title is a sentence with spaces?

我是研究僧i 提交于 2019-12-08 07:16:54

问题


While this works

1. [Notifier system requirements](#requirements)

This does not work

1. [Deployment steps](#steps to deployment)

Steps to deployment and requirements are the header/section titles in my README.md file.


回答1:


Look at the target of the rendered header, either by mousing over it or by inspecting it with your browser's devtools. You should find that the target for your "Steps to deployment" header isn't steps to deployment, but rather steps-to-deployment.

Update your link like so and it should work:

1. [Deployment steps](#steps-to-deployment)



回答2:


According to this filter (linked from github/markup), GitHub uses the following steps to convert text to a slug:

  1. Convert all characters to lowercase ASCII characters.
  2. Remove all punctuation except spaces and hyphens.
  3. Convert all spaces to hyphens.

Therefore, your link should be:

[Deployment steps](#steps-to-deployment)


来源:https://stackoverflow.com/questions/53171609/how-do-i-make-linked-references-to-sections-of-the-same-document-using-markdown

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!