Confluence 4.0. No Wiki-markup in macros. How to workaround

Alex Bobrovski October 2, 2011

I was unpleasantly surprised, that all my macros have stopped working after moving to Confluece 4.0. There is no options "Output format - Wiki markup" anymore.

What should I do? How to work it around? How to call a system macro in my XHTML (now) macro?

Thanks.

5 answers

0 votes
E July 23, 2012

This should work:

## @noparams

<ac:macro ac:name="info" >

 <ac:rich-text-body>

$body

 </ac:rich-text-body>

<ac:macro />

---

And then set the macro as "Escaped".

0 votes
Joe Clark
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 3, 2011

Just trying to understand your question properly, Alex - so you have a macro which, when rendered, includes in its content, an {info} macro?

Does your macro have a body? Is the contents of the {info} macro hard-coded, or configurable by the user?

If you want to convert wiki markup into XHTML, you can get a com.atlassian.confluence.content.render.xhtml.Renderer bean injected into your macro class, and then use that to convert a {macro} string in wiki markup into the corresponding rendered XHTML.

0 votes
Joe Clark
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 3, 2011

@Sue - Confluence 4.0 is fairly unique in the scope of changes to Confluence in that we completely altered the storage format of Confluence from wiki markup to XHTML. In honesty, Confluence 4 is probably the biggest change to Confluence ever, and it's probably unlikely that things will change this much again.

We have lots of resources to help plugin developers prepare for Confluence 4.0 upgrades. This page is a good starting point: https://developer.atlassian.com/display/CONFDEV/Preparing+for+Confluence+4.0

If you have any specific questions or problems, please feel free to ask questions on this site and our community can help you out!

0 votes
Sue Hallwood October 3, 2011

i am also having issues with all of the macros, in the theme plugin that I developed, not working in Confluence 4.0. What is the quickest and simplest way to resolve the issue without having to re-write the code? My client is concerned about the cost of upgrading the theme plugin every time a newer version of Confluence is released. Are there always this many changes when a major release of Confluence is re-leased? What are your plans for the future? Will there be more major changes to how macros are developed?

0 votes
Alex Bobrovski October 2, 2011

Ok, I found a part

it's my new body of the macro:
<ac:macro ac:name="info" >
text text text
<ac:macro />

it works partly - it draws a blue panel, but without the text inside. Need help.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events