Giter VIP home page Giter VIP logo

Comments (7)

epage avatar epage commented on June 16, 2024

Are diverging start/end tags supported in ruby liquid? Is there precedence in it for it?

from liquid-rust.

Kneelawk avatar Kneelawk commented on June 16, 2024

Looking through the Liquid documentation, I cannot see any mechanism for registering a block not in the <name>-end<name> format. Blocks are registered with Liquid::Template.register_tag("<name>", <tag-class>) just like non-block tags. Perhaps it would make more sense to remove BlockReflection::end_tag() from the API?

My use-case for block tags not in the <name>-end<name> format are macro definition tags that can be either single-line (in which case the macro is defined as a filter-chain) or a block (in which case the macro is defined as the contents of the block). My original set of macro-definition tags had a tag called define that would define a single-line macro and ones called begindef and enddef for defining a block macro. I chose these names because it made it clear which tags were single-line and which were multi-line.

from liquid-rust.

epage avatar epage commented on June 16, 2024

The overall intention for end_tag was to open us up to simplifying the code like your PR did, we just never got around to doing it. Looking over it, I'm tempted to merge #453. My concern is whether we should enforce end<something> (and how) or not.

from liquid-rust.

Kneelawk avatar Kneelawk commented on June 16, 2024

One option is to have diverging start/end tags enabled by a feature flag. If the feature flag is enabled, then diverging start/end tags are supported like in #453. If the feature flag is disabled, then attempting to register a block plugin with diverging start/end tags causes a panic.

Otherwise, to me, it seems the clearest way to enforce end<something> block end tags is to just remove the end_tag method.

from liquid-rust.

epage avatar epage commented on June 16, 2024

Been thinking over this and looking over the Ruby code. Technically, someone can override the block_delimiter. There is no place they explicitly say how blocks end.

Think I'll go forward with this.

from liquid-rust.

epage avatar epage commented on June 16, 2024

As far as I could tell, there was no breaking change with this (since using anything else for these fields would have been broken).

I've released liquid-core with this change since I'm assuming thats all that is needed for this.

from liquid-rust.

Kneelawk avatar Kneelawk commented on June 16, 2024

Sounds good. Thank you.

from liquid-rust.

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.