From 97ac36b3a13ce62369840b5eb7c25b2a2e245ee8 Mon Sep 17 00:00:00 2001 From: productdevbook Date: Thu, 13 Aug 2026 18:28:04 +0200 Subject: [PATCH] fix(ods): the generator is hucre, not the name the project used to have MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Every ODS hucre writes has been stamping defter — the project's former name — since the ODS writer was written. The XLSX writer has said `hucre` in `docProps/app.xml`'s `` all along, so the two disagreed about what produced the file. ODF §4.3.2.1 has `meta:generator` name the producing application. A consumer that keys off it (LibreOffice records it, and support threads routinely ask for it) was being told about software that does not exist. The test that pinned the old string pinned it by name — "writes Application: defter" — which is how it survived the rename. Co-Authored-By: Claude Opus 5 (1M context) --- src/ods/writer.ts | 5 ++++- test/ods.test.ts | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ods/writer.ts b/src/ods/writer.ts index e1f74c3..6c2d86c 100644 --- a/src/ods/writer.ts +++ b/src/ods/writer.ts @@ -1396,7 +1396,10 @@ export function writeMetaXml(props?: WorkbookProperties): string { const modified = props?.modified ?? new Date() children.push(xmlElement("dc:date", undefined, formatOdsDate(modified))) - children.push(xmlElement("meta:generator", undefined, "defter")) + // The producing application, per ODF §4.3.2.1. The same name the XLSX + // writer puts in `` — this said `defter`, the project's + // former name, for as long as the ODS writer has existed. + children.push(xmlElement("meta:generator", undefined, "hucre")) const metaContent = xmlElement("office:meta", undefined, children) diff --git a/test/ods.test.ts b/test/ods.test.ts index c60f797..9e0ae16 100644 --- a/test/ods.test.ts +++ b/test/ods.test.ts @@ -272,7 +272,7 @@ describe("ODS Writer", () => { expect(cells[1].attrs["office:value-type"]).toBeUndefined() }) - it("writes Application: defter in meta.xml", async () => { + it("names itself as the generator in meta.xml", async () => { const data = await writeOds({ sheets: [{ name: "Sheet1", rows: [["test"]] }], }) @@ -280,7 +280,7 @@ describe("ODS Writer", () => { const metaDoc = await parseXmlFromZip(data, "meta.xml") const metaEl = findChild(metaDoc, "meta") const generator = findChild(metaEl, "generator") - expect(getElementText(generator)).toBe("defter") + expect(getElementText(generator)).toBe("hucre") }) it("writes document properties in meta.xml", async () => {