Skip to content
New issue

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

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

Already on GitHub? # to your account

Render error when single quotation mark meets right curvly bracket #247

Open
starrynight opened this issue Mar 12, 2024 · 1 comment
Open

Comments

@starrynight
Copy link

A single example like this will cause a render error ( tested on Release 1.3.1)

void minimum_example() {
    
    jinja2::Template tpl;
    
    tpl.Load("{{ 'Hello World!' + '\n'}}");
    
    std::cout << tpl.RenderAsString({}).value() << std::endl;
    
}

I found the issue could be avoided if a space is inserted:

tpl.Load("{{ 'Hello World!' + '\n' }}");

But considering template file is usually not so space sensitive and accurate, I wonder if this is something that can be fixed?

@Wovchena
Copy link

A possible workaround is to replace ' with \".

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

No branches or pull requests

2 participants