mirror of
https://github.com/yjs/yjs.git
synced 2025-12-16 11:47:46 +01:00
fix nicks test case
This commit is contained in:
@@ -67,27 +67,27 @@ const output = [
|
||||
"attributes": {
|
||||
"italic": true
|
||||
},
|
||||
"attribution": {
|
||||
"attribution": { // no "insert" attribution: the insertion "Hell" is not attributed to anyone
|
||||
"attributes": {
|
||||
"italic": [
|
||||
"italic": [ // the attribute "italic" was added by Bob
|
||||
"Bob"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"insert": "o "
|
||||
"insert": "o " // the insertion "o " has no attributions
|
||||
},
|
||||
{
|
||||
"insert": "World",
|
||||
"attribution": {
|
||||
"attribution": { // the insertion "World" was deleted by Bob
|
||||
"delete": [
|
||||
"Bob"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"insert": "attributions",
|
||||
"insert": "attributions", // the insertion "attributions" was inserted by Bob
|
||||
"attribution": {
|
||||
"insert": [
|
||||
"Bob"
|
||||
@@ -95,7 +95,7 @@ const output = [
|
||||
}
|
||||
},
|
||||
{
|
||||
"insert": "!"
|
||||
"insert": "!" // the insertion "!" has no attributions
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
@@ -1021,7 +1021,7 @@ export const typeMapGetContent = (parent, am) => {
|
||||
const tmpcs = []
|
||||
am.readContent(tmpcs, prevItem)
|
||||
cs = tmpcs.concat(cs)
|
||||
if (cs[0].attrs == null) {
|
||||
if (cs.length === 0 || cs[0].attrs == null) {
|
||||
cs.splice(0, cs.findIndex(c => c.attrs != null))
|
||||
break
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user