Forum

Thread tagged as: Question, Problem

Perch not escaping ampersands

Hi,

Just created a simple template as below:

<img src="<perch:content type="image" id="image" label="Image" />" alt="<perch:content id="title" type="text" label="Title" required="true" />" />
<h3><perch:content id="title" type="text" /></h3>
<perch:content id="textarea" type="textarea" label="Main text" html="true" editor="ckeditor" />

Problem is, it is outputting the below:

Alt

The ampersands aren't being escaped.

How do I escape the ampersands?

Jon Young

Jon Young 0 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

That looks like a web inspector showing the DOM. What does it look like when you view source? Is the page online somewhere?

Ah, if you view source, it shows the correct escaped &.

Sorry, I could have sworn the web inspector showed the & aswell.