Skip to content

Conversation

@financialvice
Copy link

@financialvice financialvice commented Nov 20, 2025

Summary

  • merge all commentMark slices per commentId (and child comments) into one min..max range before export
  • insert a single commentRangeStart/End pair per id, using transaction mapping for correct positions after prior inserts
  • add a unit test covering fragmented marks exporting as one contiguous range

Background

Previously, prepareCommentsForExport would emit range nodes using only the first encountered slice for a commentId. When a commentMark spanned multiple adjacent text nodes, the exported DOCX/round-trip highlight was truncated. This change collects min..max spans and emits a single start/end pair, preventing truncated anchors.

Testing

  • npm run build:super-editor
  • npm run test:editor

disclaimer, generated primarily by gpt-5.1-codex-max

@caio-pizzol caio-pizzol requested review from VladaHarbour and harbournick and removed request for harbournick November 20, 2025 10:49
@caio-pizzol caio-pizzol changed the title Fix comment export to merge fragmented marks per commentId fix: comment export to merge fragmented marks per commentId Nov 20, 2025
@harbournick
Copy link
Collaborator

@chittolinag related to our discussion today. Mind checking this one out?

@chittolinag
Copy link
Contributor

@chittolinag related to our discussion today. Mind checking this one out?

yes - I'll review this one today.

@chittolinag
Copy link
Contributor

Hey @financialvice - thanks for submitting the PR here! Can you please share the document you reproduced the issue? Just by reading the PR description + code, I can't really tell what exactly is being fixed - it will be easier with a real example. Also, I'm working on something possibly related so just wanna double check whether your PR fixes my issue or my PR fixes yours 🙂

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants