How to Render User Inputted HTML in Confluence Macro Using Forge for Cloud Development

Hi @jingao ,

It looks like you’re building a Forge UI Kit app, which has specific options for displaying elements as listed at UI Kit Components

In your example, you’ve used the “Text” element which will only allow you to display text as defined in the forge docs.

Further, the “TextArea” element expects a string as it’s default value, and saves the user input as a string, which means that even using valid markup as defined for the Text element would need to be parsed by your app itself before it could be displayed.

If you’d like to be able to render the HTML elements, I was able to have more success using Custom UI - this post [@atlaskit/comment] Unable to render HTML content helped point me in the right direction. That said, this will make using the ‘config’ option for the macro more complicated as per How to use Macro Configuration with Custom UI apps in Forge

Hope that helps!
Mel