page-parser-tree
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -282,5 +282,11 @@ 'use strict'; | ||
var ec = change.value; | ||
var parent = findParent(ec.parents.slice(0, -1)); | ||
var _node = ec.parents[ec.parents.length - 1].node; | ||
_this2._treeController.removeTaggedNode(parent, tag, _node); | ||
// The node might have already been removed from the tree if it | ||
// is owned by a node that was just removed. | ||
var nodeParent = _node.getParent(); | ||
if (nodeParent && nodeParent.ownsNode(_node)) { | ||
var parent = findParent(ec.parents.slice(0, -1)); | ||
_this2._treeController.removeTaggedNode(parent, tag, _node); | ||
} | ||
} | ||
@@ -327,2 +333,2 @@ }); | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC5qcyJdLCJuYW1lcyI6WyJtYWtlTGl2ZVNldFRyYW5zZm9ybWVyIiwic2VsZWN0b3JzIiwidHJhbnNmb3JtZXJzIiwibWFwIiwiaXRlbSIsIml0ZW1TdHJpbmciLCJmaWx0ZXJYZiIsImZpbHRlciIsImVsIiwiZmxhdE1hcEZuIiwidHJhbnNkdWNlciIsImNvbXBvc2UiLCJwYXJlbnRzIiwiZWMiLCJsaXZlU2V0IiwiJHRhZyIsIm93bmVkQnkiLCJhZGRTdWJzY3JpcHRpb24iLCJhZGRUYWdnZWRMaXZlU2V0IiwiJG9yIiwidHJhbnNmb3JtZXIiLCIkd2F0Y2giLCJFcnJvciIsIiRsb2ciLCJwZXJJdGVtIiwiY29uc29sZSIsImxvZyIsInN1YnNjcmliZSIsImNoYW5nZXMiLCJmb3JFYWNoIiwiY2hhbmdlIiwidHlwZSIsInZhbHVlIiwidmFsdWVzIiwiJGZpbHRlciIsImZpbHRlckZuIiwiJG1hcCIsInJlZHVjZSIsImNvbWJpbmVkIiwiUGFnZVBhcnNlclRyZWUiLCJyb290IiwidGFnZ2VycyIsIl9zdWJzY3JpcHRpb25zIiwicm9vdEVsIiwibm9kZVR5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AgICB9O1xuXG4gICAgdGhpcy5fdGFnZ2Vyc1xuICAgICAgLmZpbHRlcigoe3NvdXJjZXN9KSA9PiBzb3VyY2VzLmluZGV4T2YodGFnKSA+PSAwKVxuICAgICAgLmZvckVhY2goKHtzZWxlY3RvcnN9KSA9PiB7XG4gICAgICAgIGNvbnN0IHRyYW5zZm9ybWVyID0gdGhpcy5fbGl2ZVNldFRyYW5zZm9ybWVycy5nZXQoc2VsZWN0b3JzKTtcbiAgICAgICAgaWYgKCF0cmFuc2Zvcm1lcikgdGhyb3cgbmV3IEVycm9yKCk7XG4gICAgICAgIHRyYW5zZm9ybWVyKGxpdmVTZXQsIGFkZFN1YnNjcmlwdGlvbiwgYWRkVGFnZ2VkTGl2ZVNldCk7XG4gICAgICB9KTtcbiAgfVxuXG4gIC8vVE9ET1xuICAvLyByZXBsYWNlVGFnZ2Vycyh0YWdnZXJzOiBBcnJheTxUYWdnZXI+KSB7XG4gIC8vICAgdGhpcy5fdGFnZ2VycyA9IHRhZ2dlcnM7XG4gIC8vIH1cbn1cbiJdfQ== |
{ | ||
"name": "page-parser-tree", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "Create a TagTree of named elements out of an HTML page", | ||
@@ -24,3 +24,3 @@ "main": "js/index.js", | ||
"matches-selector-ng": "^1.0.0", | ||
"tag-tree": "^0.1.2", | ||
"tag-tree": "^0.1.3", | ||
"transducers.js": "^0.3.2" | ||
@@ -27,0 +27,0 @@ }, |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
50108
302
Updatedtag-tree@^0.1.3