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:Ā 

Is there a publicly available API class to convert from Wiki Markup to XHTML?

Bahman Rafatjoo
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 25, 2012

We have an integrated Jira and Confluence setup and use Groovy scripts (using the {script} macro) for a variety of tasks including auto-generation of release notes.

While I can change all the existing code to generate XHTML, the Jira issues have a custom field for release notes text which is in Wiki Markup. I need some way of translating this into XHTML and was looking for an API within Confluence to do so. Is there one?

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Bahman Rafatjoo
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 11, 2012

It turns out that although ConvertWikiToStorage is the right class, it has a monster constructor which for a nnon-API developer is difficult to undestand and use. On asking Atlassian for example code snippets I've been told this is not really possible, so I've resorted to writing my own simple converter using Regular Expressions.

1 vote
JohnA
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 Champions.
October 25, 2012

Hi Bahman,

There is indeed a public API available in Confluence for this task, which you can check out in our API documentation: http://docs.atlassian.com/confluence/latest/com/atlassian/confluence/xhtml/api/XhtmlContent.html

I believe the argument you would need to use for this is ConvertWikiToStorage, but this might change depending on your needs so I would suggest that you review the documentation for your needs because there are various options you might want to use depending on your approach.

All the best,
John

TAGS
AUG Leaders

Atlassian Community Events