grav-plugin-admin icon indicating copy to clipboard operation
grav-plugin-admin copied to clipboard

Apostrophe in description metadata is not displayed correctly

Open jstebenne opened this issue 5 years ago • 6 comments

When specifying text with an apostrophe in a metadata description, the text displayed on the web page does not parse correctly.

Code:

metadata:
    description: 'C''est un texte de test'

Expected result:

<meta name="description" content="C'est un texte de test">

Actual result:

<meta name="description" content="C&amp;#039;est un texte de test">

I also tried by using double quotes to surround the text, but it doesn't change anything.

I am running Grav v1.6.23

jstebenne avatar Aug 14 '20 21:08 jstebenne

Appears that there's encoding happening there that shouldnt

rhukster avatar Oct 17 '20 18:10 rhukster

Meta property should probably have attribute escaping, not html. Which theme are you using?

mahagr avatar Oct 21 '20 08:10 mahagr

@mahagr I believe it was this theme: https://rockettheme.com/grav/themes/isotope

jstebenne avatar Nov 13 '20 16:11 jstebenne

Any update on this issue? Would this be a Gantry/Nucleus thing that needs to be addressed? Looks to me like it is using the escape attribute:

/gantry5/engines/nucleus/templates/page_head.html

<meta name="{{ key|e }}" content="{{ value|e }}" />

presently it's rendering apostrophe's like: &apos;

blizam avatar Jun 19 '23 19:06 blizam

@blizam your example is coming from a twig file in Gantry5 not from Grav admin plugin. This is not the repo for this issue

rhukster avatar Jun 19 '23 20:06 rhukster

fair enough, I opened https://github.com/gantry/gantry5/issues/3160

blizam avatar Jun 19 '23 22:06 blizam