Edgewall Software
Modify

Opened 17 years ago

Closed 16 years ago

#5643 closed defect (fixed)

Incorrect resolution of links to pages in htdocs

Reported by: anonymous Owned by: osimons
Priority: normal Milestone: 0.11
Component: wiki system Version: devel
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

I'm trying to point to a particular section of a static page in htdocs

[htdocs:manual.html#installation Installation]

the manual.html page is correctly open but the installation section is not showed as expected (firefox 2.0).

The url generated by trac is

http://localhost:8000/myproject/chrome/site/manual.html%23installation

I didn't find any way to quote the # character andprevent it to be translated in %23

Attachments (0)

Change History (3)

comment:1 by Christian Boos, 17 years ago

Milestone: 0.110.11.1

comment:2 by osimons, 16 years ago

Milestone: 0.11.10.11
Owner: changed from Christian Boos to osimons

This should fix it - based on the strategy used in other link resolvers:

  • trac/web/chrome.py

     
    386386        yield ('htdocs', self._format_link)
    387387
    388388    def _format_link(self, formatter, ns, file, label):
    389         return tag.a(label, href=formatter.href.chrome('site', file))
     389        file, query, fragment = formatter.split_link(file)
     390        href = formatter.href.chrome('site', file) + query + fragment
     391        return tag.a(label, href=href)
    390392
    391393    # Public API methods

I don't think this change will have other effects than making such links actually work, so I'll commit unless objections are voiced.

comment:3 by osimons, 16 years ago

Resolution: fixed
Status: newclosed

Patch committed as [6502].

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain osimons.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from osimons 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.