-
-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When the alt value passed to default
is a lookup that isn’t found, the filter returns the text of the lookup
#227
Comments
Unfortunately, this is a bit of an edge case because the current behavior is designed to allow (defn lookup-args
"Given a context map, return a function that accepts a filter
argument and if it begins with @, return the value from the
context map instead of treating it as a literal."
[context-map]
(fn [^String arg]
(if (and (> (count arg) 1) (.startsWith arg "@"))
(let [accessor (parse-accessor (subs arg 1))]
(get-in context-map accessor arg))
arg))) The |
@aviflax Why the need to dereference (Asking because I'm genuinely curious, and learning Clojure.) Wouldn't
function as you're expecting? |
Reproduction:
In the templates I’m writing, I had expected the filter to return either nil or a blank string.
@yogthos I’m not sure if we should consider this a bug or a feature request, but either way, what do you think?
The text was updated successfully, but these errors were encountered: