Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-17962

Table of contents does not link to the correct anchor when there are duplicate headers

      Table of contents does not link to the correct anchor when there are duplicate headers. See the following example page:

      https://extranet.atlassian.com/display/~alui/Test+TOC

      If you click on any of the subheading links in the TOC, it will take you to the subheader under header 1. It should link to the correct subheading link.

            [CONFSERVER-17962] Table of contents does not link to the correct anchor when there are duplicate headers

            As a workaround for those using Confluence 4.2 or older, add the Anchor macro right before your lower level heading. Set the anchor name to the parent heading name. This generates unique anchors and the Table of Contents macro works too.

            Antti Hietala added a comment - As a workaround for those using Confluence 4.2 or older , add the Anchor macro right before your lower level heading. Set the anchor name to the parent heading name. This generates unique anchors and the Table of Contents macro works too.

            Hi Joris,

            The reported problem has not been happening in the latest Confluence 4.3 version on v2.6.0 as tested recently.

            Have put in a correct fixed version for it now.

            Thanks for mentioning!

            Philip Cher added a comment - Hi Joris, The reported problem has not been happening in the latest Confluence 4.3 version on v2.6.0 as tested recently. Have put in a correct fixed version for it now. Thanks for mentioning!

            Joris added a comment -

            Why has this issue been set to obsolete?
            Has it been fixed? If so, in which version?
            If not, I fail to see how it can be obsolete. Unless you have removed the ability to create a ToC?

            kind regards
            Joris

            Joris added a comment - Why has this issue been set to obsolete? Has it been fixed? If so, in which version? If not, I fail to see how it can be obsolete. Unless you have removed the ability to create a ToC? kind regards Joris

            Even though Steve's comment about id attributes is presumably the reason TOC doesn't work with duplicate headers, I'd like to chime in with Todd: it sure would be nice if there were a way to get the result we want. Is there any hope?

            Robert Remple added a comment - Even though Steve's comment about id attributes is presumably the reason TOC doesn't work with duplicate headers, I'd like to chime in with Todd: it sure would be nice if there were a way to get the result we want. Is there any hope?

            +1

            We just upgraded to Confluence 4.1 (build #3126) and this bug exists there as well. For complex, detailed pages with multiple header levels, it's not uncommon to have duplicate names. A few of our users stumbled on this, would be great to have it fixed.

            Todd Patterson added a comment - +1 We just upgraded to Confluence 4.1 (build #3126) and this bug exists there as well. For complex, detailed pages with multiple header levels, it's not uncommon to have duplicate names. A few of our users stumbled on this, would be great to have it fixed.

            This is still an issue in confluence 4 - any progress?

            It doesn't appear to be a problem just with the macro though - it's caused because the id attributes given to headings in confluence's output HTML are made up of <page name>-<heading> which means that they're not unique if the same heading appears in a page multiple times. This violates the principle of the id attribute in HTML/XHTML

            Steve Randerson added a comment - This is still an issue in confluence 4 - any progress? It doesn't appear to be a problem just with the macro though - it's caused because the id attributes given to headings in confluence's output HTML are made up of <page name>-<heading> which means that they're not unique if the same heading appears in a page multiple times. This violates the principle of the id attribute in HTML/XHTML

            We expirenced this in Confluence 3.1! Will this issue be fixed in further versions e.g. 3.1.1?

            Cheers
            Fabian

            Fabian Breuer added a comment - We expirenced this in Confluence 3.1! Will this issue be fixed in further versions e.g. 3.1.1? Cheers Fabian

              pcher Philip Cher
              alui Andrew
              Affected customers:
              12 This affects my team
              Watchers:
              9 Start watching this issue

                Created:
                Updated:
                Resolved: