prosemirror-view 1.23.2 → 1.23.3

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.2",
3
+ "version": "1.23.3",
4
4
  "description": "ProseMirror's view component",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es.js",
package/src/clipboard.js CHANGED
@@ -73,7 +73,8 @@ export function parseFromClipboard(view, text, html, plainText, $context) {
73
73
  preserveWhitespace: !!(asText || sliceData),
74
74
  context: $context,
75
75
  ruleFromNode(dom) {
76
- if (dom.nodeName == "BR" && !dom.nextSibling) return {ignore: true}
76
+ if (dom.nodeName == "BR" && !dom.nextSibling &&
77
+ dom.parentNode && !inlineParents.test(dom.parentNode.nodeName)) return {ignore: true}
77
78
  }
78
79
  })
79
80
  }
@@ -95,6 +96,8 @@ export function parseFromClipboard(view, text, html, plainText, $context) {
95
96
  return slice
96
97
  }
97
98
 
99
+ const inlineParents = /^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i
100
+
98
101
  // Takes a slice parsed with parseSlice, which means there hasn't been
99
102
  // any content-expression checking done on the top nodes, tries to
100
103
  // find a parent node in the current context that might fit the nodes,