Modify

Opened 9 years ago

Closed 9 years ago

Last modified 4 years ago

#23 closed defect (fixed)

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

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

Description (last modified by athomas)

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 9 years ago by athomas

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

comment:2 Changed 9 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 9 years ago by athomas

  • Description modified (diff)

comment:4 Changed 9 years ago by anonymous

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

comment:5 Changed 9 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' % (env.href.wiki(link), anchor, header))

comment:6 Changed 9 years ago by richter@…

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

comment:7 Changed 9 years ago by athomas

  • Resolution set to fixed
  • Status changed from new to closed

(In [111])

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

comment:8 Changed 9 years ago by athomas

  • milestone 0.9 deleted

Milestone 0.9 deleted

Add Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from athomas. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.