Releases: ActiveCampaign/mustachio
Support for unsigned integral data type variables
Releasing Token Expanders
Breaking Changes
InferredTemplateModel.ToString()
override has been removed. Previously, you could have used it to get the string JSON representation of the inferred model. This was done in order to remove our dependency on serializing it withNewtonsoft.Json
. You can now get the un-serialized JSON object using the new method:model.GetModelRepresentation()
.- [Deprecated]: Parse methods taking as argument a
bool disableContentEscaping
have been marked as obsolete, in favor of new methods using aParsingOptions
object.
New Features
This release adds the ability to extend the functionality of Mustachio with new tag types via TokenExpanders, allowing users to add support for partials and custom functionality such as date formatters, localization, etc.
Improvements
- The library has been migrated to use .NetStandard2.0.
Other Changes
- AppVeyor was replaced with Travis CI.
Content Safety Improvements
In some cases, the built in "Content Safety" support that escapes raw values to HTML is not necessary.
This release adds a Parse()
method overload that will allow {{{ . }}}
and {{ . }}
to behave the same way, and just output the raw model value. This improvement is necessary for some uses cases where having different behavior for those two constructs is confusing.
Corrected handling of "falsey" values.
With Mustachio, we tried to follow the specification of Mustache.js as closely as possible.
This included "flow control" through the existence or absence of "falsey" values (as defined by JS) -- null
, false
, 0
as well as empty arrays ([]
).
However, we made a mistake in our understanding of how Mustache is defined. Mustache uses falsey values to control the flow of the template, but also, will print those values if they are included in a template. For example, this Mustache template:
{{ a_false_value }}
Would result in the string:
"false"
Mustachio had a bug where falsey values would not be printed, so the above template would result in an empty string instead of "false"
.
This release resolves this issue, so that Mustachio behaves the same way as Mustache when printing falsey values.
Minor fix scope error messages.
1.0.6 Adding test for inverted group variable handling.
Initial Release
Dead-simple templating based on mustache, but with a little more flavor.