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

${"\\"} Causes "Unexpected end of template expression" #328

Closed
mhdeeb opened this issue Feb 10, 2024 · 1 comment
Closed

${"\\"} Causes "Unexpected end of template expression" #328

mhdeeb opened this issue Feb 10, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@mhdeeb
Copy link
Contributor

mhdeeb commented Feb 10, 2024

As stated in the title, the existence of ${"\\"} in a .jte causes this exception

gg.jte.TemplateException: Failed to compile test.jte, error at line 1: Unexpected end of template expression
        at gg.jte.compiler.java.JavaCodeGenerator.onError(JavaCodeGenerator.java:227)
        at gg.jte.compiler.TemplateParser.extractTextPart(TemplateParser.java:448)
        at gg.jte.compiler.TemplateParser.doParse(TemplateParser.java:358)
        at gg.jte.compiler.TemplateParser.parse(TemplateParser.java:85)
        at gg.jte.compiler.TemplateParser.parse(TemplateParser.java:80)
        at gg.jte.compiler.TemplateCompiler.generateTemplateCall(TemplateCompiler.java:265)
        at gg.jte.compiler.TemplateCompiler.generate(TemplateCompiler.java:169)
        at gg.jte.compiler.TemplateCompiler.precompile(TemplateCompiler.java:93)
        at gg.jte.compiler.TemplateCompiler.load(TemplateCompiler.java:50)
        at gg.jte.TemplateEngine.lambda$resolveTemplateOnDemand$0(TemplateEngine.java:354)
        at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916)
        at gg.jte.TemplateEngine.resolveTemplateOnDemand(TemplateEngine.java:347)
        at gg.jte.TemplateEngine.resolveTemplate(TemplateEngine.java:337)
        at gg.jte.TemplateEngine.render(TemplateEngine.java:228)
@mhdeeb mhdeeb changed the title !{"\\"} Causes "Unexpected end of template expression" ${"\\"} Causes "Unexpected end of template expression" Feb 10, 2024
@casid casid self-assigned this Feb 10, 2024
@casid
Copy link
Owner

casid commented Feb 10, 2024

Thanks for reporting @mhdeeb, I've just pushed a fix for this.

@casid casid added the bug Something isn't working label Feb 10, 2024
@mhdeeb mhdeeb closed this as completed Feb 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants