Inline rich-text macro?

Hi, I’m trying to create a static content macro which displays some rich text inline. This is part of a proof-of-concept where the page body defining the macro is automatically created by my app, so it’s not necessary for a user to be able to edit the content of the macro.

I’m finding it difficult to combine the inline and rich-text properties. The following (simplified) macro descriptor allows for an inline macro de be defined using plain-text, as in the example below the descriptor.

// descriptor
{
  "key": "some-key",
  "url": "some-url",
  "bodyType": "plain-text",
  "outputType": "inline"
}
// macro definition in page body
{
  "type": "inlineExtension",
  "attrs": {
    "extensionKey": "some-key",
    "parameters": {
      "macroParams": {
        "__bodyContent": {
          "value": "...content to be displayed..."
        }
      }
    }
  }
}

In the page editor, this results in the following in-line element (the macro just displays the body content value). This content of this element cannot be edited in the editor by the user: it can only be deleted.

image
image

Now I want to change the macro to use rich-text for its value, so I change the descriptor to be the following:

// descriptor
{
  "key": "some-key",
  "url": "some-url",
  "bodyType": "rich-text",
  "outputType": "inline"
}

If I now use the same macro definition in the page body, I instead get this result in the editor:

The inline macro has changed into a block macro, even though the outputType in the descriptor is still set to inline. Inspecting the macro definition in the new page source after saving, I find that the type of the macro element has been forced to bodiedExtension, even though in the definition that I sent (see above), it was set to inlineExtension .

This makes it seem like it is not possible to have an inline rich-text macro. If there is in fact a way to do it, I would be very interested in hearing about it. If not, perhaps this is an oversight by Atlassian in forcing richt-text macros to be in block mode? Thanks in advance!

Dear @MareinKnings ,

You made exactly the same experiences as I made a while ago.

For the plain text macro you would need at least one parameter to show the legacy macro editor (at least to my knowledge) or you have to define a custom macro editor. This problem was introduced recently with the new macro editing experience.

For the rich text macro there is a bug report which has been closed by Atlassian without a solution or work around: https://jira.atlassian.com/browse/CONFCLOUD-66008

Best regards

Andreas

1 Like