reStructuredText 中部分单词加粗

问题描述 投票:0回答:2

如何在 reStructuredText 中将单词的一部分加粗?

这是我需要的示例:“.rst 代表 restructured text。”

documentation formatting restructuredtext
2个回答
68
投票

我很惊讶你不能简单地写

.rst stands for **r**e**s**tructured **t**ext.

但是 reStructuredText 规范确实规定内联标记后面必须跟有空格或以下之一

-
.
,
:
;
!
?
\
 /
 '
"
)
]
}
>
,因此上面的 reStructuredText 字符串not 有效。但是,只需进行微小的更改即可获得带有反斜杠转义的有效 character 标记。将上面的内容改为

.rst stands for **r**\ e\ **s**\ tructured **t**\ ext.

工作正常。要查看此操作的实际效果,请尝试使用在线 reST 到 HTML 转换器


0
投票

另一种解决方案是使用设置 character-level-inline-markup。然后,示例标记

.rst stands for **r**e**s**tructured **t**ext.
按预期工作。

© www.soinside.com 2019 - 2024. All rights reserved.