prosemirror-view
Advanced tools
Comparing version 1.23.10 to 1.23.11
{ | ||
"name": "prosemirror-view", | ||
"version": "1.23.10", | ||
"version": "1.23.11", | ||
"description": "ProseMirror's view component", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -675,4 +675,19 @@ import {DOMSerializer, Fragment, Mark} from "prosemirror-model" | ||
if (this.node.type.whitespace == "pre") rule.preserveWhitespace = "full" | ||
if (this.contentDOM && !this.contentLost) rule.contentElement = this.contentDOM | ||
else rule.getContent = () => this.contentDOM ? Fragment.empty : this.node.content | ||
if (!this.contentDOM) { | ||
rule.getContent = () => this.node.content | ||
} else if (!this.contentLost) { | ||
rule.contentElement = this.contentDOM | ||
} else { | ||
// Chrome likes to randomly recreate parent nodes when | ||
// backspacing things. When that happens, this tries to find the | ||
// new parent. | ||
for (let i = this.children.length - 1; i >= 0; i--) { | ||
let child = this.children[i] | ||
if (this.dom.contains(child.dom.parentNode)) { | ||
rule.contentElement = child.dom.parentNode | ||
break | ||
} | ||
} | ||
if (!rule.contentElement) rule.getContent = () => Fragment.empty | ||
} | ||
return rule | ||
@@ -679,0 +694,0 @@ } |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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
1610512
14985