Modify

Opened 12 years ago

Closed 12 years ago

Last modified 6 years ago

#16 closed defect (fixed)

anchor suffix keeps increasing with each page view

Reported by: anonymous Owned by: Alec Thomas
Priority: highest Component: AnchorPatch
Severity: blocker Keywords:
Cc: Trac Release:

Description

I just applied the anchor patch to my trac installation, and I can see from the page source that the anchors are being added to the headings on each page. The problem is, each time I view the page, the anchor suffix is increase by 1.

Example: The heading 'Primary' has this source <h1 id="Primary">Primary</h1>, but the second time I view the page it gets this <h1 id="Primary1">Primary</h1>, then next time <h1 id="Primary2">Primary</h1>, etc.

The TOC macro only ever links to the first anchor (without the number appended) so my TOC only works the first time a view a page.

I'm using TRAC 0.8.1 on Debian with mod_python to serve multiple projects.

Attachments (0)

Change History (7)

comment:1 Changed 12 years ago by anonymous

Cc: peter.milner@… added; anonymous removed

i wonder if this has anything to do with chaching with mod_python ...

comment:2 Changed 12 years ago by Alec Thomas

Status: newassigned

Try adding the following constructor to class Formatter in trac/WikiFormatter.py around line 280:

    def __init__(self, hdf, env, db, absurls=0):
        CommonFormatter.__init__(self, hdf, env, db, absurls)
        self.seen_anchors = []

Let me know if that solves your problem.

comment:3 Changed 12 years ago by anonymous

Cc: anonymous added; peter.milner@… removed

Yes, that seems to have fixed to issue! Thanks!

comment:4 Changed 12 years ago by Alec Thomas

Resolution: fixed
Status: assignedclosed

(In [38]) * Add constructor to CommonFormatter, closes #16.

comment:5 Changed 6 years ago by zerodeux

(In [10744]) (vcaron) Add draft template for import plugin (upload phase), see #16

comment:6 Changed 6 years ago by zerodeux

(In [10772]) (vcaron) Import plugin: upload template OK, import_max_size option defined for upoad mechanism, see #16. Next step: actually list real uploaded files

comment:7 Changed 6 years ago by zerodeux

(In [10777]) (vcaron) Implemented selector + import preview, see #16

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.