Skip to content

Node type change#87

Closed
tg44 wants to merge 9 commits into
super-editorfrom
node-type-change
Closed

Node type change#87
tg44 wants to merge 9 commits into
super-editorfrom
node-type-change

Conversation

@tg44

@tg44 tg44 commented Sep 10, 2024

Copy link
Copy Markdown

ongoing PR for node type changes

@tg44 tg44 left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I added the remaining todos/infos to the code, if you have any question feel free to ask here!

track: node.attrs.track.filter(track => track.type !== TrackDeleteMarkName)
});
} else if (action === "revert") {
//TODO: we should create all of the marks again

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Here we should import the node recreation based of the marks.

}
const res = nodeListHandler.handler([nodeWithChange], docx, false)
if(res.length > 0) {
//TODO: here we should diff the old node and a new node, and add the attributes

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Here we have the new node (as the parsed), and the old node (as res), and we should find out how we could add the correct marks to the "new node".

* @typedef {(nodes: XmlNode[], docx: ParsedDocx, insideTrackCahange: boolean) => PmNodeJson[]} NodeListHandlerFn
* @typedef {{handler: NodeListHandlerFn, handlerEntities: NodeHandlerEntry[]}} NodeListHandler
*
* @typedef {(nodes: XmlNode[], docx: ParsedDocx, nodeListHandler: NodeListHandler, insideTrackCahange: boolean) => PmNodeJson[]} NodeHandler

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This could be refactored to node: XmlNode bcs we removed the n to n mapping, and we did an 1 to n which is way easier to think about. (This is really just refactoring the array to a single element.)

@harbournick
harbournick deleted the node-type-change branch June 6, 2025 22:08
superdoc-bot Bot pushed a commit that referenced this pull request Jun 14, 2026
feat(fonts): make @superdoc-dev/fonts the only bundled-font source (SD-3441)

Ported-From-Source-Repo: superdoc/orbit
Ported-From-Source-Commit: 73c7e48d83019ee7015cca608841244cca466692
Ported-Public-Prefix: superdoc/public
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.

2 participants