Giter Club home page Giter Club logo

Comments (7)

msangel avatar msangel commented on June 24, 2024

code to reproduce?

from liqp.

jvanzyl avatar jvanzyl commented on June 24, 2024

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.

jvanzyl avatar jvanzyl commented on June 24, 2024

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.

jvanzyl avatar jvanzyl commented on June 24, 2024

@msangel What's the recommend way to create templates with custom filters and tags?

from liqp.

msangel avatar msangel commented on June 24, 2024

from liqp.

jvanzyl avatar jvanzyl commented on June 24, 2024

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.

msangel avatar msangel commented on June 24, 2024

Thanks for the commit!

from liqp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.