问题
Given the following reST document
.. |bar| replace:: baz
bolded? :strong:`\ |bar|\ `
bolded? **\ |bar|**
.. This one errors out
.. bolded? **\ |bar|\ **
How do I create a bolded, substituted value? I want
bolded? baz
Here's a link to the online editor to test it out: http://rst.ninjs.org/?n=f57ac95e1fe1643572b45d7ae8f8950c&theme=basic
回答1:
As reStructuredText doesn't support nested inline markup, the only way to create a reference with styled text is to use substitutions with the "replace" directive
http://docutils.sourceforge.net/docs/ref/rst/directives.html#replacement-text
来源:https://stackoverflow.com/questions/33537747/substitution-inside-inline-markup-while-escaping-whitespace