Trigger “default” filter when value would result in empty output after ToStringValue() - #778
Conversation
…lt in empty output after `ToStringValue()`
|
I am wondering if the issue is that the If you want to provide a custom "empty/blank" behavior to your objects you should create a custom I am not decided on the solution, will check how the Object.ToStringValue() should behave first. |
|
Thanks for having a look :) C# also outputs the fully qualified type name (or for records just the name and the properties), unless I feel like the target audience for a template is end users who wouldn’t expect or want such internals to surface, so I try to make everything output something sensible. But I understand if you want to keep the current behaviour for compatibility with the original implementations. |
I have some model items that go like this, so they result in their value when they’re tagged without specifying a property:
This is to make template authors' lives easier and templates easier to read.
In this configuration the default filter will see that the object is present and not display the default value, even though the object will later be rendered as an empty string.
This PR adds a check for the object's actual string value, so the default filter will do its thing.
Cheers :)