Refactor docx_comments. Closes #541. #544
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR refactors docx_comments to (properly) account for comments spanning
multiple paragraphs, nested comments, multiple comments in the same paragraph and replies. Closes #541.
Adds a test document to check that docx_comments accounts for these "special" cases found in real-world documents.
The dataframe returned by
docx_comments()
gains a list columnpara_id
containingthe id(s) of the parent paragraph(s). A possible breaking change is that the
commented_text
is now returned as a list column to account for comments spanning multiple runs.
The docs gain a description of the columns of the returned dataframe.