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

hingo’s picture

Version: 5.x-1.2 » 5.x-1.x-dev

good 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.

hingo’s picture

...or actually, it could be prefixed with the node id, then it is not random.

That's better, I think I'll do that.

archetwist’s picture

This sounds good. Thanks for your quick response. And the module :) .

hingo’s picture

Status: Active » Closed (fixed)

Hi

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.