It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Links in Code/panel Macro

I want to link a particular word in my code block or panel to anothe page in my confluence space. However, when I insert a link in a code block or panel, it doesn't show.

What can I do please?

I am using confluence 3.5

2 answers

1 accepted

1 vote
Answer accepted

Code block itself is meant to avoid any formatting and render the content as it is. So if you need links inside code block, you may need to use {html} macro and format the content as per your wish.

Hi Renjith,

Thank you for your answer.

I tried the {html} macro but the code block recongizes HTML tags also as part of the code.

For example, say I used this:

{code:XML}
<JMX>
<!--The port RMI registry is exposed-->
<RMIRegistryPort>{html}<A href="http://www.atlassian.com">9999</A>{html}</RMIRegistryPort>

</JMX>
{code}

I have attached a screenshot of what I get.

Any other way we can do this please?

1 vote
Deleted user Jun 18, 2012

I think Renjith meant "instead of using {code}", use html itself to format the code block

for example, something like this - you'd have to "escape" any characters that would cause the html to render, like the opening < in front of the comment to prevent it actually becoming a comment.

{html}
&lt;pre&gt;
&lt;JMX&gt;
     &amp;gt;!--The port RMI registry is exposed--&gt;
     &lt;RMIRegistryPort&gt;&lt;A href="http://www.atlassian.com"&gt;9999&lt;/A&gt;&lt;/RMIRegistryPort&gt;
  
&lt;/JMX&gt;
&lt;/pre&gt;
{html}

which would render as

&lt;JMX&gt;
     &lt;!--The port RMI registry is exposed--&gt;
     &lt;RMIRegistryPort&gt;9999&lt;/RMIRegistryPort&gt;
  
&lt;/JMX&gt;

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Posted in Confluence

Lessons and Learnings: Six Months of Working Remote [Discussion]

Hey there, folks! For most of us, the past six months- yes, you read that right- have been a journey. More people than ever before have pivoted to working remotely, and navigating being on-scre...

4,120 views 4 6
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you