0

For some reason my product grid in Magento ver. 2.3.4 (Open Source version) is rendering the special characters & and " as HTML tags.

For example creating a product with the name

Product name & Testing "Description"

It renders in the grid as:

Product name & Testing "Description"

enter image description here

This seems to only occur in the product grid shown on the Admin pages. The product name characters display as they should on the front end of the site.

enter image description here

There don't seem to be any errors in the console and I've disabled the only extension which has a direct effect on the product grid which didn't change anything so I'm not sure what is causing it.

It also doesn't seem to be affecting any characters other that & and ". None of the other characters I enter seem to be affected by this.

Does anyone know how to fix this issue, or what might be causing it?

Thanks

2 Answers 2

2

It's caused by the fact that those characters are not supported when copied/pasted like this.

I recommend you should use their HTML equivalent instead:

& : &

" : "

The W3C provides a nice character entity reference if you need to find out more characters: https://dev.w3.org/html5/html-author/charref

1
  • Thank you for this. Unfortunately I've tried using the HTML equivalents and hex codes given in the w3 link but the product grid in the Admin page keeps displaying the code rather than the characters. It still displays fine on the front end though.
    – CJNotts
    Commented Mar 19, 2020 at 10:41
0

I'm experiencing this too with 2.3.4 and it didn't happen previously.

The other answer is incorrect, they should be entered into the admin interface as & and " not as the HTML entity. HTML entities should not be stored in the database. Magento escapes HTML as necessary to display, but is double escaping the product grid for some reason.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.