Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider DecoratorNode in $insertNodeToNearestRoot #5949

Open
LvChengbin opened this issue Apr 24, 2024 · 0 comments
Open

Consider DecoratorNode in $insertNodeToNearestRoot #5949

LvChengbin opened this issue Apr 24, 2024 · 0 comments

Comments

@LvChengbin
Copy link

LvChengbin commented Apr 24, 2024

DecoratorNode is not treated as ElementNode from this commit (#5371) on, but In $insertNodeToNearestRoot method, getTopLevelElementOrThrow is called if the selection is not a range selection. It causes error while the focus node is a DecoratorNode.

nodes[nodes.length - 1].getTopLevelElementOrThrow().insertAfter(node);

And another feature in this method should which I think it should be modified is checking empty after splitting node in range selection, otherwise it may create one more empty line.

Another question is why does this method end with inserting another paragraph node?

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

No branches or pull requests

1 participant