python - 在内联标记内进行替换,同时转义空白

标签 python substitution restructuredtext

鉴于以下剩余文档

.. |bar| replace:: baz

bolded? :strong:`\ |bar|\ `

bolded? **\ |bar|**

.. This one errors out
.. bolded? **\ |bar|\ **

如何创建粗体替换值?我想要

bolded? baz

这里有一个在线编辑器的链接来测试它:http://rst.ninjs.org/?n=f57ac95e1fe1643572b45d7ae8f8950c&theme=basic

最佳答案

由于 reStructuredText 不支持嵌套内联标记,因此使用样式文本创建引用的唯一方法是使用“replace”指令进行替换

http://docutils.sourceforge.net/docs/ref/rst/directives.html#replacement-text

关于python - 在内联标记内进行替换,同时转义空白,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33537747/

相关文章:

python - python中的零列表

python - 如果文件夹中存在文件,请更改文件夹名称

replace - 用 Vim 文件中其他地方的寄存器或行范围的内容替换

python-sphinx - 在Sphinx中向表添加类?

Python绘制流程图、插图图

python - 如何使输入接受空格?

regex - 如何替换正则表达式匹配并在 Perl 中映射替换?

google-chrome - Chrome 字符替换

python - 如何在python中解析重组文本?

python-sphinx - 狮身人面像 : include xlsx data into rst