This page describes a way of allowing arbitrary Confluence content, including macros, in the bodies of macros that don't normally allow this.

Introduction

Confluence macros can be nested within other macros. For instance, the chart macro can take a static table as input:

MacroResult
PluginDownload Count
WhizzPlugin1000
BangPlugin990
ZippyPlugin600
AnotherPlugin500

But it can also take output from a SQL macro:

MacroResult

(or CSV, or any other table-generating macro)

This plugin composability allows very powerful combinations. Like Unix pipes, one macro fetches data and feeds it to another.

 

This is great, but only works when the macro in question was designed to accept the "rich text" XHTML generated by another macro. The chart plugin can have a nested macro, but the SQL Query plugin can't, for example.

Use-cases

Why would we want to send dynamic content to a macro not expecting it? Here are a few situations:

The solution

The solution is to create a wrapper macro that accepts rich text as input,  converts it to plain text