I have effectively the same question as James Hurrell did regarding how Confluence is crafting links in exported HTML that are to pages that should be internal to a space.
As James described:
For the majority of the exported pages, when one page references another, the link is created correctly as follows:
<a href="test%2page.html">test page2</a> - this then renders as test+page.html in the browser and will call the local copy of the required page. This is fine.
However, sometimes, the link is created as follows with the fully qualified domain name:
<a href="https://confluence.domain.com/display/SPACE-NAME/test+page2">test page2</a>
Obviously this breaks the links in our published doc system as the link points to the public address for the Confluence system
In a follow-up post, James seemed to find he wasn't actually exporting his complete space. However, I am seeing this behavior on intra-linked pages within the space even when I use the Normal Export choice on the Export HTML Options page.
It would be great if the exported pages were properly linked, was this feature broken / is there a workaround apart from fixing the links myself using a script?
Happy to look into this with you. I believe you're referring to this thread, that shares the same title as yours. Is that right?
From my understanding, the issue is that when you export a space to HTML, some internal links are linking using the absolute URL whereas others are just using the relative URL, as they should be. Do I have that correctly?
With James' case, this was with Confluence Server version 4.2.12, but I understand that you're on Cloud. Can you confirm that?
With the links that are showing as absolute, are they linking to pages in another space entirely, or within the same space? Can you find any kind of similarity amongst them, or perhaps were they inserted differently into the page?
Looking forward to hearing back from you.
Yes this is on the current version of the cloud.
I’m not sure you have it exactly. Some are linking to the exported html files. Some are linking to a url that requires internet—the actual page's living url.
Effectively all of the interlinking links created using the normal internal page link creation dropdown (with auto suggest completion) link to atlassian.com instead of the local file.
Only the breadcrumbs and auto generated table of contents on the index page link correctly.
It should be shown if you make a few pages and link them by hand then export. But you are also welcome to export my newest created private space to see for yourself.
i worked around this by including in my python script something that matches up the page keys between local file names and remote and replaces the remote urls with the local file names in each link on each page.
That’s a hack around what appears to be a bug though.
Thank you for the reply. I do know that in the past I saw if anyone manually created a link then it was doing weird thinks with the links, but that was on Server a while ago. I don't think I ever saw that behavior in Cloud.
To fix the problem, you would have to manually update the links by hand, or a script, like you did.
I'll want to test this a bit more next week. Just to be sure - if you were to link by hand in the New Editor vs the Legacy Editor, do they both replicate the problem? Or only one of the editors?
I'm testing this on my Confluence Cloud site, but I have not been able to replicate it.
Here are the steps I took:
Can you tell me if this is how you are replicating the issue on your end?
You mentioned earlier that I can export your newest created private space to test, but unfortunately I am not able to gain access to your account via Community. If you've raised a support ticket through our Support Portal, then we can have a look at your site.
I want to make sure that we can't replicate the problem externally first, and if not, I can help you to raise a case for this and we can have a look at your site.
I created a ticket, JST-549585, to allow access to the site.
This happens between the second level and third level pages in the hierarchy.
You have to create a page (page a), then a child page (page a-1) of that.
Then go to the breadcrumb for page a and edit that page to have a link to its child using the automated linking.
Links from that page to its children are broken. (they link externally)
The space overview links created by the export are correct. Its important to note not all links are incorrect.
Comma Encoding in Space Name Bug
I also found another bug where if you have a space name with a comma in it, the comma is incorrectly encoded in the filename. It should be %2C, but it appears to create files that have the percent sign encoded twice.
To repro this:
- Create a page with a comma in the title
- Export the html
- Click the main navigation link auto generated to the page
- Link is broken.
Thank you for reporting the issue in a support ticket. I've included an internal summary as well of what I have tested so far. I'll be watching the case so we can update this thread with the results.
As for the 2nd bug you found, I believe it could be related to this bug:
It's been closed as a timeout, I think because it's a few years old and we only had one vote of any customers saying they were having the same issue. I'm in touch now with the developer, because I want to know if there's anything we can do to help with this since you've discovered this bug too.
Could you do me a favor, and raise a new question on Community about this bug, and mention my name? That way, I can follow-up with you separately on that when I hear back from the developer and we have a thread dedicated to it in case others are having the same issue. The newer the thread, the more likely others will see it and say if they're having the same problem.
You bet. Thanks for keeping an eye on it. I do have a workaround for the linking written in a script but I need to fix it to now work with page anchors. It would be cool if links worked out of the box.
That does look like the bug I'm seeing with commas.
I am guessing html export must not be a very commonly used feature.
The comma workaround is to just not use punctuation, although this is probably a one line fix too. Regardless, I created a question on it with an @ for you.
Thank you again for your help.
Thanks again for creating that new thread; I followed up with you there.
I see on your ticket in support, the engineer created a new request for your other issue, in order to improve the handling of links in the new editor.
Can you let me know if you have any follow-up questions about that?
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...
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