You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Imports without word/commentsExtended.xml get a range-basedcommentThreadingProfile. We passed that straight back into updateCommentsExtendedXml(), which returns null for range-based profiles, so our export dropped commentsExtended.xml entirely.
Re-importing that DOCX makes importCommentData() fall back to detectThreadingFromNestedRanges(). In tables the ranges are naturally nested, so we stitched independent comments into one thread.
Proposed solution
Force commentsExtended.xml generation for any non–Google Docs export (pass 'word' to updateCommentsExtendedXml() when exportStrategy !== 'google-docs'), so we always stamp explicit w15:commentEx entries.
Add a regression test that exports a range-based profile, asserts the file exists, and verifies re-import keeps overlapping table comments separate.
(Optional) Cover detectThreadingFromRanges() with a unit test to ensure it skips when commentsExtended.xml is present.
The PR changes themselves are logic-only (the forceWordThreadingProfile override and the effectiveThreadingProfile computation) and don't introduce any new OOXML elements or attributes. No spec violations in the diff itself.
However, the changed file (commentsExporter.js) has a pre-existing attribute issue that's worth flagging since it's in scope:
w:email on w:comment — non-existent attribute
Per ECMA-376 §17.13.4.2, w:comment defines exactly four attributes: w:id (required), w:author, w:date, and w:initials. There is no w:email attribute in the schema. The attribute is written into the output XML at line 135 of updateCommentsXml and will be present in every exported word/comments.xml. Word will silently ignore it, but it makes the file non-conformant.
File: commentsExporter.js:39 (set on the definition object) / commentsExporter.js:135 (preserved in the rebuilt attributes)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Issue
word/commentsExtended.xmlget arange-basedcommentThreadingProfile. We passed that straight back intoupdateCommentsExtendedXml(), which returnsnullfor range-based profiles, so our export droppedcommentsExtended.xmlentirely.importCommentData()fall back todetectThreadingFromNestedRanges(). In tables the ranges are naturally nested, so we stitched independent comments into one thread.Proposed solution
commentsExtended.xmlgeneration for any non–Google Docs export (pass'word'toupdateCommentsExtendedXml()whenexportStrategy !== 'google-docs'), so we always stamp explicitw15:commentExentries.range-basedprofile, asserts the file exists, and verifies re-import keeps overlapping table comments separate.detectThreadingFromRanges()with a unit test to ensure it skips whencommentsExtended.xmlis present.