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.

#117331 Bug in JCE Pro 2.9.90+: Custom elements around images are stripped/broken on save (DOMPurify issue?)

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 lluismac on Wednesday, 17 September 2025 17:43 BST

lluismac

Hi Ryan and team,
I'm experiencing a frustrating issue with handling of <figure> elements around images in JCE Pro starting from version 2.9.90. It worked perfectly in 2.9.89, but after the two consecutive updates (2.9.90 and 2.9.91), the HTML code gets dismantled on save or view switch. I've tried all standard workarounds (disabling validation/sanitization, etc.), but it persists even in 2.9.93.
Steps to reproduce (in a new article):
1. Open an article in edit mode.
2. Go to the Code tab and insert this exact code:


<div class="ve-seccioflex-row">
<figure class="ve-seccioflex-media"><img src="https://www.joomlacontenteditor.net/images/sample/sample-image.jpg" alt="Sample image description" width="630" height="354" /><figcaption> </figcaption></figure>
</div>


(Or without figcaption, but I've tried both versions.)

3. Switch to the Editor tab (or save and re-edit).
4. Go back to the Code tab: The result is this (the <img> moves outside the <figure>, and it ends up empty):

<div class="ve-seccioflex-row"><img src="https://www.joomlacontenteditor.net/images/sample/sample-image.jpg" alt="Sample image description" width="630" height="354" />
<figure class="ve-seccioflex-media"><figcaption> </figcaption></figure>
</div>

 My setup:
• Joomla: 5.x (with Helix Ultimate 2 template – the ve-seccioflex-* classes are from my custom theme).
• JCE Pro: 2.9.93 (I've updated step by step: 2.9.90 → 2.9.91 → 2.9.92 → 2.9.93; issue started from 2.9.90).
• Editor Profile: Default.
o Editor Parameters > Cleanup & Output: Validate HTML = No; Sanitize HTML = No.
o Typography: Container & Enter = No Container & Linebreak on Enter.
o Toggle Editor button: Disabled.
• Global Configuration (JCE): Custom Variable figure_data_attribute = false (to avoid automatic attributes on <figure>).
• Joomla Global > Text Filters: No Filtering for Super Users.

Workarounds tried (without success):
• Fully disabling Sanitize/Validate.
• Adding custom attributes like data-custom="preserve" to <figure>.
• Using empty <figcaption> or with (still dismantles).
• Editing only in Code tab and saving without switching tabs.
• Clearing JCE/Joomla cache after each update.

Thanks in advance

Best regards
Lluis

 

Ryan

Please try JCE Pro 2.9.94 Beta - https://www.joomlacontenteditor.net/downloads/editor/pro/development

Clear your browser cache after install.

Ryan Demmer

Lead Developer / CEO / CTO

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

UteS

Hello Ryan,

I can confirm the bug described above for Joomla 4 and 5 and JCE Pro 2.9.90+ , and another one similar like this, see below. For me, both have been fixed with 2.9.94 Beta

Bug description for HTML elements details & summary: Screencast JCE-details-summary Bug

The details end tag is moved directly behind the summary element so that the content (some p elements) is always visible. The "accordion" can't be closed. This happens when saving or switching from code to edit

Best regards

Ute

lluismac

 Hi Ryan,

 Thank you for your reply, it seems that JCE Pro 2.9.94 Beta has fixed this issue.

While reviewing the content of my website, I noticed another error:

<li class="ve-spec"><span class="ve-spec-icon ve-ic-capacity" aria-hidden="true"></span> <span><strong>16</strong> persones</span></li>
<li class="ve-spec"><span class="ve-spec-icon ve-ic-rooms" aria-hidden="true"></span> <span><strong>8</strong> habitacions</span></li>
<li class="ve-spec"><span class="ve-spec-icon ve-ic-area" aria-hidden="true"></span> <span><strong>400 m²</strong> interiors</span></li>
<li class="ve-spec"><span class="ve-spec-icon ve-ic-pool" aria-hidden="true"></span> <span>Piscina i jardí</span></li>

is converted into:

<li class="ve-spec"> <span><strong>16</strong> persones</span></li>
<li class="ve-spec"> <span><strong>8</strong> habitacions</span></li>
<li class="ve-spec"> <span><strong>400 m²</strong> interiors</span></li>
<li class="ve-spec"> <span>Piscina & jardí</span></li>

 JCE Pro 2.9.94 Beta has not fixed this problem.

 I understand that these issues take time to resolve, but is there a “clean” way to roll back to version 2.9.89? I need to deliver the project.

 Thank you for your understanding.

 Lluís

 

 

Ryan

I understand that these issues take time to resolve, but is there a “clean” way to roll back to version 2.9.89? I need to deliver the project.

Uninstall JCE Pro 2.9.94 and install JCE Pro 2.9.89

Ryan Demmer

Lead Developer / CEO / CTO

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

Ryan

While reviewing the content of my website, I noticed another error:

<li class="ve-spec"><span class="ve-spec-icon ve-ic-capacity" aria-hidden="true"></span> <span><strong>16</strong> persones</span></li>
<li class="ve-spec"><span class="ve-spec-icon ve-ic-rooms" aria-hidden="true"></span> <span><strong>8</strong> habitacions</span></li>
<li class="ve-spec"><span class="ve-spec-icon ve-ic-area" aria-hidden="true"></span> <span><strong>400 m²</strong> interiors</span></li>
<li class="ve-spec"><span class="ve-spec-icon ve-ic-pool" aria-hidden="true"></span> <span>Piscina i jardí</span></li>

is converted into:

<li class="ve-spec"> <span><strong>16</strong> persones</span></li>
<li class="ve-spec"> <span><strong>8</strong> habitacions</span></li>
<li class="ve-spec"> <span><strong>400 m²</strong> interiors</span></li>
<li class="ve-spec"> <span>Piscina & jardí</span></li>

JCE Pro 2.9.94 Beta has not fixed this problem.

In my tests with JCE Pro 2.9.94 Beta 2, your code results in:

<ul>
<li class="ve-spec"><span class="ve-spec-icon ve-ic-capacity" aria-hidden="true"></span> <span><strong>16</strong> persones</span></li>
<li class="ve-spec"><span class="ve-spec-icon ve-ic-rooms" aria-hidden="true"></span> <span><strong>8</strong> habitacions</span></li>
<li class="ve-spec"><span class="ve-spec-icon ve-ic-area" aria-hidden="true"></span> <span><strong>400 m²</strong> interiors</span></li>
<li class="ve-spec"><span class="ve-spec-icon ve-ic-pool" aria-hidden="true"></span> <span>Piscina i jardí</span></li>
</ul>

Ryan Demmer

Lead Developer / CEO / CTO

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

lluismac

Hi Ryan,

Unfortunately, it doesn’t work for me. I’m sending you a video. The browser cache and Joomla cache have been cleared.

Video

Thanks again,

 

Ryan

Ok confirmed. This only happens when you save in the Code Editor, if you switch to the editor tab and save, the code should remain intact. I am investigating, but you can set the Validate Content option to No in Editor Profiles -> Plugin Parameters -> Code Editor to get around this.

Ryan Demmer

Lead Developer / CEO / CTO

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

lluismac

Hi Ryan,

I confirm it’s exactly as you say. If I edit the code, switch to the editor tab, and save, the code remains intact.

 

Ryan

Please try JCE Pro 2.9.94 Beta 3 - https://www.joomlacontenteditor.net/downloads/editor/pro/development

Clear your browser cache after install.

Ryan Demmer

Lead Developer / CEO / CTO

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

lluismac

Dear Ryan,

With Validate Content set to Yes, the JCE Pro 2.9.94 RC 1 version seems to have fixed the problem.

I really appreciate the work you are doing with JCE Editor, my default editor for many years.

Best regards,

Lluís