Cannot get macro to display inline

Wendy Fergusson November 11, 2013

This appears to be a change in behaviour from Confluence 4.3.7 to 5.3.1.

Code such as this:

<ac:macro ac:name="report-link">
<ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter>
<ac:default-parameter>content:url</ac:default-parameter>
<ac:rich-text-body>
<ac:emoticon ac:name="green-star"/>
</ac:rich-text-body>
</ac:macro> and some text here</p>

Is automatically changed to this:

<ac:structured-macro ac:name="report-link">
<ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter>
<ac:parameter ac:name="">content:url</ac:parameter>
<ac:rich-text-body>
<ac:emoticon ac:name="green-star"/>
</ac:rich-text-body>
</ac:structured-macro>
<p>and some text here</p>

I can't get it to put the linked icon and the text on the same line. I have encountered this in a couple of different scenarios, it's almost as if the INLINE setting is just ignored.

It works as expected in 4.3.7 - I can get the linked icon and the text on the same line.

Is this a known issue? Is there a workaround, or a fix in progress?

3 answers

1 vote
Steven Parsons November 25, 2013

I am experiencing the same bug as Wendy. The editor keeps adding back in the extra <p> tags every time i save out of the source editor.

Any ideas on how we can fix this? We use the inline macro for the Mathinline Macro

0 votes
Matthew J. Horn
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.
November 25, 2013

You can try piping the macro through another macro and removing the extra <p> tags with string functions like trim() or substring().

Here's some workarounds and examples:

https://answers.atlassian.com/questions/196207/are-macros-now-always-wrapped-in-tags

https://jira.atlassian.com/browse/CONF-10790

https://answers.atlassian.com/questions/139927/confluence-how-can-i-remove-empty-whitespace-paragraph-tags

Wendy Fergusson November 25, 2013

Thanks for the suggestions, but I don't think they help in this case. The extra <p> tags are not around the macro output - they're being inserted around the text which comes after the macro closing tag.

0 votes
Ryan Goodwin
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.
November 14, 2013

Hi Wendy,

It looks like you've identified a bug. I haven't been able to find a report of this specifically, so I created one here:

https://jira.atlassian.com/browse/CONF-31658

This may also be releated:

https://jira.atlassian.com/browse/CONF-24581

Wendy Fergusson November 14, 2013

I don't think the issue you described in the bug is the same one as what I'm seeing. In my case the editor is adding unwanted <p> tags.

I don't think my problem is related to CONF-24581 because that is about the default setting of the output type parameter. In my case the parameter is set correctly but the setting is ignored.

I've confirmed that the problem happens with these macros (there could be others as well, these are the ones I've found):

  • excerpt
  • htmlcomment
  • report-link
  • tooltip (a user macro we've added)
  • latex (from a custom plugin we've written)
Ryan Goodwin
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.
November 17, 2013

Hi Wendy,

I was informed that this is the intended rendering due to being a block level element. Perhaps you can use a page layout with 2 columns to get the items to render on the same line.

If you're getting extra <p> tags, you can try removing them using the confluence source editor add-on:

https://marketplace.atlassian.com/plugins/com.atlassian.confluence.plugins.editor.confluence-source-editor

Wendy Fergusson November 17, 2013

What exactly is a block level element? These macros are set with <code><ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter><code>.

Two columns will not do what I want - I want the macro embedded into a paragraph of text.

I cannot remove the extra <p> tags - the editor automatically adds them back in.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events