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

Changing the color of links in Confluence pages does not reflect on the links once the page is published

    XMLWordPrintable

Details

    Description

      Issue Summary

      In Confluence pages, changing the colour of links to other Confluence pages using the color palette does not get reflected when the page is saved. 

      Environment

      Issue observed on Confluence 6.14.0 onwards.
      Issue does not observed on Confluence 6.13.x and below

      Steps to Reproduce

      1. Create a new page
      2. Add a link of another Confluence page by:
        • Directly pasting a link of another Confluence page
        • Go to Insert More Content > Link > Search > Insert for any other Confluence page
      3. Change the link color using the palette to a different color. 
      4. In the Edit mode, the links will seem to have their color changed. 
      5. Publish.

      Expected Results

      The links will have their color changed

      Actual Results

      The link will maintain the the blue color regardless of the color that was assigned to it.

      Notes

      • The issue seems to occur if a whole link has its color changed. If you attempt to change the color of part of the link. The new color will be reflected after the change. 
      • The issue does not affect links to outside of Confluence such as https://www.google.com

      Workaround #1: Source Editor

      1. Download and install the Confluence Source Editor app in your Confluence instance.
      2. Edit the problematic page and click the <> button to edit its Storage Format.
      3. You will need to adapt the piece of code for the colored links. Starting from this non-functional, green-colored link example:
        <p>
          <span style="color: rgb(0,255,0);"> <ac:link>
              <ri:page ri:content-title="page 3"/>
            </ac:link> </span>
        </p>
        
      4. Add an <ac:link-body> tag right after the <ri:page> node. Also add its closing tag, </ac:link-body>.
        <p>
          <span style="color: rgb(0,255,0);"> <ac:link>
              <ri:page ri:content-title="page 3"/>
                <ac:link-body></ac:link-body>
            </ac:link> </span>
        </p>
        
      5. Inside this new tag, add a span tag with the color settings on its "style" parameter. You can either copy or move the text from the existing code to the new location. Remember to also move or copy the closing tag, </span> to the proper location. In the example below, I moved the text:
        <p>
          <ac:link>
              <ri:page ri:content-title="page 3"/>
                <ac:link-body><span style="color: rgb(0,255,0);"></span></ac:link-body>
            </ac:link> 
        </p>
        
      6. Inside the span tag, add the link text - repeat the same value of the "ri:content-title" attribute:
        <p>
          <ac:link>
              <ri:page ri:content-title="page 3"/>
                <ac:link-body><span style="color: rgb(0,255,0);">page 3</span></ac:link-body>
            </ac:link> 
        </p>
        
      7. Save and publish the page.

      Workaround #2: HTML Macro

      1. Go to > Manage Apps
      2. Click the dropdown menu and select All Apps.
      3. Click on "x of 8 modules enabled".
      4. Enable the html (html-xhtml) module.
      5. Go to the problematic page and insert an HTML Macro.
      6. Add some HTML code inside the macro according to your needs. For example:
        <a href="http://localhost:8090/confluence/display/MYS/page+3" style="color:red">My hardcoded link for page 3</a>
        
        • Note that this will be a "hardcoded" link and will not inherit some Confluence features like automatic link renaming when the page gets moved or renamed. We suggest using a Tiny Link instead of the default link.
      7. Save the page.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              afaridi Ahmad Faridi
              Votes:
              26 Vote for this issue
              Watchers:
              26 Start watching this issue

              Dates

                Created:
                Updated: