Skip to content

Regression introduced in af57648 produces invalid DOCX #10769

@rnwst

Description

@rnwst

Explain the problem.
Commit af57648 (which fixed #10759) introduced a bug that results in invalid rIds being assigned to headers and footers in /word/document.xml. When opening the resulting document, the following message is displayed:
Image
Choosing to recover the contents results in a document that does not include the headers and footers from the reference-doc.

Upon closer inspection of the XML files, it seems that the rIds that are defined in /word/_rels/document.xml.rels for the headers and footers do not correspond to the rIds used in the document.

Excerpt from /word/_rels/document.xml.rels:

  <Relationship Id="rId13" Target="footer2.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer" />
  <Relationship Id="rId12" Target="header2.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/header" />
  <Relationship Id="rId11" Target="footer1.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer" />
  <Relationship Id="rId10" Target="header1.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/header" />

Excerpt from /word/document.xml:

    <w:sectPr>
      <w:headerReference r:id="rId16" w:type="default" />
      <w:footerReference r:id="rId18" w:type="default" />
      <w:headerReference r:id="rId15" w:type="first" />
      <w:footerReference r:id="rId17" w:type="first" />

As can be seen, the rIds do not match. Manually editing the rIds in the broken document to match those defined in /word/_rels/document.xml.rels and zipping it back up as a DOCX fixes the problem.

Pandoc version?
Commit: af57648
OS: Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions