feat: 完成 DOCX 通用结构映射与严格收口
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user