From 1660e0787384ff5e21bf3ea774cd926a8c966d1b Mon Sep 17 00:00:00 2001 From: Steffen Becker Date: Fri, 28 Aug 2026 16:07:22 +0000 Subject: [PATCH] fix: no letter headings in the exported INDEX field MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The \h "A" switch made Word insert an alphabet heading between the index entries on field update — a row the editor's index never draws. --- src/lib/export/docx.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/export/docx.ts b/src/lib/export/docx.ts index a32ec41..5600bcf 100644 --- a/src/lib/export/docx.ts +++ b/src/lib/export/docx.ts @@ -2224,8 +2224,9 @@ function blocksToDocx(content: TiptapNode[], num: Numbering, contentWidthCm: num if (tocTitle) out.push(new Paragraph({ children: [new TextRun({ text: tocTitle, bold: true, size: 32 })], spacing: { after: cmToTwip(0.3) } })); if (kind === 'alphabetical') { // Word's INDEX field, which it fills from the XE entries on a field update — - // the same contract the TOC field above works under. - out.push(new Paragraph({ children: [new SimpleField('INDEX \\h "A" \\c "1" \\e "\t"')] })); + // the same contract the TOC field above works under. No \h: a letter heading + // between the entries is a row the editor's index never draws. + out.push(new Paragraph({ children: [new SimpleField('INDEX \\c "1" \\e "\t"')] })); continue; } if (kind === 'bibliography') {