Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

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

How can I prevent an external link from overriding my classes?

If I have a custom "button" macro with this body:

<a href="$paramLinkTarget" class="my-custom-button">$body</a>

And I enter "" for the LinkTarget parameter, this macro renders as follows:

<a class="external-link" href="" rel="nofollow">
Hello World

Where did my class name go?! Why is Confluence removing the custom CSS class from my macro?

Does this mean that I am unable to create a simple <a> button macro with a custom style on it?

I would prefer to know if there was an official way to disable this behavior. I do not want solutions that involve:

  • JavaScript workarounds/hacks
  • Putting the style inline using style="..." (not a best practice)


1 answer

Did you ever solve this? Been driving me potty all day trying to figure out a sensible workaround.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Confluence

👁‍🗨 Confluence Team planning dashboard_Atlympics 🌈

Hi Atlassian's, How is your journey with #Atlympics 2021 so far....excited! Me too, same excitement. Here's my typical team planning and vision dashboard which I used to share to my management and ...

33 views 1 3
Read article

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