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

Support dollar sign or at sign ? #185

Closed
gauss02 opened this issue Jan 13, 2021 · 1 comment
Closed

Support dollar sign or at sign ? #185

gauss02 opened this issue Jan 13, 2021 · 1 comment

Comments

@gauss02
Copy link

gauss02 commented Jan 13, 2021

json data;
data["name"] = "name";
data["name"] = "name";
data["$name"] = "$name";
data["@name"] = "@name";
data["
$name"] = "
$name";
data["@name"] = "@name";
std::cout<<data.dump(2) <<std::endl;
std::cout<<render("Hello 1 {{ name }}!", data) <<std::endl;
std::cout<<render("Hello 2 {{ _name }}!", data) <<std::endl;
std::cout<<render("Hello 3 {{ $name }}!", data) <<std::endl;
std::cout<<render("Hello 4 {{ @name }}!", data) <<std::endl;
std::cout<<render("Hello 5 {{ _$name }}!", data) <<std::endl;
std::cout<<render("Hello 6 {{ _@name }}!", data) <<std::endl;

{
"$name": "$name",
"@name": "@name",
"$name": "$name",
"@name": "@name",
"_name": "_name",
"name": "name"
}
Hello 1 name!
Hello 2 _name!
Hello 3 name!
Hello 4 name!
terminate called after throwing an instance of 'inja::RenderError'
what(): [inja.exception.render_error] (at 1:12) malformed expression

@pantor
Copy link
Owner

pantor commented Jan 16, 2021

This should be fixed with the latest commit. Thanks for the feedback!

@pantor pantor closed this as completed Jan 16, 2021
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