Fix splitListItem when used with simpler list schema #1

Closed
theefer wants to merge 1 commit from fix-splitListItem-simpler-schema into master
theefer commented 2017-01-12 17:30:57 +01:00 (Migrated from github.com)

splitListItem currently doesn't get applied (the canSplit condition ends up being false) when using a simpler list schema in which list_item content is defined as "paragraph (ordered_list|bullet_list)?". This causes a bug when trying to split a list by pressing Enter with the caret at the end of a list item.

This PR re-applies a previously submitted and accepted fix https://github.com/ProseMirror/prosemirror/pull/450.

PS: If you have any ideas on how to add tests for this to avoid further regressions, I'd be happy to help add some. The problem I'm hitting trying to add tests (besides https://github.com/ProseMirror/prosemirror/issues/526) is that they depend on a default helper schema from prosemirror-model, and I can't see any easy way to derive a slightly modified schema to run tests against.

`splitListItem` currently doesn't get applied (the `canSplit` condition ends up being false) when using a simpler list schema in which `list_item` content is defined as `"paragraph (ordered_list|bullet_list)?"`. This causes a bug when trying to split a list by pressing Enter with the caret at the end of a list item. This PR re-applies a previously submitted and accepted fix https://github.com/ProseMirror/prosemirror/pull/450. PS: If you have any ideas on how to add tests for this to avoid further regressions, I'd be happy to help add some. The problem I'm hitting trying to add tests (besides https://github.com/ProseMirror/prosemirror/issues/526) is that they depend on a default helper schema from `prosemirror-model`, and I can't see any easy way to derive a slightly modified schema to run tests against.
marijnh commented 2017-04-04 17:51:08 +02:00 (Migrated from github.com)

Finally merged as 13f2eb2

Creating tests should be easier now that the test-document-builder stuff was abstracted in https://github.com/prosemirror/prosemirror-test-builder

Finally merged as 13f2eb2 Creating tests should be easier now that the test-document-builder stuff was abstracted in https://github.com/prosemirror/prosemirror-test-builder

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
prosemirror/prosemirror-schema-list!1
No description provided.