Skip to content

Commit

Permalink
[docs] Clarify how to escape curly braces in samp text (#11987)
Browse files Browse the repository at this point in the history
Co-authored-by: Bénédikt Tran <[email protected]>
  • Loading branch information
demetrios-koziris and picnixz committed Feb 22, 2024
1 parent f4eea66 commit faa33a5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion doc/usage/restructuredtext/roles.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down

0 comments on commit faa33a5

Please sign in to comment.