We're migrating from Confluence 3.5 to Confluence 5 and have a custom macro that renders its body content. We're using <br> tags in the macro body content, and they no longer seem to work (perhaps to prevent injection attacks?). How do I represent a line break in a macro body?
A big hack, but what worked was splitting the string on the <BR> tag in the Velocity template and putting a <br> after each token.
#if($person.title.contains("<BR>")) #foreach($token in $person.title.split("<BR>")) $token<br> #end #else $!person.title #end
One clarification that I forgot to add was that I am using a Velocity template renderer. I think the appropriate solution may be to follow the example of the com.atlassian.confluence.plugins.expand.ExpandMacro class. I'll try the approach it uses with another macro I need to migrade that uses a Velocity template and post an update here.
This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.Read more
Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs