chrisrueger commented on PR #111:
URL: https://github.com/apache/freemarker/pull/111#issuecomment-2252659483
> normalizes blank strings to `null`. After that, all the long existing
missing value operators are applicable
Are you referring to this, that
`${nonExisting?is_blank}`
errors in
`The following has evaluated to null or missing: ==> nonExisting [in
template "name" at line 1, column 3] ---- FTL stack trace ("~" means
nesting-related): - Failed at: ${nonExisting?is_blank}`
That is indeed something I haven't considered in my PR.
`${nonExisting!?is_blank}` works because of the `!`
But could you elaborate a bit more on what you have in mind? An example
maybe?
> As of `s?is_empty`, check `s?has_content`. Maybe there's an overlap.
Ah you are right. I have forgotten about `?has_content`.
As I am writing this:
I noticed that `?has_content` handles `null` already and does not fail.
e.g. `${nonExisting?hasContent?c}` prints `false`.
Should I maybe implement `?is_blank` similar to `?has_content` ?
Or are you generally against `?is_blank`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]