Opened 7 years ago

Last modified 4 years ago

#9235 assigned enhancement

Allow the line numbers to be specified using TracLinks syntax

Reported by: Ryan J Ollos Owned by: Ryan J Ollos
Priority: normal Component: CodeExampleMacro
Severity: normal Keywords:
Cc: Trac Release: 0.11


Matching a regex is pretty error prone and there are several characters that prevent a match from occurring, probably because they are not property escaped in the CodeExampleMacro code (e.g. //, but these errors should be the subject of a different ticket).

For this ticket, I'm requesting the ability to skip the regex and just provide a start index and number of lines, using TracLinks#source:links syntax.

The syntax would be, e.g.: path=/path/to/file.cpp@1678:10-20, to show lines 10-20 of file.cpp at revision 1678. Alternatively, it could look like path=/path/to/file.cpp@1678#L10 or path=/path/to/file.cpp@1678#L10-20, since there is not necessarily an obvious relationship between TracLinks syntax and that which would be used by this macro. Using the syntax in one of the latter examples would also leave open the possibility of using the :10-20 syntax for highlighting a section of code within the code block displayed by this macro.

Attachments (0)

Change History (1)

comment:1 Changed 4 years ago by Ryan J Ollos

Owner: changed from Alexander Slesarev to Ryan J Ollos
Status: newassigned

Modify Ticket

Change Properties
Set your email in Preferences
as assigned The owner will remain Ryan J Ollos.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.