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)

#102740 JS and CSS code disrupted on save

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 drjjw on Saturday, 25 January 2020 12:12 GMT

drjjw
When saving articles with inline JS and CSS enclosed by script and style tags, some of the code gets disrupted by pre tags inserted in to code and quotation characters removed and replaced. Is there any way to avoid this?

Using JCE Pro 2.8.3

Ryan
Before saving, if you change to the code tab, are the script and style tasg chaned in the same way? Has a <pre> tag been added?

Ryan Demmer

Lead Developer / CEO / CTO

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

drjjw
Seems to happen on save

Ryan
If you toggle the editor off (using the "power" button on the top-right of the editor) or switch to the code tab, and your code appears to be intact, but it is then altered in some way when you save, or when it is displayed in the front-end, then this change is not being done by the editor, but by some other extension or plugin.

Is the code saved with the changes, or only displayed in the front-end in that way?

Ryan Demmer

Lead Developer / CEO / CTO

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

drjjw
I will try to keep an eye for for when the change occurs. The change displays in the front end AND in the editor view when I re-open the article. Could this be from HTML validation?

Ryan
Could this be from HTML validation?


No. If it was you would see the change when you went into Code view or toggled the editor off. Changes that occur during saving the content to the database are not under the control of the editor.

Ryan Demmer

Lead Developer / CEO / CTO

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

drjjw
I have just confirmed, it happens on toggle from Code to Editor - not on save. I am posting the before and after below (forum wont let me post code):

http://d.brightbean.ca/uxLu2n+

Ryan
I am not able to replicate this. Please send me a login - https://www.joomlacontenteditor.net/contact/site-login

Ryan Demmer

Lead Developer / CEO / CTO

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

Ryan
I am still not able to replicate the issue on your site, but I did encounter some javascript errors which have been fixed in JCE Pro 2.8.4 RC3, which has been installed on your site.

Ryan Demmer

Lead Developer / CEO / CTO

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

drjjw
I created a screen video. You can see the change happen at the end of the javascript block - everytime:

http://d.brightbean.ca/4xazcb

Ryan
This appears to be caused by the Markdown plugin in JCE which is interpreting some of the characters in the code as markdown syntax, and converting them

Disabling the Markdown option in Editor Profiles -> Features & Layout fixes this for now, but I will investigate and attempt to fix this permanently.

Ryan Demmer

Lead Developer / CEO / CTO

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

drjjw
OK thanks. Have disabled the feature on all our sites for now.