Edgewall Software

Ticket #2718 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

Searching for !WikiPageNames keeps the "!" in the highlighted term

Reported by: cboos Owned by: jonas
Priority: low Milestone: 0.10
Component: search system Version: 0.9.3
Severity: trivial Keywords:
Cc:

Description

I've just noticed a few minor issues when one wants to search for WikiPageNames like terms using the "!" prefix to disable the quickjump facility:

  1. The highlighted term will contain the "!" prefix, which usually results in nothing being highlighted.
  2. On the opposite, the next pages links don't contain the "!" prefix anymore, resulting in a quickjump when trying to browse subsequent result pages.

Example: search:!TicketQuery (the expected result would be the same as when using search:" TicketQuery").

Attachments

trac-searchwikipage-r2944.patch (0.9 KB) - added by Andres Salomon <dilinger@…> 3 years ago.
highlighting fix against r2944

Change History

Changed 3 years ago by cboos

[2910] fixed point 2.

Point 1. can be fixed by:

  • trac.js

     
    4141      var param = params[p].split('='); 
    4242      if (param.length < 2) continue; 
    4343      if (param[0] == 'q' || param[0] == 'p') { // q= for Google, p= for Yahoo 
    44         return unescape(param[1].replace(/\+/g, ' ')).split(/\s+/); 
     44        var searchwords=unescape(param[1]); 
     45        if (searchwords[0] == '!') searchwords = searchwords.slice(1); 
     46        return searchwords.replace(/\+/g, ' ').split(/\s+/); 
    4547      } 
    4648    } 
    4749    return []; 

As this conflicts with the patches on #2759, I'll postpone this until one of those patches are committed.

Changed 3 years ago by Andres Salomon <dilinger@…>

highlighting fix against r2944

Changed 3 years ago by Andres Salomon <dilinger@…>

The patch I just attached is cboos's original patch updated for trunk, now that #2759 has been fixed there.

Changed 3 years ago by cboos

  • status changed from new to closed
  • resolution set to fixed

Thanks for the update. I've checked that in (r2975).

Add/Change #2718 (Searching for !WikiPageNames keeps the "!" in the highlighted term)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
to The owner will change from jonas. Next status will be 'closed'
 
Note: See TracTickets for help on using tickets.