@contentful/field-editor-rich-text 1.0.8 → 1.1.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 +22 -0
- package/dist/field-editor-rich-text.cjs.development.js +14 -6
- package/dist/field-editor-rich-text.cjs.development.js.map +1 -1
- package/dist/field-editor-rich-text.cjs.production.min.js +1 -1
- package/dist/field-editor-rich-text.cjs.production.min.js.map +1 -1
- package/dist/field-editor-rich-text.esm.js +14 -6
- package/dist/field-editor-rich-text.esm.js.map +1 -1
- package/package.json +8 -8
|
@@ -3016,12 +3016,20 @@ var HyperlinkPlugin = function HyperlinkPlugin(_ref) {
|
|
|
3016
3016
|
return next();
|
|
3017
3017
|
},
|
|
3018
3018
|
normalizeNode: function normalizeNode(node, editor, next) {
|
|
3019
|
-
if (isHyperlink(node.type)
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
}
|
|
3024
|
-
}
|
|
3019
|
+
if (isHyperlink(node.type)) {
|
|
3020
|
+
if (node.text.trim() === '') {
|
|
3021
|
+
return function () {
|
|
3022
|
+
editor.removeNodeByKey(node.key);
|
|
3023
|
+
};
|
|
3024
|
+
}
|
|
3025
|
+
|
|
3026
|
+
if (node.getInlines().size > 0) {
|
|
3027
|
+
return function () {
|
|
3028
|
+
node.getInlines().forEach(function (inlineNode) {
|
|
3029
|
+
return editor.unwrapInlineByKey(inlineNode.key, node.type);
|
|
3030
|
+
});
|
|
3031
|
+
};
|
|
3032
|
+
}
|
|
3025
3033
|
}
|
|
3026
3034
|
|
|
3027
3035
|
next();
|