1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-22 15:02:51 +02:00

Revert "Keep marks after splitting a block (#1273)" (#1289)

This reverts commit 6f676d6771.

This behavior should be in userland, because there isn't agreement
among text editors on how it should behave.

Resolves #1269.
This commit is contained in:
Justin Weiss
2017-10-25 17:31:19 -07:00
committed by Ian Storm Taylor
parent 1777fc3959
commit 6298d5442d

View File

@@ -474,15 +474,9 @@ function AfterPlugin(options = {}) {
const { state } = change
if (HOTKEYS.SPLIT_BLOCK(event)) {
if (state.isInVoid) {
return change.collapseToStartOfNextText()
} else {
change = change.splitBlock()
state.activeMarks.forEach((mark) => {
change = change.addMark(mark)
})
return change
}
return state.isInVoid
? change.collapseToStartOfNextText()
: change.splitBlock()
}
if (HOTKEYS.DELETE_CHAR_BACKWARD(event)) {