decaporg / decap-cms

A Git-based CMS for Static Site Generators
https://decapcms.org
MIT License
17.65k stars 1 forks source link

Only date('format') filter in Summary String Transformations work. All others are broken. #7221

Open mimecine opened 1 month ago

mimecine commented 1 month ago

Describe the bug

The only filter that seems to work in the summary is the date one. All others are inert.

To Reproduce summary = "{{ title | upper }} / {{ title | lower }} / {{ title | truncate(3) }} / {{ nonexistant | default('Hello') }} / {{mytruth | ternary('Yep','Nope') }} / {{today | date('yyyy') }}" yields Title / Title / Title / / / 2024 Booleans don't display at all whether true or false (might be expected tho)

Expected behavior TITLE / title / Tit / Hello / Yep / 2024

Applicable Versions:

Additional context Booleans don't display at all whether true or false (might be expected tho)

mimecine commented 1 month ago

With further investigation, I realize that it's a matter of spaces, but only if it's written like {{var | filter}} not as {{var | filter }} <- note the space at the end.

The ternary filter is sensitive about spacing before an argument.

Chaining filters doesn't work.