Use libxmljs2 instead of libxmljs (#189)

This commit is contained in:
Simon Lecoq authored and GitHub committed 2021-03-17 18:46:35 +01:00
1 parent 3e3090b0c7
commit b17eba9675
4 files changed
+177 -162

No files matched your search

+2 -1
View File
@@ -92,10 +92,11 @@
//Verify svg
if (verify) {
console.debug(`metrics/compute/${login} > verify SVG`)
const libxmljs = (await import("libxmljs")).default
const libxmljs = (await import("libxmljs2")).default
const parsed = libxmljs.parseXml(rendered)
if (parsed.errors.length)
throw new Error(`Malformed SVG : \n${parsed.errors.join("\n")}`)
console.debug(`metrics/compute/${login} > verified SVG, no parsing errors found`)
}
//Resizing
const {resized, mime} = await imports.svg.resize(rendered, {paddings:q["config.padding"] || conf.settings.padding, convert})