mirror of
https://github.com/S2-/minifyfromhtml.git
synced 2025-08-03 20:30:04 +02:00
update packages to latest version
This commit is contained in:
23
node_modules/w3c-xmlserializer/lib/attributes.js
generated
vendored
23
node_modules/w3c-xmlserializer/lib/attributes.js
generated
vendored
@@ -5,7 +5,7 @@ const xnv = require("xml-name-validator");
|
||||
const { NAMESPACES } = require("./constants");
|
||||
|
||||
function generatePrefix(map, newNamespace, prefixIndex) {
|
||||
const generatedPrefix = "ns" + prefixIndex;
|
||||
const generatedPrefix = `ns${prefixIndex}`;
|
||||
map[newNamespace] = [generatedPrefix];
|
||||
return generatedPrefix;
|
||||
}
|
||||
@@ -27,13 +27,13 @@ function serializeAttributeValue(value/* , requireWellFormed*/) {
|
||||
}
|
||||
// TODO: Check well-formedness
|
||||
return value
|
||||
.replace(/&/g, "&")
|
||||
.replace(/"/g, """)
|
||||
.replace(/</g, "<")
|
||||
.replace(/>/g, ">")
|
||||
.replace(/\t/g, "	")
|
||||
.replace(/\n/g, "
")
|
||||
.replace(/\r/g, "
");
|
||||
.replace(/&/ug, "&")
|
||||
.replace(/"/ug, """)
|
||||
.replace(/</ug, "<")
|
||||
.replace(/>/ug, ">")
|
||||
.replace(/\t/ug, "	")
|
||||
.replace(/\n/ug, "
")
|
||||
.replace(/\r/ug, "
");
|
||||
}
|
||||
|
||||
function serializeAttributes(
|
||||
@@ -104,7 +104,7 @@ function serializeAttributes(
|
||||
|
||||
result += " ";
|
||||
if (candidatePrefix !== null) {
|
||||
result += candidatePrefix + ":";
|
||||
result += `${candidatePrefix}:`;
|
||||
}
|
||||
if (
|
||||
requireWellFormed &&
|
||||
@@ -114,10 +114,7 @@ function serializeAttributes(
|
||||
) {
|
||||
throw new Error("Invalid attribute localName value");
|
||||
}
|
||||
result += `${attr.localName}="${serializeAttributeValue(
|
||||
attr.value,
|
||||
requireWellFormed
|
||||
)}"`;
|
||||
result += `${attr.localName}="${serializeAttributeValue(attr.value, requireWellFormed)}"`;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
Reference in New Issue
Block a user