Skip to content

v5.0.0

Latest
Compare
Choose a tag to compare
@noppa noppa released this 20 Jun 00:29

Officially supported Node.js version is raised from 12 to 16, which is a breaking change.

Upgrades libxml2 to v2.13.8, which slightly changes some of the error messages.

Optimizes the XML file input reading, by switching from Emscripten FS.createDataFile to
FS.writeFile.
I'm not 100% certain if this is actually a breaking change or not,
but this could possibly be a breaking change if you previously passed in
file contents that were strings, but not from an utf-8 encoded file. Try
passing the non-utf8 encoded data as a Buffer instead, which we now also explicitly support
in options.xml[i].contents.

Optimizes the output reading, by switching from Emscripten Module.stdout API (which apparently
pushed one byte of output at a time to an array), to the print API, which pushes more reasonably
sized chunks of strings to the output string.
This fixes a crash #20 "Invalid array length on "large xml" file",
that occurred on very large outputs.
In some cases, the old output handling resulted in output not having a last line break at the end of
output. In the new output, the last line break is always included. This could break some tests
where you expect some exact output that didn't previously have said line break in the end.

We now validate that XML and Schema file names do not start with a dash (-), or contain
a space and a dash ( -), which would cause xmllint to interpret the file name
as a command line option. File names could be user-inputted, so this change is to
prevent end users from accidentally or maliciously changing the expected behaviour of
the validation. It is recommended, though, to also do stricter validation of file names
if you accept them from user input.
This is a breaking change if you previously passed in file names that started with a dash.
There is a new option disableFileNameValidation to disable this validation if you want
to keep the old behaviour and accept any kind of file name.

Adds new optional option modifyArguments, which allows you to arbitrarily add
or modify the command line arguments that are passed to the xmllint command. The
option is a function that receives the current arguments as an array, and should
return a new array of string arguments.
Closes #22.