Hi! I'm trying to create a custom user macro and I was hoping that, similarly to the code block macro, I would be able to have the user have a multi-line input for the macro where they can input their text, but it seems that using the $body, I can only use one single line. Is there any way to configure that the $body is supposed to have newlines/linebreaks and can be multi-line?
Hi @pascal schilp,
Please share with us your macro configuration.
The macro body may be in one line due to the option Escaped selected in Macro Body Processing.
Here's what the macro looks like:
```
```
> The macro body may be in one line due to the option Escaped selected in Macro Body Processing.
Do you mean that using the Escaped option only allows one line? And so are you saying that the other options (rendered, unrendered, etc) allow multiple lines?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@pascal schilp, try to change Macro Body Processing to Rendered. This option keeps lines and breaks and displays them as they were entered.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I believe we tried the Rendered body processing option, and it still only allowed a single line I believe, but i'll double check to verify.
In the meantime, could you confirm that using Rendered will allow me to enter text with multiline, similarly to the "code block" macro like this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@pascal schilp, I'm not sure about the tag <highlighted-code-snippet> you're using, but just adding the macro with "Macro Body Processing" = "Rendered" and the following body works for me:
## @param Language:title=Language|type=enum|enumValues=astro,c,c++,css,gql,html,http,java,javascript,json,json5,jsonc,jsx,md,php,python,ruby,sql,svelte,toml,tsx,typescript,wasm,xml,yaml|required=true|default=javascript|desc=Choose the language
## @param Theme:title=Theme|type=enum|enumValues=andromeeda,aurora-x,ayu-dark,catppuccin-frappe,catppuccin-latte,catppuccin-macchiato,catppuccin-mocha,dark-plus,dracula,dracula-soft,github-dark,github-dark-default,github-dark-dimmed,github-light,github-light-default,houston,light-plus,material-theme,material-theme-darker,material-theme-lighter,material-theme-ocean,material-theme-palenight,min-dark,min-light,monokai,night-owl,nord,one-dark-pro,poimandres,red,rose-pine,rose-pine-dawn,rose-pine-moon,slack-dark,slack-ochin,solarized-dark,solarized-light,synthwave-84,tokyo-night,vesper,vitesse-black,vitesse-dark,vitesse-light|required=true|default=nord|desc=Choose the theme
$body
How it looks in the editor:
How it looks when a page is published:
I'm using Confluence Data center 8.5.7.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just tried this again, and indeed it's working now 🤦♂️ Im really confused as to why we were seeing a different input before, but I'm gonna guess I just did something wrong.
Thank you for the help and for verifying! Very happy to have it working now
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.