Edgewall Software
Modify

Opened 7 years ago

Last modified 7 months ago

#12756 new defect

Pseudo anchors should allow whitespace and special characters

Reported by: Ryan J Ollos Owned by:
Priority: normal Milestone: next-stable-1.6.x
Component: wiki system Version:
Severity: normal Keywords: traclink
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

It doesn't seem to be possible to use whitespace or special characters in a pseudo anchor (#10284).

For example, I've wanted to have an anchor to class Environment(Component) in trunk/trac/env.py.

Attachments (0)

Change History (4)

comment:1 by Ryan J Ollos, 4 years ago

Milestone: next-stable-1.2.xnext-stable-1.4.x

comment:2 by Hong Choi <nik@…>, 3 years ago

Personally, as far as trac is passing search terms via uri, the first method - uri encoding - is the most widely compatible way. So, here's the clue for that.

  • trac/htdocs/js/search.js

    index: trac/htdocs/js/search.js
     
    6666        var direction = h[1];
    6767        var case_insensitive = h.match(/\/i$/);
    6868        if (direction == '/' || direction == '?') {
    69           var hterm = h.substr(2);
     69          var hterm = decodeURIComponent(h.substr(2));
    7070          if (case_insensitive)
    7171            hterm = hterm.substr(0, hterm.length - 2).toLowerCase();
    7272          $('.searchword0').each(function() {

comment:3 by Jun Omae, 3 years ago

At least, there is no cross-browser solution in past years. We should verify the proposed changes work on supported browsers.

FYI: javascript - Encoding of window.location.hash - Stack Overflow

comment:4 by Ryan J Ollos, 7 months ago

Milestone: next-stable-1.4.xnext-stable-1.6.x

Milestone renamed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.
The ticket will be disowned.
as The resolution will be set. Next status will be 'closed'.
The owner will be changed from (none) to anonymous. Next status will be 'assigned'.

Add Comment


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