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/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 1.23.5 (2021-12-27)
2
+
3
+ ### Bug fixes
4
+
5
+ Use the `whitespace` node prop where appropriate.
6
+
1
7
  ## 1.23.4 (2021-12-22)
2
8
 
3
9
  ### Bug fixes
package/dist/index.es.js CHANGED
@@ -1290,7 +1290,7 @@ var NodeViewDesc = /*@__PURE__*/(function (ViewDesc) {
1290
1290
  // attrs in the dom, that won't be picked up. Not entirely sure
1291
1291
  // whether this is a problem
1292
1292
  var rule = {node: this.node.type.name, attrs: this.node.attrs};
1293
- if (this.node.type.spec.code) { rule.preserveWhitespace = "full"; }
1293
+ if (this.node.type.whitespace == "pre") { rule.preserveWhitespace = "full"; }
1294
1294
  if (this.contentDOM && !this.contentLost) { rule.contentElement = this.contentDOM; }
1295
1295
  else { rule.getContent = function () { return this$1.contentDOM ? Fragment.empty : this$1.node.content; }; }
1296
1296
  return rule
@@ -2620,7 +2620,7 @@ function parseBetween(view, from_, to_) {
2620
2620
  topOpen: true,
2621
2621
  from: fromOffset,
2622
2622
  to: toOffset,
2623
- preserveWhitespace: $from.parent.type.spec.code ? "full" : true,
2623
+ preserveWhitespace: $from.parent.type.whitespace == "pre" ? "full" : true,
2624
2624
  editableContent: true,
2625
2625
  findPositions: find,
2626
2626
  ruleFromNode: ruleFromNode,