Modify

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#51 closed defect (duplicate)

anchor links broken in trunk.

Reported by: halkeye@… Owned by: athomas
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 9 years ago by athomas

  • Resolution set to duplicate
  • Status changed from new to closed
  • version changed from stable to trunk

Duplicate of #23

comment:2 Changed 9 years ago by athomas

  • milestone 0.9 deleted

Milestone 0.9 deleted

Add Comment

Modify Ticket

Action
as closed The owner will remain athomas.
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.