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 Online

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

#111702 Editing an item with code area breaks content

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 yannickgaultier on Monday, 22 August 2022 11:50 BST

yannickgaultier
Hi Ryan,

Since last version, 2.9.29 pro, at least that's when we noticed, JCE seems to want to turn URLs it finds in the content into links. For instance, with the following content:

<pre><a href="https://weeblr.com>testing</a></pre>

<pre> was inserted by JCE, after selecting the "Preformatted" format in the Format select toolbar tool.

Saving that post and viewing it on the site seems ok at first but editing again the post, and looking at the html source code by toggling the editor off, the <a> tag inside the code block has been turned into an actual active link. Toggling the editor off shows the content is now:

<p>Some link in content as code</p>
<pre><a href="https://www.joomlacontenteditor.net/"https://weeblr.com">testing</a></pre>
<p>end of test</p>
<p> </p>

Notice the addition " inside of the href, which was not there to start with. The editor now shows the link as active, which is likely because of a missing code tag:

See screenshot here: https://assets.weeblr.net/images/screenshots/weeblr-2022-08-19-10.56.57.png

Has something changed here? is "Preformatted" only applying a <pre> tag now? If so, how do we format a code block? First apply "PreFormatted", then select the content inside and apply "Code". That works but seems tedious and again, we have not done that in the many years of using JCE.

Thanks for shedding any light,

Best regards
Yannick Gaultier
weeblr.com / @weeblr



yannickgaultier
Additional detail: I skimmed through the settings but could not find anything related, where I could switched off that auto-linking feature. I'll get back to it and try and find such option again in case I missed it.

yannickgaultier
As a confirmation, all options to create links in content are off:

https://assets.weeblr.net/images/screenshots/weeblr-2022-08-19-11.07.03.png

Ryan
Saving that post and viewing it on the site seems ok at first but editing again the post, and looking at the html source code by toggling the editor off, the <a> tag inside the code block has been turned into an actual active link. Toggling the editor off shows the content is now:


If you toggle the editor off, revealing the code in the textarea, then toggle it back on again, is the link code still displayed as HTML code?

If you toggle the editor off then save, has the encoded HTML link been altered during saving?

Ryan Demmer

Lead Developer / CEO / CTO

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

Ryan
Has something changed here? is "Preformatted" only applying a
 tag now? If so, how do we format a code block? First apply "PreFormatted", then select the content inside and apply "Code". That works but seems tedious and again, we have not done that in the many years of using JCE.


It has never been the case that adding a
 around any HTML content in the editor would convert that HTML into preformatted code. You need to add the 
 first, then type or paste the content into the 
 block.					

Ryan Demmer

Lead Developer / CEO / CTO

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

yannickgaultier
Hi

It has never been the case that adding a <pre> around any HTML content in the editor would convert that HTML into preformatted code. You need to add the <pre> first, then type or paste the content into the <pre> block.
Correct, my description may have been confusing.
Indeed, we:
- select the "Preformatted" format at the start of an empty line
- inside the "block" that appears after pressing the button, we paste content, usually a piece of PHP or HTML code.

If you toggle the editor off, revealing the code in the textarea, then toggle it back on again, is the link code still displayed as HTML code?
No, as soon as you get back to Editor on, the content is transformed and does not show anymore the content as raw HTML code.


If you toggle the editor off then save, has the encoded HTML link been altered during saving?
Yes, that's the usual workaround we use when the editor wants to convert content to HTML but not something all of us can handle.

I have made this small video to show the process: https://vimeo.com/741111971/9f707017bc

I realize now that maybe this is due to Akeeba Ticket System mishandling somehow the saved HTML but there has not been an ATS release in months (January 2022) and this has only appeared very recently - while there's been multiple JCE releases over the last few months.

Yannick

Ryan
I realize now that maybe this is due to Akeeba Ticket System mishandling somehow the saved HTML but there has not been an ATS release in months (January 2022) and this has only appeared very recently - while there's been multiple JCE releases over the last few months.


Does this only happen with Akeeba Ticket System?

Ryan Demmer

Lead Developer / CEO / CTO

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

yannickgaultier
Hi

Good question, I should have tested that before. Indeed, I can't reproduce that in the admin, for regular content, even after switching to using the JCE profile assigned to frontend ATS editing.

So I guess it has to do with ATS, the weird thing being, again, that last update was in january...

Unless you have a brilliant idea, I guess I'll have to talk to Akeeba...

Ryan
Good question, I should have tested that before. Indeed, I can't reproduce that in the admin, for regular content, even after switching to using the JCE profile assigned to frontend ATS editing.

So I guess it has to do with ATS, the weird thing being, again, that last update was in january...


I would imagine this is part of the cleanup process for ATS, where the content is being decoded before filtering. I'm sure Nicholas has a good reason for this, but it might be worth pointing out to him.

Ryan Demmer

Lead Developer / CEO / CTO

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

yannickgaultier
Well, that did not happen before, and there was no update in ATS since january so I don't see how this can actually be from ATS itself. It would also be a bug if the content is not respected. In our case, it actually creates a security issue rather than preventing it, by turning an inert text into a live link.

Anyway, I'll try debug on our staging site.

Cheers

Ryan
I've just tested this with ATS 4.0.7 and confirm that the content appears to be decoded when the ticket is submitted, even when the editor is toggled off, ie:
Create the content,
toggle editor off (content is encoded in the pre tag as it should be),
submit ticket.
When the ticket is then edited (editor still off), the content is loaded as decoded, so this must be occuring during the saving stage by the extension.

Ryan Demmer

Lead Developer / CEO / CTO

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

yannickgaultier
Hi

That's odd, I just tested again with editor off, and the problem does not occur.

It's quite clear the problem is not with JCE, I can actually reproduce with native TinyMCE so I'll open a ticket with Akeeba now.

Thanks for looking into it

Cheers