Opened 6 years ago

Closed 6 years ago

#10055 closed defect (fixed)

Class name for ticket number's <span> is wrong

Reported by: keshav.kini@… Owned by: Ryan J Ollos
Priority: normal Component: DuplicateTicketSearchPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.12


A ticket number in the search results which has status "closed" and resolution "duplicate" is displayed with the following HTML:

<span class="closed: duplicate">#12704</span>

The correct way to name the class, which corresponds with the display style of ticket numbers in Trac's native wiki formatting output, would be the following:

<span class="closed duplicate">#12704</span>

The current behavior causes custom CSS styles to fail to apply to this ticket, as colons are not allowed in class names.

Attachments (0)

Change History (4)

comment:1 Changed 6 years ago by Ryan J Ollos

Status: newassigned

Finally got around to attempting to fix this. There was an error in the summaryRegex.

I have a question though. If I add the wiki markup #2, with ticket #2 being closed, inspecting the element displays a.closed.ticket. Inspecting the #2 displayed by DuplicateTicketSearchPlugin displays span.closed, and you had proposed span.closed.<resolution>. Do we want to add the resolution to the class, or rather trying to emulate the WikiMarkup - that is, drop the span and append ticket to the class for the a element?

CSS is not my strong suite, so I'd appreciate any guidance you can provide. I've bumped the plugin revision to 1.0.2, but added the dev tag until we have resolution on this issue.

comment:2 Changed 6 years ago by Ryan J Ollos

(In [11762]) Refs #10055:

  • Fixed error in regex which led to incorrect CSS class being applied to the matches.
  • Renamed the 0.11 branch to trunk.

comment:3 Changed 6 years ago by Ryan J Ollos

Somehow that got split into two commits so you can't see the changes (also [11763]). The fix was on line 102 of tracDupeSearch.js:

var summaryRegex = /#(\d+)<\/span>:\s*(.*):\s*(.*)\s*\((.*)(?:\: (.*))?\)$/i;


var summaryRegex = /#(\d+)<\/span>:\s*(.*):\s*(.*)\s*\(([^:.]*)(?:\: (.*))?\)$/i;

comment:4 Changed 6 years ago by Ryan J Ollos

Resolution: fixed
Status: assignedclosed

Please reopen if this isn't working correctly for you, or if you have more feedback.

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted.

Add Comment

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

Note: See TracTickets for help on using tickets.