solid
solid copied to clipboard
Possible to tell if a tag doesn't get a value?
Apologies for using the issue tracker for help.
I am wondering if you see any way to detect whether a tag results in no value? I have a use case where I want to display an error (or even the {{ name }}
text) if a value isn't available.
I attempted to look down the path of providing my own Solid.Context struct, but I don't think there is a place that I could hook in (even hacky) to detect an empty value.
I think that this is called "strict variables" and "strict filters" mode in Liquid: https://www.rubydoc.info/gems/liquid/4.0.1#undefined-variables-and-filters
The stateless nature of Elixir can make the error accumulator difficult. I'd personally be okay with a Process based error collector, although I know that's pretty hacky 😆
Strict variables has been implemented #105 . I've created an issue for strict filters: https://github.com/edgurgel/solid/issues/107