Comments (7)
code to reproduce?
from liqp.
I'll make a test that has a template with a tag that has not been implemented and it should yield the error above. In my case it was happening as the template I was using made use of a post_url
tag. Then that worked and it failed again on another tag.
Actually it tells you when a filter is missing, but I don't think the same happens with tags.
from liqp.
So at this location:
https://github.com/bkiers/Liqp/blob/master/src/main/java/liqp/parser/v4/NodeVisitor.java#L103
Placing something like this:
String tagName = ctx.Id().getText();
if (tags.containsKey(tagName)) {
throw new RuntimeException("No tag exists: " + tagName);
}
return new TagNode(tags.get(tagName), expressions.toArray(new LNode[expressions.size()]));
Helped me report and find the tags that are missing. Maybe this isn't the ideal way to do this but something like this to help users determine if there are tags missing. I'm testing various Jekyll sites and there are a bunch of tags I'll have to implement so some better reporting would be good.
from liqp.
@msangel What's the recommend way to create templates with custom filters and tags?
from liqp.
from liqp.
I'll try and see if there is a test for registering a new tag and using it as this seems not to be working for me. I'll make a test quickly.
from liqp.
Thanks for the commit!
from liqp.
Related Issues (20)
- XSS Protection HOT 1
- RenderSettings.defaultTimeZone is unused HOT 10
- Older Android version support is broken HOT 4
- Feature request: Custom date format
- All Filter and Tag registration via interface HOT 14
- Plus filter is wrong HOT 4
- How can I ignore the $ char HOT 1
- java.lang.RuntimeException: error on line 317, index 55: Unparseable date: "now"
- Parsing Datetime to date-month works fine but not with only Date HOT 4
- Dependencies using Liqp may affect template execution due to shared global state HOT 12
- Included template must be parsed/rendered with the same parse/rendering settins
- Future of @deprecated methods HOT 7
- How to convert to a JSON String HOT 4
- Upgrade ANTLR HOT 11
- Template errors not being stored when using liquid for loops HOT 2
- Support for Liquid's Layouts HOT 3
- Integer and Float Comparisons After Using Times Filter HOT 15
- How to modify default renderer HOT 1
- Shaded jar should exclude non-ANTLR dependencies HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from liqp.