bkiers / Liqp

An ANTLR based 'Liquid Template' parser and rendering engine.
MIT License
165 stars 94 forks source link

How can I ignore the $ char #234

Closed RobertoPegoraro closed 2 years ago

RobertoPegoraro commented 2 years ago

I'm receiving the message: liqp.exceptions.LiquidException: lexer error "token recognition error at: '$'" on line 219, index 39

I'd like to ignore that char and continue without error, is there any way to do that?

In my case I'm trying to compile and HTML and that token is part of a commented code <!-- --> also there is any way to skip the comments?

bkiers commented 2 years ago

@RobertoPegoraro could you add a complete example how that fails? Because this:

Template template = Template.parse("hi {{name}} <!-- $ -->");
String rendered = template.render("name", "tobi");
System.out.println(rendered);

works as expected and prints:

hi tobi <!-- $ -->