It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to escape Javascript in User macro Edited

Hi.

I'm trying to run Javascript app in a Confluence page*. When I wrote the app in the HTML macro, the  Javascript app seemed to be running as intended like shown below. (It's just an Angular8 sample project)

angular.png

However, when I wrote same app in the User macro, Velocity Template Engine(VTE) parses the app and throws error "Error occured rendering template content".

[User-macro] -> Error occured rendering template content
## @noparams
<script type="text/javascript">
...copy & paste the app code... <-- parsed by Velocity Template Engine
</script>

error.png

To prevent VTL parsing the app, I tried to escape the code with #[[don't parse me!]]# syntax (supported VTE 1.6 or higher) explained in "VTE user manual". But it seems #[[don't parse me!]]# syntax isn't suppoted in Confluence.

[User-macro] -> Error occured rendering template content
## @noparams
#[[
#foreach ($woogie in $boogie)
nothing will happen to $woogie
#end
]]#

Does anyone know how to escape Javascript in User macro? Or is there any way to run Javascript app in the Confluence page?

* Our server administrators said, they can't allow general users to install a plugin to add Web resources or configuring Custom HTML to add <script> tag to <head>. They can only allow general users to add User macros or HTML macros.

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Posted in Confluence

How is your team having fun and bonding, remotely, utilizing Confluence?

Thanks everyone for answering last week’s question. The winner of the random drawing from those who commented is: @LarryBrock I’ll contact you separately with your prize details. This wee...

327 views 9 7
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you