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

How to convert a wiki markup to XHTML using remote API

HengHwaH September 28, 2011

In the Remote API v1, we can create pages using wiki markup, but when it come to Confluence version 4, wiki markup is not available anymore. So may I know is there an easy one method way to convert the wiki markup generated in our current remote API client to XHTML and store it in database? Instead of changing the whole remote API client structure to generate XHTML content?

4 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

5 votes
Answer accepted
Aoyon Chowdhury September 28, 2011

Actually, you can continue to use the wiki markup with the v1 apis to create/update pages. You can no longer view the page information in wiki markup though.

If you use v2 APIs, then the page information has to be in xhtml format as well.

To convert the wiki markup to xhmtl, Use the convertWikiToStorageFormat(String token, String markup) method. This is available in both v1 and v2 apis. More details are at https://developer.atlassian.com/display/CONFDEV/Confluence+XML-RPC+and+SOAP+APIs

3 votes
Sherif Mansour
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 1, 2011

Aoyan is correct, we've introduced a new method called {{convertWikiToStorageFormat}}. You can learn more about the API changes here: https://developer.atlassian.com/display/CONFDEV/Changes+to+the+remote+API+in+Confluence+4.0

Sorin Sbarnea (Citrix)
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.
June 6, 2013

Thank for the answer, very helpful. Now I the only remaining question is how to detect if a page is returned in XHTML or Wiki format?

I need this in order to provide backwards compatibility for a API that allows you to update wiki pages.

Still, I have no idea how to guess if getPage() returns XHTML or Wiki syntax.

0 votes
Catherine Mora April 1, 2012

Hi Matthew,

Thanks for your reply. I need to extract pages and blog information using the SOAP API and index it with a search engine. Right now when I do this, I'm getting macros e.g. {viewfile} and things like that in my search results so I need to do a cleanup to display user friendly data.

I was checking the documentation for renderContent, looks like it is what I need. Do you know if no macros or wiki markup is removed when this method is used?

Thanks in advance!

0 votes
Catherine Mora March 29, 2012

Hi Guys,

I'm using version 3.5 and I'm extracting page information using the SOAP API. For pages created using the Wiki Markup Language I get the content in that format, but I would like to convert it to XHTML or any other format without the wiki tags?

Matthew Erickson
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 1, 2012

Hi Katherine,

Confluence 3.5 does not use the XHTML format. If you want to convert it you will need to use a Confluence server running 4.0 or newer. What is your use case? You might find the renderContent method useful.

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events