-
Bug
-
Resolution: Fixed
-
Medium
-
None
NOTE: This bug report is for Confluence Cloud. Using Confluence Server? 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'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.
- details
-
CONFCLOUD-34818 Can not link to a heading that contains a colon (:)
- Closed
- is duplicated by
-
CONFCLOUD-30485 (In Firefox browser) Links in Table of Contents Macro not working when heading includes a question mark
- Closed
- is related to
-
CONFSERVER-26765 Redirect to anchors in pages with titles that contain special characters is broken
- Closed