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.

#108058 Cleanup Guidance for Ampersands (&)

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 Ryan on Wednesday, 09 June 2021 19:36 BST

nphic
Folks,

I'm having a bit of an issue with JCE Editor. I'm sure it is user error, but I need some help. I am adding Google Analytics code to a hyperlink in the "Code" area of JCE Editor for a K2 item. Below is an example:

menu-alias?utm_source=Source&utm_medium=Home&utm_content=AgeCOVID19-Part2&utm_campaign=CampaignName

When switching between "Editor" and "Code" tabs, the & becomes & like below:

menu-alias?utm_source=Source&utm_medium=Home&utm_content=AgeCOVID19-Part2&utm_campaign=CampaignName

I've turned off validate and cleanup of html but still makes the replacement. How can I stop JCE Editor from doing this substitution?

Thanks,
Joe

Ryan
I assume you are referring to the conversion of & to & amp; (the forum has not displayed your post as intended) in the href value of the link?

Ampersands should be encoded in url values - https://stackoverflow.com/questions/3705591/do-i-encode-ampersands-in-a-href

If you absolutely must have them unencoded, perhaps because a badly coded Joomla plugin no longer works with the encoded url, then you can set a Custom Configuration Variables value in the Editor Global Configuration, as in the image below:

https://cdn.joomlacontenteditor.net/tmp/108058-cleanup-guidance-for-ampersands.jpg

Ryan Demmer

Lead Developer / CEO / CTO

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