Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

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

What do you think is the most *delightful* Confluence feature? Comment for a prize!

- Create your own custom emoji 🔥 - "Shake for Feedback" on mobile 📱 - An endless supply of GIFs via GIPHY 🤩 Is there anything quite as nice as a pleasant surprise? Comment below with what...

463 views 24 9
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