feat: 完成 DOCX 通用结构映射与严格收口

This commit is contained in:
SkyJourney
2026-07-31 15:19:34 +08:00
parent 6e40374200
commit f3847f3e4b
31 changed files with 3175 additions and 64 deletions
@@ -75,6 +75,14 @@ function input() {
keywords: [],
language: "zh-CN"
},
semanticDocument: {
schemaVersion: 1,
titlePolicy: {
metadataTitle: "suppress",
firstBodyHeading: "keep"
},
regions: []
},
media: emptyMedia
};
}
@@ -120,6 +128,20 @@ describe("Pandoc DOCX 转换器", () => {
expect(
options.env?.MD_TO_PDF_DOCX_MEDIA_MAP
).toContain("media-map.json");
expect(
options.env?.MD_TO_PDF_DOCX_STRUCTURE_PLAN
).toContain("structure-plan.json");
const structurePlan = JSON.parse(
await import("node:fs/promises").then(({ readFile }) =>
readFile(
options.env!.MD_TO_PDF_DOCX_STRUCTURE_PLAN!,
"utf8"
)
)
);
expect(structurePlan.titlePolicy.metadataTitle).toBe(
"suppress"
);
await copyFile(
argumentAfter(arguments_, "--reference-doc"),
argumentAfter(arguments_, "--output")