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

Control characters aren't allowed in handlebars expressions. #656

Closed
swjain opened this issue Oct 25, 2018 · 0 comments
Closed

Control characters aren't allowed in handlebars expressions. #656

swjain opened this issue Oct 25, 2018 · 0 comments
Milestone

Comments

@swjain
Copy link
Contributor

swjain commented Oct 25, 2018

Expressions with control characters such as below though are supported by handlebars javascript library but throws parse error on handlebars.java.

<html>
  <body>
    Hi {{data�Баллы1}} 
  </body>
</html

Error:

Caused by: com.github.jknack.handlebars.HandlebarsException: inline@4f9ca91d:1:22: found: '�'
<html><body> Hi {{data�Баллы1}}</body></html>
                      ^

	at com.github.jknack.handlebars.internal.HbsErrorReporter.syntaxError(HbsErrorReporter.java:93)
	at com.github.jknack.handlebars.internal.antlr.ProxyErrorListener.syntaxError(ProxyErrorListener.java:41)
	at com.github.jknack.handlebars.internal.HbsParserFactory$2.notifyListeners(HbsParserFactory.java:136)
	at com.github.jknack.handlebars.internal.antlr.Lexer.nextToken(Lexer.java:144)
	at com.github.jknack.handlebars.internal.antlr.BufferedTokenStream.fetch(BufferedTokenStream.java:169)
	at com.github.jknack.handlebars.internal.antlr.BufferedTokenStream.sync(BufferedTokenStream.java:152)
	at com.github.jknack.handlebars.internal.antlr.BufferedTokenStream.consume(BufferedTokenStream.java:136)
	at com.github.jknack.handlebars.internal.antlr.Parser.consume(Parser.java:571)
	at com.github.jknack.handlebars.internal.antlr.Parser.match(Parser.java:203)
	at com.github.jknack.handlebars.internal.HbsParser.sexpr(HbsParser.java:887)
	at com.github.jknack.handlebars.internal.HbsParser.var(HbsParser.java:1381)
	at com.github.jknack.handlebars.internal.HbsParser.statement(HbsParser.java:344)
	at com.github.jknack.handlebars.internal.HbsParser.body(HbsParser.java:222)
	at com.github.jknack.handlebars.internal.HbsParser.template(HbsParser.java:165)
	at com.github.jknack.handlebars.internal.HbsParserFactory$1.parse(HbsParserFactory.java:86)
	at com.github.jknack.handlebars.cache.NullTemplateCache.get(NullTemplateCache.java:54)
	at com.github.jknack.handlebars.Handlebars.compile(Handlebars.java:513)
	at com.github.jknack.handlebars.Handlebars.compileInline(Handlebars.java:473)
	at com.github.jknack.handlebars.Handlebars.compileInline(Handlebars.java:453)
	at org.infobip.email.gateway.content.HandlebarsExpressionResolver.resolve(HandlebarsExpressionResolver.java:50)
	... 25 more

#658

jknack pushed a commit that referenced this issue Oct 27, 2018
* Fixing grammar for ID token to accept unicode ctrl characters in the range of \u0001 - \u001F

* Adding support for russian character set

* Fixed #657 to support registration of helpers written in ES6's const/let syntax

* Fixing CompositeTemplateLoaderTest.resolveSourceAtFs() to not fail on windows because of path separator '\'

* Fixing checkstyle errors
@jknack jknack added this to the 4.1.1 milestone Oct 27, 2018
@jknack jknack closed this as completed Oct 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants