Why does the body of my macro now display as raw html after upgrading to Confluence 6?
Asked by Matt Boesch:

I will preface this by saying I am not really a plugin developer (or much of a Java developer anymore). A while ago, I modified/customized a plugin for Confluence 5.5.7 and it displays and works fine. Now that I upgrade to Confluence 6.2.1, it displays raw html from the body instead of formatted text. For example, the body is being displayed as the following in the browser

```
<p>You have agreed to the terms and conditions. Please proceed to<span style="font-size:large;font-face:serif" class="conf-macro output-inline" data-hasbody="true" data-macro-name="span"> <a href="/display/sbirsttrac/SBIR-STTR+Advisory+Committee+Meetings">SBIR-STTR Advisory Committee Meetings</a>, <a href="/display/sbirsttrac/Working+Groups">Working Groups</a> or <a href="/display/sbirsttrac/Travel%2C+Reimbursement%2C+and+Conflict">Travel, Reimbursement, and Conflict</a> </span> </p>
```

with the source from the browser being

```
<p>You have agreed to the terms and conditions. Please proceed to<span style="font-size:large;font-face:serif" class="conf-macro output-inline" data-hasbody="true" data-macro-name="span"> <a href="/display/sbirsttrac/SBIR-STTR+Advisory+Committee+Meetings">SBIR-STTR Advisory Committee Meetings</a>, <a href="/display/sbirsttrac/Working+Groups">Working Groups</a> or <a href="/display/sbirsttrac/Travel%2C+Reimbursement%2C+and+Conflict">Travel, Reimbursement, and Conflict</a> </span>?
```

The storage format is

```
<ac:structured-macro ac:name="group-signup" ac:schema-version="1" ac:macro-id="71de1bf0-cd35-405d-a75a-12910b0a8596"><ac:parameter ac:name="button">I Agree</ac:parameter><ac:parameter ac:name="key">sbirsttrac</ac:parameter><ac:rich-text-body><p>You have agreed to the terms and conditions. Please proceed to</p><ac:structured-macro ac:name="span" ac:schema-version="1" ac:macro-id="0adb94ba-0f56-47cf-b65c-88b31f02df9b"><ac:parameter ac:name="style">font-size:large;font-face:serif</ac:parameter><ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter><ac:rich-text-body><p><ac:link><ri:page ri:content-title="SBIR-STTR Advisory Committee Meetings" /></ac:link>, <ac:link><ri:page ri:content-title="Working Groups" /></ac:link> or <ac:link><ri:page ri:content-title="Travel, Reimbursement, and Conflict" /></ac:link></p></ac:rich-text-body></ac:structured-macro><p class="auto-cursor-target"><br /></p></ac:rich-text-body></ac:structured-macro>
```

So basically, I have my plugin/macro and inside it as the body I have "You have agreed to the terms and conditions. Please proceed to". Then while still inside my plugin/macro body I use the span macro and in the body of that I have confluence page links.

What do I need to do to get my plugin/macro to display as it did previously and interpret the html and not escape it? Is there something I need to possibly change in my Java class?


Answers:
author: Matt Boesch
body: Does anybody have any thoughts on this or need more details? It seems like this may be a straight forward answer for those that do Confluence plugin development.


Tags: app

confluence-app

confluence-development

html

macro

questions-for-confluence