Skip to content

docx comments on tracked-changes insertions not handled properly #9833

Closed
@steinbro

Description

@steinbro

When a Word comment applies to text that is an unaccepted track-changes insertion, that comment is not included in the pandoc output.

Here is a minimal example file, with two paragraphs, each with a single comment. One paragraph is normal text while the other paragraph is an insertion using track changes.

Converting to markdown (for example), only the comment from the first paragraph is preserved. Oddly, there are still two comment-end spans.

$ pandoc comments_test.docx -t markdown --track-changes=all

This is [This is a comment on normal text]{.comment-start id="1"
author="Daniel Steinbrook" date="2024-05-31T19:15:00Z"}some
[]{.comment-end id="1"} normal text[]{.paragraph-insertion
author="Daniel Steinbrook" date="2024-05-31T19:14:00Z"}

[This is some added]{.insertion author="Daniel Steinbrook"
date="2024-05-31T19:14:00Z"} [[]{.insertion author="Daniel Steinbrook"
date="2024-05-31T19:15:00Z"}]{.comment-end id="4"}[text]{.insertion
author="Daniel Steinbrook" date="2024-05-31T19:14:00Z"}

When going roundtrip from docx to json and back again, Word reports errors when opening the resulting docx.

$ pandoc -f json -t docx -o comments_test_roundtrip.docx <(pandoc comments_test.docx -t json --track-changes=all)

"Word found unreadable content in comments_test_roundtrip.docx. Do you want to recover the contents of this document? If you trust the source of this document, click Yes."

If you click Yes, the resulting document has two comments, but the second comment has no content or metadata.

Using pandoc 3.2 on macOS Sonoma 14.5.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions