github mitsuhiko/minijinja 3.0.5

3 hours ago

Release Notes

  • Fixed a panic or abort in Rust when buffering an iterator that reports a huge size hint, or when passing a huge count to the batch or slice filters. Filters like list, sort, reverse, map, slice and batch as well as slicing and concatenating sequences now cap how much they preallocate, so [1, 2]|batch(4611686018427387904) is [[1, 2]] instead of failing with "capacity overflow". #483
  • Fixed floats in Go switching to exponent notation from one million up, so 1234567.5 printed as 1.2345675e+06. Like in Rust, a float now prints as its shortest exact decimal without an exponent, so 1234567.5 is 1234567.5 and 1e20 is 100000000000000000000.0. Inside lists and maps, exponent notation is only used below 1e-4 and from 1e16 up, written like 1e20 and 1e-5. NaN now prints as NaN, and infinity inside a list as inf instead of +Inf. #984
  • Fixed %s in the format filter formatting floats with %g rules, so "%s"|format(1234567.5) was 1.23457e+06. Like in Python, floats are now formatted like str() does: 1234567.5, 1e+16, 1e-05 or nan. The 0, + and space flags are ignored for floats and strings with %s, like in Python. This applies to both Rust and Go. #984
  • Fixed the tojson filter in Go writing floats like integers. Like in Rust, a float stays a float in the output, so 1.0|tojson is 1.0 instead of 1, large and small magnitudes use exponent notation (1.5e+16, 2.5e-7) and infinity becomes null instead of an error. The same applies to values rendered with JSON auto-escaping. #983
  • Fixed the upper, lower, capitalize, title and replace filters in Go ignoring values that are not strings. Like in Rust, the value and the replace arguments are converted to strings first, so 1.5|replace(".", ",") is 1,5 and true|upper is TRUE, and a number passed to replace is no longer treated as an empty string. #985
  • Fixed slicing and the in operator on iterables such as range() in Go. Like in Rust, range(5)[:2] is now [0, 1] instead of failing with "cannot slice iterator", and 3 in range(5) is true instead of false. Slicing none or undefined gives an empty list like in Rust. Iterables now also print, compare, serialize with tojson and pprint like lists, so range(2) == [0, 1] is true and [range(2)] prints as [[0, 1]] instead of [<iterator>]. The in operator now also works on custom sequence, iterable and map objects. #986
  • Fixed none in Go not being treated as an empty sequence by the sort, unique, select, reject, map, groupby, join and urlencode filters and the iterable test. Like in Rust, none|sort is now [] and none|join is an empty string instead of None. #987
  • Fixed the odd, even and divisibleby tests in Go ignoring booleans, and divisibleby ignoring a float divisor. Like in Rust, booleans count as 0 and 1, so true is odd is true, and 6.5 is divisibleby(0.5) is true. #988
  • Fixed str.format in pycompat cutting floats to six significant digits when no precision is given. Like in Python, such floats are now formatted like str() does, so '{}'.format(3.14159265) is 3.14159265, '{}'.format(1234567.0) is 1234567.0 instead of 1.23457e+06 and '{}'.format(0.0) is 0.0 instead of 0. #991
  • Fixed the trim filter in Go ignoring values that are not strings and only stripping ASCII spaces, tabs and newlines by default. Like in Rust, 5|trim|length is now 1, and Unicode whitespace such as a non-breaking space is stripped. #989
  • Fixed undefined values not being treated as empty sequences by the sort, unique, select, reject, selectattr, rejectattr, map, batch and groupby filters in Go, and none by batch, selectattr and rejectattr. Like in Rust, undefined|sort is now [] with lenient undefined behavior, while strict and semi-strict undefined behavior still fail except for join and groupby. #990
  • Fixed a panic in compile_expression when the expression contains }} followed by more input, such as }} x. This is now a syntax error, like the same text inside a template. #992

Install minijinja-cli 3.0.5

Install prebuilt binaries via shell script

curl --proto '=https' --tlsv1.2 -LsSf https://github.com/mitsuhiko/minijinja/releases/download/3.0.5/minijinja-cli-installer.sh | sh

Install prebuilt binaries via powershell script

powershell -ExecutionPolicy Bypass -c "irm https://github.com/mitsuhiko/minijinja/releases/download/3.0.5/minijinja-cli-installer.ps1 | iex"

Download minijinja-cli 3.0.5

File Platform Checksum
minijinja-cli-aarch64-apple-darwin.tar.xz Apple Silicon macOS checksum
minijinja-cli-x86_64-apple-darwin.tar.xz Intel macOS checksum
minijinja-cli-aarch64-pc-windows-msvc.zip ARM64 Windows checksum
minijinja-cli-i686-pc-windows-msvc.zip x86 Windows checksum
minijinja-cli-x86_64-pc-windows-msvc.zip x64 Windows checksum
minijinja-cli-aarch64-unknown-linux-gnu.tar.xz ARM64 Linux checksum
minijinja-cli-i686-unknown-linux-gnu.tar.xz x86 Linux checksum
minijinja-cli-x86_64-unknown-linux-gnu.tar.xz x64 Linux checksum
minijinja-cli-armv7-unknown-linux-gnueabihf.tar.xz ARMv7 Linux checksum
minijinja-cli-aarch64-unknown-linux-musl.tar.xz ARM64 MUSL Linux checksum
minijinja-cli-i686-unknown-linux-musl.tar.xz x86 MUSL Linux checksum
minijinja-cli-x86_64-unknown-linux-musl.tar.xz x64 MUSL Linux checksum

Don't miss a new minijinja release

NewReleases is sending notifications on new releases.