Restrictions on web links in Confluence

askanius December 18, 2016

Some types of URLs to weblinks don't work - you can add them in the editor and "Follow link" during editing works, but both in preview and when saving the page the URL is gone (no href attribute in the <a> tag). Thus: what are the (known) restrictions on URLs for web links?

3 answers

1 accepted

0 votes
Answer accepted
Rob Woodgate
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 20, 2016

Ah, I see what you mean.

My understanding is that Confluence uses the standard w3c URL conventions, so a pipe would be treated as a delimiter.  This is confirmed (for the pipe) here: https://confluence.atlassian.com/confkb/url-containing-pipe-is-truncated-131989590.html.  I don't have a list of those restrictions to hand but they shouldn't be too hard to find.

However, this won't be much use if your users aren't clued up on this.

Atlassian's recommendation is to use the HTML macro if escaping will be a problem, e.g. due to a large number of existing URLs or frequent use of URLs that need to be treated "as is".  If you're on the Cloud version the HTML macro isn't available so you can use an add-on like this or this, both of which should accept well-formed URLs even if they're not strictly in lie with w3c standards. 

askanius December 20, 2016

Thanks for the hint to the link, Rob

1 vote
Rob Woodgate
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 19, 2016

Hi Martin,

There are no general restrictions. As long as the URL is well-formed it is simple text inside an href.

Can you provide an example link?

0 votes
askanius December 20, 2016

Hi Rob

yes, sorry, I should have done that right away: for example SonarQube creates URLs of the form

http://mySonarQube/component_issues?id=org.domain%3Amy.artifact.id#resolved=false|severities=BLOCKER

The '|' is problematic and must be URL-escaped to '%7C' to make it possible to store the URL. While '|' is not in the list of allowed characters in URLs (https://tools.ietf.org/html/rfc3986) obviously it happens, that it is used.

That's why I wanted to know, whether there are other restrictions.

The Confluence Insert Link dialog accepts the entry though but then silently the URL is swallowed. Also when pasting the URL this weird behaviour can be observed:

For example, this is what happens (URL from above just pasted):

http://mySonarQube/component_issues?id=org.domain%3Amy.artifact.id#resolved=false|severities=BLOCKER

 

 

 

askanius December 20, 2016

I forgot to say, that most users won't have the allowed character list from the RFC in mind all the time wink

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events