Repository navigation
fix(array_to_sentence_string): coerce non-array input with toArray, fixes #964 - #968
Conversation
array_to_sentence_string read `.length` and `.slice` on its input directly, so a nil value, a number or a string of three or more characters threw a RenderError and failed the whole render, and a one- or two-character string was split into characters. It now coerces its input with `toArray`, as the other array filters do: nil renders an empty string and a non-array value is treated as a single item. Fixes harttle#964 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
This filter comes from Jekyll and I find Jekyll also throws for these cases thus it should be left that way. Unless you find otherwise, I'm closing this one. |
|
Thanks for checking. Jekyll's version just calls
Of the 24 Jekyll filters LiquidJS ports, |
|
Makes sense. Will handle the |
## [10.30.1](v10.30.0...v10.30.1) (2026-10-28) ### Bug Fixes * apply outputEscape to {% echo %} ([46ab5d8](46ab5d8)) * **array_to_sentence_string:** coerce non-array input with toArray ([#968](#968)) ([e843466](e843466)), closes [#964](#964) * **base64_decode:** throw on invalid input in every build ([#971](#971)) ([83bbfe0](83bbfe0)), closes [#965](#965) * **date_to_rfc822:** use English day and month names ([#974](#974)) ([e94a1c4](e94a1c4)), closes [#973](#973) * **filters:** round must not alter large or high-precision numbers ([#980](#980)) ([ea22af4](ea22af4)), closes [hi#precision](https://github.com/hi/issues/precision) * **filters:** truncate and slice must not split surrogate pairs ([#981](#981)) ([57016eb](57016eb)), closes [String#length](https://github.com/String/issues/length) [String#slice](https://github.com/String/issues/slice) * pad %Y to 4 digits like Ruby ([#978](#978)) ([95a2eed](95a2eed)) * **security:** apply outputEscape to {% cycle %} ([#984](#984)) ([2e1ebe0](2e1ebe0))
|
🎉 This PR is included in version 10.30.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
array_to_sentence_stringreads.lengthand.sliceon its input directly (src/filters/string.ts:226), so anything that isn't an array fails the whole render.{{ v | array_to_sentence_string }}:v55"abc"abc"ab"a and bab["a", "b", "c"]a, b, and cThis coerces the input with
toArray, as the other array filters do, so nil renders an empty string and a non-array value is treated as a single item. Array input is unchanged.The two new tests in
test/integration/filters/string.spec.tsfail on master and pass here.npm run build,npm test(1674 tests) andnpm run lintpass on Node 24.11.1.Fixes #964
Written with AI assistance (Claude Code); I have reviewed the change.