Sphinx 重构文本 - 如果引用是在节标题之前定义的,则对节标题的引用会中断

问题描述

这按预期工作

Section Header
--------------
 
  This is a section header



Refer to section above `Section Header <#section-header>`_

但以下方法不起作用

Refer to section below  `Section Header <#section-header>`_


Section Header 
--------------

   This is a section below

这是一个 sample 来演示它。

解决方法

这里更详细地解释了这个问题以及解决方案

Anchor Test
===========

RST Section headers have a problem with references,refer to the `section below <#section-below>`_ that has the problem. The link does not work.

Section Below
-------------

This is a section below

语法 section below <#section-below>_ 的问题是部分 Section Below 的名称与 external link 语法中使用的标签匹配 section below <#section-below>_

我通过将外部链接中的标签更改为 my section below <#section-below>_

Anchor Test
===========

RST Section headers have a problem with references,refer to the `my section below <#section-below>`_ that has the problem. The link does not work.

Section Below
-------------

This is a section below