Skip to content

fix(lists paste): create custom num definitions for pasted lists#724

Merged
harbournick merged 3 commits intodevelopfrom
har-10144_list-paste-v2
Aug 5, 2025
Merged

fix(lists paste): create custom num definitions for pasted lists#724
harbournick merged 3 commits intodevelopfrom
har-10144_list-paste-v2

Conversation

@VladaHarbour
Copy link
Copy Markdown
Contributor

No description provided.

@linear
Copy link
Copy Markdown

linear Bot commented Aug 2, 2025

@harbournick harbournick requested a review from Copilot August 5, 2025 03:01
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread packages/super-editor/src/core/helpers/pasteListHelpers.js Outdated
Comment thread packages/super-editor/src/core/helpers/list-numbering-helpers.js
Copy link
Copy Markdown
Collaborator

@harbournick harbournick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@harbournick harbournick merged commit b8a7c47 into develop Aug 5, 2025
7 checks passed
@harbournick harbournick deleted the har-10144_list-paste-v2 branch August 5, 2025 03:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants