yogthos/Selmer

Missing filter custom handling

Open

#307 opened on 2024年1月23日

GitHub で見る
 (1 comment) (0 reactions) (0 assignees)Clojure (670 stars) (86 forks)batch import
enhancementhelp wanted

説明

Hello,

I was wondering if you'd ever consider adding support for overriding the behavior when a non-existent filter is used in the template string.

Currently if the filter is not found an exception is thrown (relevant code). Our company would like the ability to override this behavior.

Current: (render "{{a | nonExistentFilter}}" {:a 1}) => Throws Exception: No filter defined with the name nonExistentFilter

Desired (for my use case): (render "{{a | nonExistentFilter}}" {:a 1}) => "{{a | nonExistentFilter}}" no thrown exceptions.

I was thinking this would be similar to the work done in #130 where we'd allow users to override a var that would default to the existing behavior.

I'd be open to submitting a PR for this and have a proof of concept of the functionality.

Thanks!

コントリビューターガイド

Missing filter custom handling · yogthos/Selmer#307 | Good First Issue