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 +6 -0
- package/dist/index.es.js +4 -1
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/clipboard.js +4 -1
package/package.json
CHANGED
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
|
|
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,
|