#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 19 years ago by
Cc: | peter.milner@… added; anonymous removed |
---|
comment:2 Changed 19 years ago by
Status: | new → assigned |
---|
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 19 years ago by
Cc: | anonymous added; peter.milner@… removed |
---|
Yes, that seems to have fixed to issue! Thanks!
comment:4 Changed 19 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
i wonder if this has anything to do with chaching with mod_python ...