bridgetownrb / bridgetown

A next-generation progressive site generator & fullstack framework, powered by Ruby
https://www.bridgetownrb.com
MIT License
1.13k stars 114 forks source link

Unknown liquid filter fails silently #259

Closed Dahie closed 3 years ago

Dahie commented 3 years ago

So I'm playing around writing a small plugin around a liquid_filter. I'm now testing the gem in my project and found that the new liquid_filter is not found and that calling the unknown liquid_filter does not throw any errors.

Bridgetown Version:

bridgetown 0.20.0 "Healy Heights"

To Reproduce

1) create a new site 2) add {{ "string" | unknown_liquid_filter}} to index.md 3) run bridgetown serve 4) visiting the site shows it prints "string" without logging an error for the unknown liquid filter

Current behavior

Applying an unknown liquid_filter does nothing, neither logging a warning, error or anything.

Expected behavior

I'd have expected it either throws an error and holds the liquid generator. Alternative it should at least provide a warning in the log.

Computing environment (please complete the following information):

jaredcwhite commented 3 years ago

That's the default behavior, unknown filters are ignored. You can change that by setting the config key:

liquid:
  strict_filters: true
Dahie commented 3 years ago

Ah, I missed that! Thank you!