Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Grav 1.7] Metadata template should not use escaping #3121

Closed
NicoHood opened this issue Jan 2, 2021 · 3 comments
Closed

[Grav 1.7] Metadata template should not use escaping #3121

NicoHood opened this issue Jan 2, 2021 · 3 comments
Assignees

Comments

@NicoHood
Copy link
Contributor

NicoHood commented Jan 2, 2021

https://github.com/getgrav/grav/blob/fdf884036da0c3b613be75e815eaebb6de015722/system/templates/partials/metadata.html.twig

When having a metadata of red & blue this is getting escaped twice with Grav 1.7. I guess this is done somewhere in the code and also via default escaping. What I am not sure about is, if only content must have a raw filter, or property, charset, name and http_equiv as well. Or if there is even a better fix.

@NicoHood
Copy link
Contributor Author

NicoHood commented Jan 2, 2021

I found another issue: Site metadata is not escaped, while page metadata is. This causes issues in my case, as I must handle those cases differently.

{{site.metadata.description}}<br>
{{page.metadata.description.content}}

If you ask me grav should not escape anything when processing the page metadata and the twig autoescaping functionality should handle the rest. Old themes should be fixed with the |e filter.

@mahagr
Copy link
Member

mahagr commented Jan 20, 2021

No need to change anything. I made the method to automatically take care of whether to escape or not.

@NicoHood
Copy link
Contributor Author

Nice, that works for me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants