Edgewall Software
Modify

Opened 18 years ago

Closed 18 years ago

Last modified 18 years ago

#2801 closed enhancement (fixed)

ReST: code-block role does not accept options

Reported by: Sébastien Bigaret <sbigaret@…> 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)

trac.rst_code-block_role.patch (1.2 KB ) - added by Sébastien Bigaret <sbigaret@…> 18 years ago.

Download all attachments as: .zip

Change History (3)

by Sébastien Bigaret <sbigaret@…>, 18 years ago

comment:1 by Matthew Good, 18 years ago

Resolution: fixed
Status: newclosed

Added in [2938]. Thanks for the patch.

comment:2 by anonymous, 18 years ago

Milestone: 0.10

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jonas Borgström.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jonas Borgström to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.