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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prosemirror-view",
3
- "version": "1.23.4",
3
+ "version": "1.23.5",
4
4
  "description": "ProseMirror's view component",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es.js",
@@ -18,7 +18,7 @@
18
18
  "url": "git://github.com/prosemirror/prosemirror-view.git"
19
19
  },
20
20
  "dependencies": {
21
- "prosemirror-model": "^1.14.3",
21
+ "prosemirror-model": "^1.16.0",
22
22
  "prosemirror-state": "^1.0.0",
23
23
  "prosemirror-transform": "^1.1.0"
24
24
  },
package/src/domchange.js CHANGED
@@ -39,7 +39,7 @@ function parseBetween(view, from_, to_) {
39
39
  topOpen: true,
40
40
  from: fromOffset,
41
41
  to: toOffset,
42
- preserveWhitespace: $from.parent.type.spec.code ? "full" : true,
42
+ preserveWhitespace: $from.parent.type.whitespace == "pre" ? "full" : true,
43
43
  editableContent: true,
44
44
  findPositions: find,
45
45
  ruleFromNode,
package/src/viewdesc.js CHANGED
@@ -667,7 +667,7 @@ class NodeViewDesc extends ViewDesc {
667
667
  // attrs in the dom, that won't be picked up. Not entirely sure
668
668
  // whether this is a problem
669
669
  let rule = {node: this.node.type.name, attrs: this.node.attrs}
670
- if (this.node.type.spec.code) rule.preserveWhitespace = "full"
670
+ if (this.node.type.whitespace == "pre") rule.preserveWhitespace = "full"
671
671
  if (this.contentDOM && !this.contentLost) rule.contentElement = this.contentDOM
672
672
  else rule.getContent = () => this.contentDOM ? Fragment.empty : this.node.content
673
673
  return rule