- BREAKING - Add support for nesting tags, loops and other conditions inside simple conditions (fixes #49). This requires changing the way some values are look up in the input data. Please see the readme file for details (https://github.com/alonrbar/easy-template-x#nested-conditions).
- Add skipEmptyTag option (#45).
- Support for simple conditions (docs).
- Support for custom data resolvers - enables advanced syntax support (docs).
- BREAKING - Container closing tag name is ignored and no longer throws when the closing tag has different name than the opening one (docs).
- Update dependencies (jszip, xmldom).
Stable release - from now on breaking changes to the public API (the public
interface of TemplateHandler
) will introduce a new major release.
- Initial content types parsing.
- Bug in paragraph loops (#36).
- Headers and footers support.
- Consistent handling of
RawXmlContent
when thexml
prop is null.
- Support for
RawXmlContent.replaceParagraph
.
- Expose "Community Extensions" on npm (readme changes).
- Parsing of tags with custom delimiters.
- Parsing of tags with custom delimiters.
- Export extensions types.
- Expose
Docx.rawZipFile
property.
- Extensions API (#24).
- Allow overriding container tag logic using explicit content type.
ScopeData.getScopeData
is now generic (#17).- The
data
argument ofTemplateHandler.process
is now strongly typed. - Bundle with Rollup instead of Webpack.
- Auto generate typings.
- Fix typings.
- BREAKING: Delimiters can not contain leading or trailing whitespace.
- Loosen up
TemplateHandlerOptions
typings.
- Loop tag names trimming.
- Custom loop delimiters support.
- Zip export and typings.
- Link to live demo on CodeSandbox.
- Re-fix "Binary type 'Buffer' is not supported" on Node.
- Link plugin in cases where the link tag is not the only node in it's run.
- Link plugin.
TemplateHandler.version
property.
This version removes the notion of a "tag type" and uses instead the notion of "content type". Instead of inferring the type from the tag prefix the type is now explicitly declared in the supplied JSON data.
Example:
Before:
tag: "{@newPage}"
data: {
newPage: "<w:br w:type="page"/>"
}
After:
tag: "{newPage}"
data: {
newPage: {
_type: "rawXml",
xml: "<w:br w:type="page"/>"
}
}
The only exceptions are the "loop" content type which still uses the "#" opening prefix and "/" closing prefix, and the "text" content type which is the default and does not requires explicitly stating it.
- Image plugin.
- Support multi-character delimiters.
- Template plugins can be async.
- Improved the docs (readme).
- BREAKING:
RawXmlPlugin
requires data of the form{ _type: 'rawXml', xml: string }
.
- BREAKING: Remove the
Tag.type
property.
- Parsing error in some cases where multiple tags are declared in the same run.
- "Binary type 'Buffer' is not supported." on Node 12.
- Handle non-textual values (numbers, booleans...) in TextPlugin.
- Loop over lists and table rows.
Notice: The loop logic for tables is a bit different than the logic of the existing paragraph loop. Instead of repeating the content in between the opening and closing tags it repeats entire rows (including content in the row that appears before the opening or after the closing tag). The same goes for lists - the entire bullet is repeated. - Throw MalformedFileError when fails to open template file as zip.
- Continuous integration with CircleCI.
- Change dev stack to Babel, Jest and ESLint.
- Easily find out what tags are present in a given template (TemplateHandler.parseTags).
- Full browser example in readme file.
- Package keywords for npm visibility.
- Fix serialization of text nodes with empty values.
- Add readme badges
- Preserve leading and trailing whitespace
- More info on missing delimiter errors
- Various bug fixes
- Typings file
- First version
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
- Added for new features.
- Changed for changes in existing functionality.
- Deprecated for soon-to-be removed features.
- Removed for now removed features.
- Fixed for any bug fixes.
- Security in case of vulnerabilities.