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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Storage format for linking to anchors no longer works?

I have a Python Program which creates Storage Format code for Confluence Cloud based on:

https://confluence.atlassian.com/doc/confluence-storage-format-790796544.html

I created the following Python code to link to an Anchor:

def content_url(link, description=None, page=None):
"""Encode a Link to an anchor in this page or another page

Args:
----
link: Name of anchor to link to
description: alternative description to use, (or use link if omitted)
page: page where anchor can be found (blank = current page)

"""
if description is None:
description = link
return ''.join(['<ac:link ac:anchor="{0}">'.format(link),
'<ri:page ri:content-title="{0}"/>'.format(page) if page else '',
'<ac:plain-text-link-body>',
'<![CDATA[' + description + ']]>',
'</ac:plain-text-link-body>',
'</ac:link>'
])

It was working well until someone pointed out that the pages I was creating were created in editor V1 format.  I changed the REST API call to create a "V2" page and the links no longer work in that they do go to the correct page but never down to the anchor.  Is this just another thing that got broken with the V2 editor or does the documentation need updating?

For reference the anchor is created using the following function:

 def anchor(name):
"""Insert an Anchor in the text
"""
output = '<ac:structured-macro ac:name="anchor" ac:schema-version="1">'
output += '<ac:parameter ac:name="">' + name + '</ac:parameter></ac:structured-macro>'
return output

Any help would be appreciated!

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events