You need to be logged in to post in the forum - Log In

An active JCE Pro Subscription is required to post in the forum - Buy a Subscription

Support is currently Offline

Official support hours
Monday to Friday
09:00 - 17:00 Europe/London (BST)

Please create a new Ticket and we will get back to you as soon as we can.

#117302 editor tab keeps adding html elements to code

Posted in ‘Editor’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Latest post by infini on Tuesday, 02 September 2025 21:02 BST

infini

ugh.. typed out a whole thing, and it was blocked, probably due to have "scripts" etc.

we're using regular labs users anywhere, and we are using the {if} condition to output or not, a link to import a script or link to a css file..

and its fine in the Code Tab, but when we go to the editor tab, then go back to the code tab -- the editor adds html markup, and strips out the css links - we already setup jce to not validate html, and told joomla no text filtering.. anything else? 

we did try on other thing we added <code></code> and it seem to work , but the editor tab wouldnt load at that point anymore.

KUgi8h.jpg

GRiZ7A.jpg

Ryan

As the editor is primarily an HTML editor, "code" like this {user id="input:uid"}, which is not HTML code, is treated as text and processed accordingly. JCE does have an option to attempt to protect shortcode like this, but it does not work very well in multi-line scenarios llike yours.

In addition, the combination of script and link elements, which must also be treated slightly differently to regular HTML for security reasons, complicates things.

The best way to deal with this is to tell the editor that this is all custom xml code, and to therefore ignore it. To do this:

  1. In Editor Profiles -> Editor Parameters -> Advanced, in the Code Blocks section, set:
    1. Enable Code Blocks to Yes
    2. Allow Javascript to Yes
    3. Allow CSS to Yes
    4. Allow Custom XML to Yes
  2. In the editor, select XML from the Format list (the last item) to create an XML Code Block.
  3. In this code block, create a custom XML container, eg: <custom></custom> and paste you code into this container.
  4. Press SHIFT + ENTER to exit the block

This will then protect your code, but the browser will ignore the <custom> tag in the front-end.

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

infini

OK! Thank you So much! for the excellent explanation and solution. I would say this works for us!