没有不值得去解决的问题,也没有不值得去学习的技术!

Fixing Anchor Links That Fail to Jump in Markdown Documents With PhpStorm

Clicking an anchor in a Markdown document fails to jump to the corresponding location

1. Clicking an anchor in a Markdown document fails to jump to the corresponding location. See Figure 1.

Clicking an anchor in a Markdown document fails to jump to the corresponding location
Figure 1

2. In PhpStorm, open the editor. When hovering over #1-overview, it prompts: Cannot resolve location marker #1-overview. See Figure 2.

In PhpStorm, open the editor. When hovering over #1-overview, it prompts: Cannot resolve location marker #1-overview
Figure 2

3. When typing #1, the IDE auto-completes; select 1-. See Figure 3.

When typing #1, the IDE auto-completes; select 1-
Figure 3

4. Then, when hovering over #1- with Ctrl held down, it prompts: 1. 概述. And after Ctrl + Click, it automatically navigates to ## 1. 概述. Repeat this process until all anchor links are free of wavy underline warnings. See Figure 4.

Then, when hovering over #1- with Ctrl held down, it prompts: 1. 概述. And after Ctrl + Click, it automatically navigates to ## 1. 概述. Repeat this process until all anchor links are free of wavy underline warnings
Figure 4

5. Clicking the anchor #1- in the Markdown document still fails to jump to the corresponding location. See Figure 5.

Clicking the anchor #1- in the Markdown document still fails to jump to the corresponding location
Figure 5

6. Change #1- to #1-概述. Although the IDE prompts: Cannot resolve location marker #1-概述, clicking the anchor #1-概述 in GitLab’s Markdown document now successfully jumps to the corresponding location. See Figure 6.

Change #1- to #1-概述. Although the IDE prompts: Cannot resolve location marker #1-概述, clicking the anchor #1-概述 in GitLab's Markdown document now successfully jumps to the corresponding location
Figure 6

7. It is recommended to use English for anchor names whenever possible, as this makes the routes more semantic. See Figure 7.

It is recommended to use English for anchor names whenever possible, as this makes the routes more semantic
Figure 7

 

关于作者 · 持续学习与技术实践

我是一名拥有 15 年以上开发经验的技术从业者,自 2013 年起持续运营个人技术博客,记录工作与个人项目中遇到的真实问题,以及解决问题过程中的探索、实践和思考。

除了技术写作,我也在持续开发和维护自己的独立项目,探索新技术和新工具在实际场景中的应用。我始终相信,没有不值得去解决的问题,也没有不值得去学习的技术。

如果这篇文章对你有所帮助,欢迎浏览博客中的其他文章,也欢迎交流技术经验与想法。

关于我  ·  GitHub  ·  邮件联系