fix(lists paste): create custom num definitions for pasted lists#724
Merged
harbournick merged 3 commits intodevelopfrom Aug 5, 2025
Merged
fix(lists paste): create custom num definitions for pasted lists#724harbournick merged 3 commits intodevelopfrom
harbournick merged 3 commits intodevelopfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes list pasting from DOCX files by creating custom numbering definitions for pasted lists instead of relying on the target document's existing numbering definitions. The key change is moving from a simple mapping approach to dynamically generating proper list definitions with correct formatting parameters.
Key changes:
- Extracts helper functions for list processing into a separate module for better code organization
- Enhances the list definition generation to handle custom formatting parameters (level, start, text, fmt)
- Improves support for both paragraph-based and list-item-based pasted content
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/super-editor/src/core/inputRules/docx-paste/docx-paste.js | Refactored list processing logic to use extracted helpers and support both <p> and <li> elements |
| packages/super-editor/src/core/helpers/pasteListHelpers.js | New helper module containing extracted list processing utilities and numbering format mappings |
| packages/super-editor/src/core/helpers/list-numbering-helpers.js | Enhanced generateNewListDefinition to accept custom formatting parameters for pasted lists |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.