prosemirror-view 1.23.4 → 1.23.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1294,7 +1294,7 @@ var NodeViewDesc = /*@__PURE__*/(function (ViewDesc) {
1294
1294
  // attrs in the dom, that won't be picked up. Not entirely sure
1295
1295
  // whether this is a problem
1296
1296
  var rule = {node: this.node.type.name, attrs: this.node.attrs};
1297
- if (this.node.type.spec.code) { rule.preserveWhitespace = "full"; }
1297
+ if (this.node.type.whitespace == "pre") { rule.preserveWhitespace = "full"; }
1298
1298
  if (this.contentDOM && !this.contentLost) { rule.contentElement = this.contentDOM; }
1299
1299
  else { rule.getContent = function () { return this$1.contentDOM ? prosemirrorModel.Fragment.empty : this$1.node.content; }; }
1300
1300
  return rule
@@ -2624,7 +2624,7 @@ function parseBetween(view, from_, to_) {
2624
2624
  topOpen: true,
2625
2625
  from: fromOffset,
2626
2626
  to: toOffset,
2627
- preserveWhitespace: $from.parent.type.spec.code ? "full" : true,
2627
+ preserveWhitespace: $from.parent.type.whitespace == "pre" ? "full" : true,
2628
2628
  editableContent: true,
2629
2629
  findPositions: find,
2630
2630
  ruleFromNode: ruleFromNode,