docx-templates
Advanced tools
Changelog
4.5.4 (2021-03-05)
Changelog
4.5.3 (2020-12-18)
getMetadata
function from library index module / entrypoint.Changelog
4.5.0 (2020-09-16)
fixSmartQuotes
flag (see PR #152). Thanks @speedpro! MS Word usually autocorrects JS string literal quotes with unicode 'smart' quotes ('curly' quotes). E.g. 'aubergine' -> ‘aubergine’. This causes an error when evaluating commands containing these smart quotes, as they are not valid JavaScript. If you set fixSmartQuotes
to 'true', these smart quotes will automatically get replaced with straight quotes (') before command evaluation. Defaults to false.Changelog
4.4.0 (2020-08-19)
getMetadata
function to extract the metadata fields from a document, such as the number of pages or words (see issue #94).errorHandler
callback to handle any errors that may occur when executing commands from a template. The value returned by this callback will be inserted into the rendered document instead (see issue #138).CommandExecutionError
to make it contain the full Error original object that caused it to be thrown.Changelog
4.2.0 (2020-06-15)
true
, this setting ensures createReport
throws a NullishCommandResultError
when the result of an INS, HTML, IMAGE, or LINK command is null
or undefined
. This is useful as nullish return values usually indicate a mistake in the template or the invoking code. Defaults to false
.Changelog
4.1.1 (2020-06-06)