如何在 reStructuredText (RST) 中创建子字符串的 link

How to make a link of a substring in reStructuredText (RST)

如何在 RST 中的字符串中创建 link?

像这样:

ImInTheMiddelOfAString - 在 TheMiddle 以及 MiddleOf.

之间不添加空格

但是在 reStructuredText (RST) 中。

如果我简单地写第一个:

ImInThe`Middel <http://foo.com>`_OfAString

我得到这个结果(所以没有 link):

ImInThe`Middel <http://foo.com>`_OfAString

如果我这样写:

ImInThe `Middel <http://foo.com>`_OfAString

我得到一个错误,最后如果我这样写:

ImInThe `Middel <http://foo.com>`_ OfAString

我得到 link 但中间有空格:

ImInTheMiddelOfAString

我发现我可以使用反斜杠来转义 space。

所以这个:

ImInThe\ `Middel <http://foo.com>`_\ OfAString

给我正确的结果:

ImInTheMiddelOfAString