Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

HTML Enabled component

vijayl12137971
Level 2
Level 2

I have created a component with sourceedit so that author can add any html required. When I am trying to add CSS and js , it is stripping off those tags. May i Know why ?
is there any solution for this ??

thanks in advance

3 Replies
daniel_henriqu1
Level 4
Level 4

Hi.

You're using HTL/Sightly, the automatic context-aware escaping is probably in place. Try to force a specific context, such as:

<div>${myScript @ context='unsafe'}</div>

Regards,

Daniel.

vijayl12137971
Level 2
Level 2

I was not clear in the above mentioned problem.

I am trying to create a Editor component that will take inline javascript and CSS. Currently with the state of RTE, I cannot put a script <script/> tag even after extending it, as it strips it out and only takes the html tags. Same in the case of <style/>. Is there any harm if we include js and css in the editor component. ?

     

I am trying to create a Editor component that will take inline javascript

daniel_henriqu1
Level 4
Level 4

If your problem is related to the RTE, please check the post Is it possible add javascript in rte?

Regards,

Daniel.