mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
[docs] Clarify how to escape curly braces in `samp` text (#11987)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
f4eea669e0
commit
faa33a53a3
@@ -240,7 +240,10 @@ different style:
|
||||
:rst:role:`code` role instead.
|
||||
|
||||
.. versionchanged:: 1.8
|
||||
Allowed to escape curly braces with backslash
|
||||
Allowed to escape curly braces with double backslash. For example, in
|
||||
``:samp:`print(f"answer=\\{1+{variable}*2\\}")```, the part ``variable``
|
||||
would be emphasized and the escaped curly braces would be displayed:
|
||||
:samp:`print(f"answer=\\{1+{variable}*2\\}")`
|
||||
|
||||
There is also an :rst:role:`index` role to generate index entries.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user