Modify

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#51 closed defect (duplicate)

anchor links broken in trunk.

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

Description

In the lastest svn (as of mid day yesterday) trunk of trac, anchor links in TocMacro are broken.

I fixed them by doing:

Index: TOC.py
===================================================================
--- TOC.py      (revision 110)
+++ TOC.py      (working copy)
@@ -63,9 +63,9 @@
                     anchor = default_anchor + str(anchor_n)
                     anchor_n += 1
                 seen_anchors.append(anchor)
-                link = page + "#" + anchor
+                link = page
                 if current_depth <= max_depth:
-                    out.write('<a href="%s">%s</a></li>\n' % (env.href.wiki(link), header))
+                    out.write('<a href="%s#%s">%s</a></li>\n' % (env.href.wiki(link), anchor, header))
     while current_depth > min_depth:
         if current_depth <= max_depth:
             out.write("</ol>\n")

Not sure if that'd break any security or whatever, but yea, otherwise thigns are url encoded and thus no longer anchors (or maybe just in firefox)

Attachments (0)

Change History (2)

comment:1 Changed 12 years ago by Alec Thomas

Resolution: duplicate
Status: newclosed
version: stabletrunk

Duplicate of #23

comment:2 Changed 12 years ago by Alec Thomas

milestone: 0.9

Milestone 0.9 deleted

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Alec Thomas.
The resolution will be deleted.

Add Comment


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

 
Note: See TracTickets for help on using tickets.