From 4aa41b98a9471a8334e2428fab977c6c0bd96f86 Mon Sep 17 00:00:00 2001 From: Kevin Jahns Date: Wed, 14 Mar 2018 18:51:48 -0700 Subject: [PATCH 1/2] fix dom filtering bug --- src/Type/y-xml/YXmlElement.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Type/y-xml/YXmlElement.js b/src/Type/y-xml/YXmlElement.js index c795879c..263c8e74 100644 --- a/src/Type/y-xml/YXmlElement.js +++ b/src/Type/y-xml/YXmlElement.js @@ -8,6 +8,9 @@ export default class YXmlElement extends YXmlFragment { super() this.nodeName = null this._scrollElement = null + if (typeof arg2 === 'function') { + this._domFilter = arg2 + } if (typeof arg1 === 'string') { this.nodeName = arg1.toUpperCase() } else if (arg1 != null && arg1.nodeType != null && arg1.nodeType === arg1.ELEMENT_NODE) { @@ -16,9 +19,6 @@ export default class YXmlElement extends YXmlFragment { } else { this.nodeName = 'UNDEFINED' } - if (typeof arg2 === 'function') { - this._domFilter = arg2 - } } _copy () { let struct = super._copy() @@ -39,7 +39,7 @@ export default class YXmlElement extends YXmlFragment { // get attribute via getAttribute for custom element support (some write something different in attr.value) attributes.set(attr.name, dom.getAttribute(attr.name)) } - attributes = this._domFilter(dom, attributes) + attributes = this._domFilter(dom.nodeName, attributes) attributes.forEach((value, name) => { this.setAttribute(name, value) }) From 941a22b2574beda2c82c75a7924e77d011e31cdd Mon Sep 17 00:00:00 2001 From: Kevin Jahns Date: Wed, 14 Mar 2018 18:52:49 -0700 Subject: [PATCH 2/2] 13.0.0-55 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 38b67aba..02df33b2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "yjs", - "version": "13.0.0-54", + "version": "13.0.0-55", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 651e6099..91b0af95 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "yjs", - "version": "13.0.0-54", + "version": "13.0.0-55", "description": "A framework for real-time p2p shared editing on any data", "main": "./y.node.js", "browser": "./y.js",