I have a user macro called {username} which works great in an {info} block but gets displayed verbatim as '{username}' in a {code:language=bash} block. How can get the {code:language=bash} to respect the macro?
{code} and {noformat} are special-case macros in Confluence - they both ignore any wiki markup therin. You could get around it in two ways:
1. Use a different type of block (eg. {quote}).
2. Inject the value you want to put in using {replace-and-render} or Reporting. Eg:
{replace-and-render}
{replace-item:%username%}{username}{replace-item}
{replace-body}{code:language=bash}Blah blah %username% blah blah{code}{report-body}
Hope that helps!
Regards,
David Peterson
P.S. You'll need the 'Replace and Render' plugin for that example to work.
It looks like you're new here. Sign in or register to get started.