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}
{replace-and-render}
Hope that helps!
Regards,
David Peterson
P.S. You'll need the 'Replace and Render' plugin for that example to work. :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.