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/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 1.23.3 (2021-11-26)
2
+
3
+ ### Bug fixes
4
+
5
+ The clipboard parser will no longer drop trailing `<br>` nodes that appear in an inline parent element.
6
+
1
7
  ## 1.23.2 (2021-11-19)
2
8
 
3
9
  ### Bug fixes
package/dist/index.es.js CHANGED
@@ -2998,7 +2998,8 @@ function parseFromClipboard(view, text, html, plainText, $context) {
2998
2998
  preserveWhitespace: !!(asText || sliceData),
2999
2999
  context: $context,
3000
3000
  ruleFromNode: function ruleFromNode(dom) {
3001
- if (dom.nodeName == "BR" && !dom.nextSibling) { return {ignore: true} }
3001
+ if (dom.nodeName == "BR" && !dom.nextSibling &&
3002
+ dom.parentNode && !inlineParents.test(dom.parentNode.nodeName)) { return {ignore: true} }
3002
3003
  }
3003
3004
  });
3004
3005
  }
@@ -3020,6 +3021,8 @@ function parseFromClipboard(view, text, html, plainText, $context) {
3020
3021
  return slice
3021
3022
  }
3022
3023
 
3024
+ var 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;
3025
+
3023
3026
  // Takes a slice parsed with parseSlice, which means there hasn't been
3024
3027
  // any content-expression checking done on the top nodes, tries to
3025
3028
  // find a parent node in the current context that might fit the nodes,