@contentful/field-editor-rich-text 3.4.10 → 3.4.12
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 +10 -0
- package/dist/field-editor-rich-text.cjs.development.js +57 -1
- 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 +61 -5
- package/dist/field-editor-rich-text.esm.js.map +1 -1
- package/dist/plugins/PasteHTML/utils/sanitizeAnchors.d.ts +19 -0
- package/package.json +5 -5
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* In HTML it's a valid structure to have a block element inside a link
|
|
3
|
+
*
|
|
4
|
+
* e.g: <a href="..."><h1> My link </h1><h2>is fancy</h2></a>
|
|
5
|
+
*
|
|
6
|
+
* However, that's not supported in Slate. There are generally two ways to
|
|
7
|
+
* handle this:
|
|
8
|
+
*
|
|
9
|
+
* a) Unwrap inner blocks while preserving the content.
|
|
10
|
+
* e.g. <a href="...">My link is fancy</a>
|
|
11
|
+
*
|
|
12
|
+
* b) Break the link into multiple elements with having each block
|
|
13
|
+
* element as a wrapper for an anchor with the same URL
|
|
14
|
+
* e.g. <h1><a href="...">My link</a></h1>
|
|
15
|
+
* and <h2><a href="...">is fancy</a></h2>
|
|
16
|
+
*
|
|
17
|
+
* We take approach (a) in here.
|
|
18
|
+
*/
|
|
19
|
+
export declare const sanitizeAnchors: (doc: Document) => Document;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/field-editor-rich-text",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.12",
|
|
4
4
|
"source": "./src/index.tsx",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "dist/field-editor-rich-text.esm.js",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"@contentful/f36-icons": "^4.1.1",
|
|
31
31
|
"@contentful/f36-tokens": "^4.0.0",
|
|
32
32
|
"@contentful/f36-utils": "^4.19.0",
|
|
33
|
-
"@contentful/field-editor-reference": "^5.8.
|
|
34
|
-
"@contentful/field-editor-shared": "^1.1.
|
|
33
|
+
"@contentful/field-editor-reference": "^5.8.5",
|
|
34
|
+
"@contentful/field-editor-shared": "^1.1.7",
|
|
35
35
|
"@contentful/rich-text-plain-text-renderer": "^15.12.1",
|
|
36
36
|
"@contentful/rich-text-types": "15.14.1",
|
|
37
37
|
"@popperjs/core": "^2.11.5",
|
|
@@ -68,11 +68,11 @@
|
|
|
68
68
|
"@babel/plugin-transform-runtime": "^7.9.6",
|
|
69
69
|
"@babel/preset-env": "7.12.11",
|
|
70
70
|
"@babel/preset-react": "7.13.13",
|
|
71
|
-
"@contentful/field-editor-test-utils": "^1.2.
|
|
71
|
+
"@contentful/field-editor-test-utils": "^1.2.6",
|
|
72
72
|
"@contentful/rich-text-react-renderer": "^15.11.0",
|
|
73
73
|
"@types/is-hotkey": "^0.1.6",
|
|
74
74
|
"@udecode/plate-test-utils": "^3.2.0",
|
|
75
75
|
"react": ">=16.14.0"
|
|
76
76
|
},
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "1e4a7d92c48f0e1949f2b48b3c9974da1602fd5c"
|
|
78
78
|
}
|