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

apostrophes getting turned into something else (unicode maybe?) #1465

Open
tnrich opened this issue Apr 17, 2024 · 1 comment
Open

apostrophes getting turned into something else (unicode maybe?) #1465

tnrich opened this issue Apr 17, 2024 · 1 comment

Comments

@tnrich
Copy link

tnrich commented Apr 17, 2024

const nunjucks = require("nunjucks");
const a = nunjucks.compile("Hello {{ name }}");
console.log(a.render({ name: "world's" }));

Running that file in node results in the following being console logged:

Hello world's

Is there a way to get it to just return

Hello world's

as I think would be expected?

Thanks!

@janbrasna
Copy link

This is an HTML escape, and it's correct. See https://mozilla.github.io/nunjucks/templating.html#autoescaping

You can either configure it to stop autoescaping https://mozilla.github.io/nunjucks/api.html#autoescaping if you know what you're doing (or using it outside of HTML context), or output the string literally by filtering it | safehttps://mozilla.github.io/nunjucks/templating.html#safe

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

No branches or pull requests

2 participants