Changelog¶
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.3.0 - 2024-10-12¶
Added¶
keep_linesparameter to disable Mustache tag-only-line collapsing.strictparameter to disable non-standardmustache.jscompatibility workarounds.SectionException,UnclosedSectionException,UnopenedSectionExceptionexceptions.Support for variable-style lambdas (
{{lambda}}).Support for Mustache-style single-argument lambdas (
lambda content: '{{var}}'), passlambda_render=Noneto enable.Support for PEP-561 typing.
Fixed¶
Fix
Nonevariables being printed in the template.Fix delimiter changes (
{{= start end =}}) propagating to partials.Fix support multispaced delimiters (
{{= start end =}}).Fix Mustache whitespace handling (pass
keep_lines=Trueto disable).Fix partial (
{{>partial}}) indentation (passkeep_lines=Trueto disable).Invalid extra delimiters (
{{= start end ignored =}}) handled likemustache.js(passstrict=Trueto raiseDelimiterTokenExceptioninstead).
Changed¶
Breaking:
tokenizewill now remove tag-only lines following the specification,keep_linesoption added for whitespace-sensitive use-cases.Breaking: leaving a section unclosed now raises
UnclosedSectionExceptioninstead ofUnclosedTokenException.Closing an unknown section now raises
UnopenedSectionException.getterargument (render,stream), additionally to currentPropertyGetter, will now supportPropertyGetterTuple, a tuple of twoPropertyGetterfunctions specific for compat and strict modes.getterargument (render,stream) now defaults todefault_getter_tupleinstead ofdefault_getter.default_getterscope argument now expects a sequence instead of an iterable.UnopenedTokenExceptionraised instead of itsClosingTokenExceptionbase class.PartialResolverinterface now allows returningNone.default_resolvernow returnsNoneinstead of empty bytes.CacheMakeKeyFunctionargumenttuplecontains two extraboolitems.
0.2.0 - 2024-05-21¶
Added¶
cache_make_keyparameter enabling cache key customization.
Fixed¶
Fix custom stringify lost on lambdas and partials.
Fix custom getter lost on lambdas and partials.
Fix
±NaNbehaving as truthy (#2).Address constant mypy breaking changes.
Changed¶
Raised minimum python version to
3.10.0.Breaking:
__bool__is now honored except for mappings and±NaN.Breaking: objects implementing
__float__can be considered±NaN.Breaking: internal
TokenException.messagerenamed toTokenException._fmt.Breaking: tokenizer is no longer a generator function, returns a tuple now.
Breaking: non-string attributes hacked onto
__dict__are now unreachable.Drop optional
xxhashdependency,cache_make_keyshould be used instead.Project rename.
Optimizations.
0.1.5 - 2021-12-17¶
Added¶
Changelog.
Changed¶
Migrate tokenizer to an indexed balanced decision tree.
Migrate renderer to a balanced decision tree.
Other minor optimizations.
Fixed¶
Fix
tokenizerraisingIndexErrorwith truncated tokens.
0.1.4 - 2021-04-13¶
Fixed¶
Fix longstanding issue with unclosed tags hanging the tokenizer.
0.1.3 - 2021-04-11¶
Added¶
bytestemplates now support byte-keyed scope items and virtuals.default_getternow supports custom virtual properties.Optional
xxhashsupport to minimize template cache memory footprint.
Fixed¶
Fix argument forwarding.
Fix incorrect behavior with nested undefined properties.
Fix default parameter values not being public.
0.1.2 - 2021-01-29¶
Fixed¶
Fix tokenizer raising
IndexErrorwhen trying to close the top level scope.
0.1.1 - 2021-01-11¶
Fixed¶
Fix handling of whitespaced tokens.
0.1.0 - 2021-01-01¶
Added¶
Initial release.