implement Y.XmlFragment.length

This commit is contained in:
Kevin Jahns 2019-08-27 02:17:08 +02:00
parent fc4d6165b4
commit 13ad0c8464
2 changed files with 5 additions and 1 deletions

View File

@ -272,7 +272,7 @@ const formatText = (transaction, parent, left, right, currentAttributes, length,
// iterate until first non-format or null is found
// delete all formats with attributes[format.key] != null
while (length > 0 && right !== null) {
if (right.deleted === false) {
if (!right.deleted) {
switch (right.content.constructor) {
case ContentFormat:
const { key, value } = /** @type {ContentFormat} */ (right.content)

View File

@ -151,6 +151,10 @@ export class YXmlFragment extends AbstractType {
return new YXmlFragment()
}
get length () {
return this._prelimContent === null ? this._length : this._prelimContent.length
}
/**
* Create a subtree of childNodes.
*