fix(artifacts): apply XML end-of-line handling to nuspec and POM text (#11846)

The .nuspec, its OPC relationships and the Maven POM now parse with
lineEndings normalize, as XML 1.0 section 2.11 and the NuGet and Maven
readers do. Text from CRLF files no longer keeps carriage returns.
This commit is contained in:
RRFZ authored and GitHub committed 2026-11-18 21:48:57 +08:00
1 parent da5ff5e7a7
commit 372e6e2fa0
6 files changed
+42 -5

No files matched your search

+3 -1
View File
@@ -272,9 +272,11 @@ const parsePom = (
MAVEN_GRADLE_METADATA_XML_NODES,
nodes,
);
// Maven's XML reader applies XML 1.0 end-of-line handling, so a POM saved
// with CRLF yields the same property and coordinate text as one with LF.
const parsed = parseXmlDocument(xml, {
doctype: "reject",
lineEndings: "preserve",
lineEndings: "normalize",
});
if (!parsed.ok)
throw parsed.error.kind === "unsupported"