Skip to content

Deleted Element is handled incorrectly in the sample code for how-to-accept-all-revisions-in-a-word-processing-document.md #355

Description

@snnz

The description in the Deleted Element section is fine. But when this element (w:del) is simply removed from the document, instead of accepting the change, the exact opposite happens - it is rejected.

Suppose we have:

<w:p w14:paraId="2E6899F7" w14:textId="72053AB6" w:rsidR="002A5A2D" w:rsidDel="005D1F29" w:rsidRDefault="001E6ED1">
  <w:pPr>
    <w:rPr>
      <w:del w:id="0" w:author="snnz" w:date="2026-05-28T14:14:00Z" />
    </w:rPr>
  </w:pPr>
  <w:r>
    <w:t>Paragraph 1.</w:t>
  </w:r>
  <w:ins w:id="1" w:author="snnz" w:date="2026-05-28T14:14:00Z">
    <w:r w:rsidR="005D1F29">
      <w:t xml:space="preserve"> </w:t>
    </w:r>
  </w:ins>
</w:p>
<w:p w14:paraId="5188888E" w14:textId="7E01ACD4" w:rsidR="001E6ED1" w:rsidRDefault="001E6ED1" w:rsidP="005D1F29">
  <w:r>
    <w:t>Paragraph 2.</w:t>
  </w:r>
</w:p>

Word's Accept All Changes command results in:

<w:p w14:paraId="5188888E" w14:textId="7170ECC0" w:rsidR="001E6ED1" w:rsidRDefault="001E6ED1" w:rsidP="005D1F29">
  <w:r>
    <w:t>Paragraph 1.</w:t>
  </w:r>
  <w:r w:rsidR="005D1F29">
    <w:t xml:space="preserve"> </w:t>
  </w:r>
  <w:r>
    <w:t>Paragraph 2.</w:t>
  </w:r>
</w:p>

And the sample code produces the following:

<w:p w:rsidR="002A5A2D" w:rsidDel="005D1F29" w:rsidRDefault="001E6ED1" w14:paraId="2E6899F7" w14:textId="72053AB6">
  <w:pPr>
    <w:rPr />
  </w:pPr>
  <w:r>
    <w:t>Paragraph 1.</w:t>
  </w:r>
  <w:r xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" w:rsidR="005D1F29">
    <w:t xml:space="preserve"> </w:t>
  </w:r>
</w:p>
<w:p w:rsidR="001E6ED1" w:rsidP="005D1F29" w:rsidRDefault="001E6ED1" w14:paraId="5188888E" w14:textId="7E01ACD4">
  <w:r>
    <w:t>Paragraph 2.</w:t>
  </w:r>
</w:p>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions