v7.0.0-alpha.1
Pre-release
Pre-release
Features
- New filters:
json_script,safeseq,escapeseq,dictsort,unordered_list,slugify,filesizeformat,timesince,timeuntil. - [Backwards-Incompatible] Improved
escapejsfilter to match Django behavior. - [Backwards-Incompatible] Improved
striptagsandremovetagsfilters with better security (recursive stripping, iteration limits). - [Backwards-Incompatible] Use proper ellipsis character (…) in
truncatechars,truncatechars_html, andurlizetruncfilters. - [Backwards-Incompatible] Empty
{% filter %}tag now returns a parse error (Django compatibility). - [Backwards-Incompatible] Empty
{% firstof %}tag now returns a parse error (Django compatibility). - Support for negative number literals in arguments.
- Support for escape sequences in string literals (
\n,\t, etc.). - Support for sorted and reversed iteration over strings.
- Inline variable definitions (
{% set foo = "bar" %}). - Expand
urlizefilter to support more TLDs.
Bug Fixes
- [Backwards-Incompatible] Fix
and/oroperators to return actual values instead of booleans (#362). - Fix panic in
cycletag with no arguments. - Fix integer overflow when converting
uint64toint. - Fix panic on uncomparable types in comparisons.
- Fix nil subscript panic.
- Fix
ifchangedtag to only evaluate else block if it exists. - Fix
inoperator type compatibility for maps. - Fix
Containsmethod to support all map key types (float64, bool, etc.). - Fix array parser panic introduced by subscript feature.
- Support virtual filesystems in
ssitag plaintext mode andError.RawLine(). - Prevent memory exhaustion by limiting
loremtag generation. - Prevent infinite loop in unclosed parameterized tag situations.
- Prevent stack overflow by limiting macro call depth.
- Prevent DoS via huge parameters in certain filters.
- Prevent panic from integer divide by zero.
- Fix string indexing to return character instead of byte (Django compatibility).
- Fix
NewSetto validate that loaders are not nil.
Performance
- Optimize lexer with keyword map and pre-compiled string replacer.
- Use pre-compiled
strings.Replacerfor HTML escaping filters. - Cache
getResolvedValue()result in Value methods. - Optimize context valid identifier check (#340).
- Speed optimizations for
joinfilter on long strings.
Deprecations
ifequalandifnotequaltags now emit deprecation warnings (use{% if %}instead).ssitag is deprecated.
Breaking Changes
- [Backwards-Incompatible] Remove
HttpFilesystemLoader. UseFSLoaderwithNewFSLoader()instead, which supports Go'sfs.FSinterface includingos.DirFS()andembed.FS. - [Backwards-Incompatible] Remove incomplete
SandboxedFilesystemLoader. For sandboxing, useBanTag()to restrictinclude/import/ssi/extendstags.
Other
- Go 1.25 is now the minimum required Go version.
- Added comprehensive fuzz testing infrastructure.
- Comprehensive documentation overhaul with new guides for getting started, template syntax, security, and custom extensions.
Thanks to all contributors.