Modify ↓
#2801 closed enhancement (fixed)
ReST: code-block role does not accept options
| Reported by: | Owned by: | Jonas Borgström | |
|---|---|---|---|
| Priority: | normal | Milestone: | 0.10 |
| Component: | general | Version: | 0.9.4 |
| Severity: | normal | Keywords: | |
| Cc: | Branch: | ||
| Release Notes: | |||
| API Changes: | |||
| Internal Changes: | |||
Description
The way it is designed in 0.9.4, the code-block role does not accept any options, and the language is directly extracted from the content, such as in:
:code-block:`python:f = lambda x: x+2`
This prevents user from defining their own custom interpreted text roles.
The enclosed patch allows the definition of custom roles based on code-block, while preserving the default behaviour.
With the patch, the following code works as expected:
.. role:: py(code-block) :language: python :py:`f = lambda x: x+2` :code-block:`python:f = lambda x: x+2`
Attachments (1)
Change History (3)
by , 20 years ago
| Attachment: | trac.rst_code-block_role.patch added |
|---|
comment:1 by , 20 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
comment:2 by , 20 years ago
| Milestone: | → 0.10 |
|---|
Note:
See TracTickets
for help on using tickets.



Added in [2938]. Thanks for the patch.