The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Jake Burgy
December 22, 2018

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

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

And I enter "https://www.google.com/" for the LinkTarget parameter, this macro renders as follows:

<a class="external-link" href="https://www.google.com/" rel="nofollow">
Hello World
</a>

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)

Thanks!

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Calum
June 17, 2021

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

TAGS
AUG Leaders

Atlassian Community Events