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

Escaping application/ld+json? #352

Closed
simPod opened this issue Nov 17, 2023 · 0 comments · Fixed by #353
Closed

Escaping application/ld+json? #352

simPod opened this issue Nov 17, 2023 · 0 comments · Fixed by #353

Comments

@simPod
Copy link
Contributor

simPod commented Nov 17, 2023

Version: 3.0.12

Bug Description

I did not find a way how to force latte to escape double quotes in a json string. There's noescape helper but no escape helper or sth. Docs says latte should escape automatically but it does not seem to do so.

Steps To Reproduce

https://fiddle.nette.org/latte/#f147ffe9e0

{var $text = '"lorem" ipsum'}
<script id="json-ld-script" type="application/ld+json">
    {"text": "{$text}"}
</script>

It generates invalid json {"text": ""lorem" ipsum"}

Expected Behavior

Escaped double quotes

Possible Solution

Escape "

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

Successfully merging a pull request may close this issue.

1 participant