Hi.
I created a user macro that accepts a confluence-content type parameter and uses it as the href attribute of an <a> tag. It works perfectly even if I add a title that doesn't exist, the class I provide are the one being applied, etc. No surprises there.
The only big surprise is that as soon as I define an external URL (for instance, www.atlassian.com) it immediately changes the value of the class attribute to "external-link" and the value of the href turns into "<base_url>/display/<space>/<external_url)" (e.g. http://localhost:8090/display/KM/www.atlassian.com).
Code (compact):
## @param Title:title=Title|type=string|required=true
## @param Url:title=URL|type=confluence-content|required=true
## @param Type:title=Link Type|type=enum|enumValues=standard,light,no-decoration|default=standard
<a class="link-type-${paramType}" href="${paramUrl}">$paramTitle</a>
Parameter Values
Result:
<a class="external-link" data-hasbody="false" data-macro-name="custom-link" href="http://www.vitorcastelo.me/km/display/Support/www.google.com" rel="nofollow">
Google Search
</a>
Expected:
<a class="link-type-standard conf-macro output-inline" data-hasbody="false" data-macro-name="custom-link" href="www.google.com" rel="nofollow">
Google Search
</a>
Did anyone already bumped against this kind of behavior in a user macro?
Thanks.
I believe Atlassian recently made changes to how external links are viewed. External links will open in new window. It might have something to do with this behavior. Try creating a support ticket with Atlassian
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.