Opened 19 years ago

Closed 19 years ago

Last modified 14 years ago

#23 closed defect (fixed)

Do not URL-encode the anchor sign ('#') to %23

Reported by: richter@… Owned by: Alec Thomas
Priority: normal Component: TocMacro
Severity: major Keywords:
Cc: Trac Release:

Description (last modified by Alec Thomas)

I used revs 44 and 37 in Trac 0.9pre. TocMacro does nicely show the Table of Contents, but the anchor sign is encoded to %23 in links to headings on the referenced page. When the user clicks them, he is guided to a blank page named i.e. 'WikiPage#Heading1'

Attachments (0)

Change History (8)

comment:1 Changed 19 years ago by Alec Thomas

I'm surprised TocMacro works in trunk at all. The encoding must be a side-effect of changes introduced in trunk.

comment:2 Changed 19 years ago by anonymous

I fixed this on my system; line66: link = page + ""#"" + anchor Don't know wether that's proper python-code, but works.

comment:3 Changed 19 years ago by Alec Thomas

Description: modified (diff)

comment:4 Changed 19 years ago by anonymous

In my the line 66 is as described by the comment above, but the problem with '%23' occurs anyway (trac 0.9pre).

comment:5 Changed 19 years ago by ebrown@…

Close. All that did was remove the anchor altogether.

This works though:

link = page
if current_depth <= max_depth:
    out.write('<a href="%s#%s">%s</a></li>\n' % (, anchor, header))

comment:6 Changed 19 years ago by richter@…

Thank you, ebrown. This works for me, too.

comment:7 Changed 19 years ago by Alec Thomas

Resolution: fixed
Status: newclosed

(In [111])

  • First version of TocMacro for trunk
  • Fix for finding current page, closes #50
  • Fix for anchor escaping, closes #23

comment:8 Changed 18 years ago by Alec Thomas

milestone: 0.9

Milestone 0.9 deleted

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Alec Thomas.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment

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

Note: See TracTickets for help on using tickets.