OfficeDev / OfficeDev/open-xml-docs

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

Open Beginner friendly
#355 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PowerShell
Stars
110
Forks
73
Avg merge
3d 17h
Merged PRs (30d)
1

Description

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>

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open how-to-accept-all-revisions-in-a-word-processing-document.md and inspect the Deleted Element section and its sample code. Compare the sample's handling of w:del with the Word Accept All Changes result shown in the issue. Done means the description and sample produce the documented accepted-revision structure rather than rejecting the deletion.

Written by the indexing model from the issue text.

Assessment

Tech stack
xml
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.