Bug
Tested with v0.32.1 on Chrome/Firefox/Safari locally as well as in the examples page (below gif recorded as of today 1/24/2018): It appears that, with given two paragraphs, if there are marks on the ending text of the previous paragraph, they always carry over to the following paragraph by default.
Below are a couple issues reproduced from this bug, using the examples page.

(http://recordit.co/zvPYlyFYlr)
! character), it automatically affects the following paragraph even though the edit operation was not related and done only to the first paragraph. I imagine this is rather unexpected for most use cases. (I'm not certain, but back in the days Slate used to use zero-width space to deal with empty text and such, but I don't think the latest version does that anymore- maybe related?)Omitting JSFiddle, because reproducible with the example page.
I took a quick look at splitBlock and other associated internals but I must admit, I was pretty lost in it 馃槄.. Really appreciate Slate and the work everyone has put in - let me know in any ways I can help.
I'd actually expect marks to carry over into next paragraph. Sometimes it's undesirable but that's what I would expect and that's what most editors seem to do.
I don't personally have too strong of opinions as to what the correct behavior here should be, since it is subjective and dependent on one's situation.. I'd add, from my observations, more consumer oriented products like Dropbox Paper and Notation tend to not carry over marks/styles, but If this is the agreed behavior for Slate, I can live with this.
From looking at the previous discussion such as #1269 though, I wonder whether this is indeed the intended behavior? Maybe @justinweiss or @ianstormtaylor could opine on this? :)
Happy to close it if it's indeed expected. Thank you!
@thomaswhyyou you're right, this is not expected. I thought it was reverted by https://github.com/aha-app/slate/commit/3b5f499dbf83ebb1cffebe5efe2595019b66484f but it seems like it might not have been fully?
Are you on the latest slate and slate-react versions?
@ianstormtaylor Yes, I also ran locally in a fresh react project with the latest versions available, and observed the same behavior. For completeness, here are the dependencies and its versions used:
"dependencies": {
"immutable": "^3.8.2",
"is-hotkey": "^0.1.1",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"react-scripts": "1.1.0",
"slate": "^0.32.1",
"slate-auto-replace": "^0.9.0",
"slate-react": "^0.11.1"
},
It's back, changed your mind?
Possibly here:
Commands.splitBlock = (editor, depth = 1) => {
deleteExpanded(editor)
const { value } = editor
const { selection, document } = value
const marks = selection.marks || document.getInsertMarksAtRange(selection)
editor.splitBlockAtRange(selection, depth).moveToEnd()
if (marks && marks.size !== 0) {
editor.select({ marks })
}
}
Have the same issue with versions:
"slate": "^0.58.1",
"slate-history": "^0.57.1",
"slate-react": "^0.57.1",
Any ideas how to solve this behaviour?
Agree this is still happening