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

Redirect to anchors in pages with titles that contain special characters is broken

      NOTE: This bug report is for Confluence Server. Using Confluence Cloud? See the corresponding bug report.

      Symptoms

      When a page name contains a special character, this character is included in the ID of any anchors on the page. When generating the URL for such anchors, Confluence is encoding any text to the right of the # using HTML entity escaping, but for this link to work, it must use URL encoding. This also happens if an anchor name contains a special character.

      For example the apostrophe character:

      • The URL is currently replacing it with '
      • The URL should be replacing it instead with %27 like it does on the left side of the #
      • The anchor is showing up correctly in the page source, as the apostrophe is not encoded inside the id attribute

      Note that whilst using special characters in an ID is prohibited in XML and thus XHTML, it's perfectly fine for HTML5, which is used by Confluence, so any special characters do not need to be encoded inside the id attribute.

      Steps to reproduce:

      1. Create a page named "User's Resources"
      2. Add an anchor to it, say "shares", a link to the anchor in the same page (or any other) and save
      3. Click the link
      4. No redirect is made (or if the link is in a different page, redirect is made only to the page, not the anchor)

      This is the link:

      <confluence_instance>/display/<space_name>/User%27s+Resources#User&#39;sResources-shares

      This behavior happens because of the special character used in the title - If the page is renamed without it, everything works.

      Workaround

      If this is caused by the page name, the only workaround is to rename that page to not have a special character.

      If this is caused by the anchor name, you can work around this by manually URL-escaping the special character in the "Link" value in "Advanced" when creating the link.

            [CONFSERVER-26765] Redirect to anchors in pages with titles that contain special characters is broken

            This is still broken.

            Eligh Corchis-Scott added a comment - This is still broken.
            Thompson Lee made changes -
            Comment [ Bug returned on Confluence 1000.0.0-9ea2a05eaf59.

            Inserting double quotation marks in the Heading causes the "Table of Contents" anchor links to break prematurely. ]
            Michal Fiala made changes -
            Comment [ I have the same issue, using Anchors with Czech language is not possible. We use "special" characters in nine words out of ten. There is no possibility to use anchors beetween pages in same spaces, only in one page.
            It´s Very frustrating ]
            Katherine Yabut made changes -
            Workflow Original: JAC Bug Workflow v3 [ 2894673 ] New: CONFSERVER Bug Workflow v4 [ 2985329 ]
            Owen made changes -
            Workflow Original: JAC Bug Workflow v2 [ 2780317 ] New: JAC Bug Workflow v3 [ 2894673 ]
            Status Original: Resolved [ 5 ] New: Closed [ 6 ]
            Owen made changes -
            Workflow Original: JAC Bug Workflow [ 2737064 ] New: JAC Bug Workflow v2 [ 2780317 ]

            I have the same issue

            Ruben Elizondo added a comment - I have the same issue

            Alex Reed added a comment -

            Problem is reproduced on Confluence 6.8.2. 

            Alex Reed added a comment - Problem is reproduced on Confluence 6.8.2. 
            Owen made changes -
            Workflow Original: Confluence Workflow - Public Facing - Restricted v5 - TEMP [ 2389278 ] New: JAC Bug Workflow [ 2737064 ]
            Katherine Yabut made changes -
            Workflow Original: Confluence Workflow - Public Facing - Restricted v5 [ 2266826 ] New: Confluence Workflow - Public Facing - Restricted v5 - TEMP [ 2389278 ]

              dma@atlassian.com David Ma
              363db42e39fc Stefan Uricariu
              Affected customers:
              34 This affects my team
              Watchers:
              79 Start watching this issue

                Created:
                Updated:
                Resolved: