@ckeditor/ckeditor5-html-support 43.1.0-alpha.8 → 43.1.1
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/build/html-support.js +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
- package/src/htmlpagedataprocessor.js +5 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-html-support",
|
|
3
|
-
"version": "43.1.
|
|
3
|
+
"version": "43.1.1",
|
|
4
4
|
"description": "HTML Support feature for CKEditor 5.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ckeditor",
|
|
@@ -17,12 +17,12 @@
|
|
|
17
17
|
"type": "module",
|
|
18
18
|
"main": "src/index.js",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@ckeditor/ckeditor5-core": "43.1.
|
|
21
|
-
"@ckeditor/ckeditor5-engine": "43.1.
|
|
22
|
-
"@ckeditor/ckeditor5-enter": "43.1.
|
|
23
|
-
"@ckeditor/ckeditor5-utils": "43.1.
|
|
24
|
-
"@ckeditor/ckeditor5-widget": "43.1.
|
|
25
|
-
"ckeditor5": "43.1.
|
|
20
|
+
"@ckeditor/ckeditor5-core": "43.1.1",
|
|
21
|
+
"@ckeditor/ckeditor5-engine": "43.1.1",
|
|
22
|
+
"@ckeditor/ckeditor5-enter": "43.1.1",
|
|
23
|
+
"@ckeditor/ckeditor5-utils": "43.1.1",
|
|
24
|
+
"@ckeditor/ckeditor5-widget": "43.1.1",
|
|
25
|
+
"ckeditor5": "43.1.1",
|
|
26
26
|
"lodash-es": "4.17.21"
|
|
27
27
|
},
|
|
28
28
|
"author": "CKSource (http://cksource.com/)",
|
|
@@ -16,18 +16,18 @@ export default class HtmlPageDataProcessor extends HtmlDataProcessor {
|
|
|
16
16
|
*/
|
|
17
17
|
toView(data) {
|
|
18
18
|
// Ignore content that is not a full page source.
|
|
19
|
-
if (
|
|
19
|
+
if (!/<(?:html|body|head|meta)(?:\s[^>]*)?>/i.test(data.trim().slice(0, 10000))) {
|
|
20
20
|
return super.toView(data);
|
|
21
21
|
}
|
|
22
22
|
// Store doctype and xml declaration in a separate properties as they can't be stringified later.
|
|
23
23
|
let docType = '';
|
|
24
24
|
let xmlDeclaration = '';
|
|
25
|
-
data = data.replace(
|
|
26
|
-
|
|
25
|
+
data = data.trim().replace(/<\?xml\s[^?]*\?>/i, match => {
|
|
26
|
+
xmlDeclaration = match;
|
|
27
27
|
return '';
|
|
28
28
|
});
|
|
29
|
-
data = data.replace(
|
|
30
|
-
|
|
29
|
+
data = data.trim().replace(/^<!DOCTYPE\s[^>]*?>/i, match => {
|
|
30
|
+
docType = match;
|
|
31
31
|
return '';
|
|
32
32
|
});
|
|
33
33
|
// Convert input HTML data to DOM DocumentFragment.
|