Closed (fixed)
Project:
Footnotes
Version:
5.x-1.x-dev
Component:
Footnotes.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
22 Nov 2007 at 20:39 UTC
Updated:
9 Dec 2007 at 15:50 UTC
If multiple nodes containing footnotes are at the same page, the result is duplicated IDs (multiple <li id="footnote1"> occurrences).
As the W3C validator says:
An "id" is a unique identifier. Each time this attribute is used in a document it must have a different value.
Comments
Comment #1
hingo commentedgood point, thanks for reporting this. (Not only is this non-compliant, it actually breaks the links in that case.)
In fact, this is not easy to fix, since the excerpts or otherwise separate nodes on a page are filtered independently, so the numbering is (imho?) impossible to coordinate.
One solution is to prefix all footnotes id's with a random prefix, or a per node random prefix. Not very nice, but I think this is the best that can be done.
Comment #2
hingo commented...or actually, it could be prefixed with the node id, then it is not random.
That's better, I think I'll do that.
Comment #3
archetwist commentedThis sounds good. Thanks for your quick response. And the module :) .
Comment #4
hingo commentedHi
This should now be fixed. The fix should be available for download (http://drupal.org/project/Footnotes) whenever there is a new development snapshot.
**
The fix consists of adding a random string to each id/link to ensure they are unique. Using node id was not possible because a filter does not know about the node, it is just passed a body of text to work on.
The downside of this is that modifying a text causes the random components of links to be re-generated, which would cause any external links pointing to a footnote to break. Same will happen if for some reason the cached result of filtering is lost and filtering is re-generated. In short, people should not make links that point to the footnotes directly.