improved granularity of prosemirror binding
This commit is contained in:
@@ -95,10 +95,12 @@ export class YArray extends Type {
|
||||
while (n !== null) {
|
||||
if (!n._deleted && n._countable) {
|
||||
if (index < n._length) {
|
||||
if (n.constructor === ItemJSON || n.constructor === ItemString) {
|
||||
return n._content[index]
|
||||
} else {
|
||||
return n
|
||||
switch (n.constructor) {
|
||||
case ItemJSON:
|
||||
case ItemString:
|
||||
return n._content[index]
|
||||
default:
|
||||
return n
|
||||
}
|
||||
}
|
||||
index -= n._length
|
||||
|
||||
@@ -485,6 +485,10 @@ export class YText extends YArray {
|
||||
this._callEventHandler(transaction, new YTextEvent(this, remote, transaction))
|
||||
}
|
||||
|
||||
toDom () {
|
||||
return document.createTextNode(this.toString())
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the unformatted string representation of this YText type.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user