Forum

Thread tagged as: Question, Problem, Redactor

Convert double quotes into single ones

Hi,

in my CMS I have a textarea input with Redactor and html=true. When a link is inserted via Redactor obviously it uses double quotes in the HTML. I need to convert double quotes used within the link into single quotes.

Is there a way to do this?

thx

Andrea Zanchetta

Andrea Zanchetta 0 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

I can't think of a way for doing that just within a link from the Perch end of things. Redactor might have a solution for you.

Why do you need to do this?

It's not an injection! ;)

I'm using the Unite Gallery Slider - https://unitegallery.net The editor of the site is allowed to input a 'data-description' property (the caption of each image of the gallery) that the slider than parse in a html div via JS. But now my client needs to insert also a link in the caption and the html url with double quotes disrupts everything... But it would work with singles quotes.

If it's impossible with Perch, I'll take a look to redactor documentation.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Add escape="true" to the tag and double quotes will be escaped.