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

Add splitListItemKeepMarks command #10

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

antonvolkoff
Copy link

This PR adds splitListItemKeepMarks command which replicates a behavior of splitBlockKeepMarks command for lists.

Why?

I was working on the requirements to preserve marks on the new line. I found that splitBlockKeepMarks command to be very useful for it, but could not find similar command for lists.

I think this is an important addition to this package, so it is consistent with the functionality provided by prosemirror-commands.

it("preserves marks after splitting", () =>
apply(doc(ul(li(p(strong("foo<a>bar"))))), splitWithMarks,
doc(ul(li(p(strong("foo"))), li(p(strong("bar")))))))
})
Copy link
Member

Choose a reason for hiding this comment

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

This looks like it doesn't actually test the preserving---it doesn't look at what the stored marks are after the command runs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants