修正预印红头留白并严格校验参数

This commit is contained in:
mizzlelover
2026-09-11 08:30:00 +08:00
parent 4bf5d00346
commit 6b9d19698f
35 changed files with 41 additions and 3 deletions
+3
View File
@@ -170,6 +170,9 @@ if (profile === "formal") {
const titleXmlStart = firstTitleIndex < 0 ? doc.length : doc.indexOf(preprintedParagraphs[firstTitleIndex]);
const preprintedHeaderXml = titleXmlStart < 0 ? doc : doc.slice(0, titleXmlStart);
check("No red drawing for preprinted letterhead", !/w:color w:val="FF0000"/.test(preprintedHeaderXml), "preprinted mode does not redraw red letterhead or rule");
const preprintedDocNoIndex = preprintedParagraphs.findIndex((p) => /\d{4}[1-9]\d*/.test(textOf(p)));
const preprintedDocNoGap = preprintedDocNoIndex >= 0 ? preprintedParagraphs.slice(0, preprintedDocNoIndex).slice(-2) : [];
check("Preprinted agency-to-document number two blank lines", preprintedDocNoIndex < 0 || (preprintedDocNoGap.length === 2 && preprintedDocNoGap.every(isExplicitBlankGridLine)), "document number starts below the reserved physical agency mark block");
check("Title spacing below physical red rule", hasExplicitTwoLineTitleGap, "title is preceded by two exact 28-point blank paragraphs below the printed red rule");
}
}