@ckeditor/ckeditor5-engine 34.1.0 → 34.2.0
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/package.json +22 -22
- package/src/conversion/upcasthelpers.js +5 -0
- package/src/view/domconverter.js +11 -3
- package/src/view/element.js +3 -0
- package/src/view/filler.js +1 -1
- package/src/view/renderer.js +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-engine",
|
|
3
|
-
"version": "34.
|
|
3
|
+
"version": "34.2.0",
|
|
4
4
|
"description": "The editing engine of CKEditor 5 – the best browser-based rich text editor.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"wysiwyg",
|
|
@@ -23,30 +23,30 @@
|
|
|
23
23
|
],
|
|
24
24
|
"main": "src/index.js",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@ckeditor/ckeditor5-utils": "^34.
|
|
26
|
+
"@ckeditor/ckeditor5-utils": "^34.2.0",
|
|
27
27
|
"lodash-es": "^4.17.15"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@ckeditor/ckeditor5-basic-styles": "^34.
|
|
31
|
-
"@ckeditor/ckeditor5-block-quote": "^34.
|
|
32
|
-
"@ckeditor/ckeditor5-clipboard": "^34.
|
|
33
|
-
"@ckeditor/ckeditor5-cloud-services": "^34.
|
|
34
|
-
"@ckeditor/ckeditor5-core": "^34.
|
|
35
|
-
"@ckeditor/ckeditor5-editor-classic": "^34.
|
|
36
|
-
"@ckeditor/ckeditor5-enter": "^34.
|
|
37
|
-
"@ckeditor/ckeditor5-essentials": "^34.
|
|
38
|
-
"@ckeditor/ckeditor5-heading": "^34.
|
|
39
|
-
"@ckeditor/ckeditor5-image": "^34.
|
|
40
|
-
"@ckeditor/ckeditor5-link": "^34.
|
|
41
|
-
"@ckeditor/ckeditor5-list": "^34.
|
|
42
|
-
"@ckeditor/ckeditor5-mention": "^34.
|
|
43
|
-
"@ckeditor/ckeditor5-paragraph": "^34.
|
|
44
|
-
"@ckeditor/ckeditor5-table": "^34.
|
|
45
|
-
"@ckeditor/ckeditor5-theme-lark": "^34.
|
|
46
|
-
"@ckeditor/ckeditor5-typing": "^34.
|
|
47
|
-
"@ckeditor/ckeditor5-ui": "^34.
|
|
48
|
-
"@ckeditor/ckeditor5-undo": "^34.
|
|
49
|
-
"@ckeditor/ckeditor5-widget": "^34.
|
|
30
|
+
"@ckeditor/ckeditor5-basic-styles": "^34.2.0",
|
|
31
|
+
"@ckeditor/ckeditor5-block-quote": "^34.2.0",
|
|
32
|
+
"@ckeditor/ckeditor5-clipboard": "^34.2.0",
|
|
33
|
+
"@ckeditor/ckeditor5-cloud-services": "^34.2.0",
|
|
34
|
+
"@ckeditor/ckeditor5-core": "^34.2.0",
|
|
35
|
+
"@ckeditor/ckeditor5-editor-classic": "^34.2.0",
|
|
36
|
+
"@ckeditor/ckeditor5-enter": "^34.2.0",
|
|
37
|
+
"@ckeditor/ckeditor5-essentials": "^34.2.0",
|
|
38
|
+
"@ckeditor/ckeditor5-heading": "^34.2.0",
|
|
39
|
+
"@ckeditor/ckeditor5-image": "^34.2.0",
|
|
40
|
+
"@ckeditor/ckeditor5-link": "^34.2.0",
|
|
41
|
+
"@ckeditor/ckeditor5-list": "^34.2.0",
|
|
42
|
+
"@ckeditor/ckeditor5-mention": "^34.2.0",
|
|
43
|
+
"@ckeditor/ckeditor5-paragraph": "^34.2.0",
|
|
44
|
+
"@ckeditor/ckeditor5-table": "^34.2.0",
|
|
45
|
+
"@ckeditor/ckeditor5-theme-lark": "^34.2.0",
|
|
46
|
+
"@ckeditor/ckeditor5-typing": "^34.2.0",
|
|
47
|
+
"@ckeditor/ckeditor5-ui": "^34.2.0",
|
|
48
|
+
"@ckeditor/ckeditor5-undo": "^34.2.0",
|
|
49
|
+
"@ckeditor/ckeditor5-widget": "^34.2.0",
|
|
50
50
|
"webpack": "^5.58.1",
|
|
51
51
|
"webpack-cli": "^4.9.0"
|
|
52
52
|
},
|
package/src/view/domconverter.js
CHANGED
|
@@ -35,7 +35,6 @@ const NBSP_FILLER_REF = NBSP_FILLER( document ); // eslint-disable-line new-cap
|
|
|
35
35
|
const MARKED_NBSP_FILLER_REF = MARKED_NBSP_FILLER( document ); // eslint-disable-line new-cap
|
|
36
36
|
const UNSAFE_ATTRIBUTE_NAME_PREFIX = 'data-ck-unsafe-attribute-';
|
|
37
37
|
const UNSAFE_ELEMENT_REPLACEMENT_ATTRIBUTE = 'data-ck-unsafe-element';
|
|
38
|
-
const UNSAFE_ELEMENTS = [ 'script', 'style' ];
|
|
39
38
|
|
|
40
39
|
/**
|
|
41
40
|
* `DomConverter` is a set of tools to do transformations between DOM nodes and view nodes. It also handles
|
|
@@ -127,6 +126,15 @@ export default class DomConverter {
|
|
|
127
126
|
'object', 'iframe', 'input', 'button', 'textarea', 'select', 'option', 'video', 'embed', 'audio', 'img', 'canvas'
|
|
128
127
|
];
|
|
129
128
|
|
|
129
|
+
/**
|
|
130
|
+
* A list of elements which may affect the editing experience. To avoid this, those elements are replaced with
|
|
131
|
+
* `<span data-ck-unsafe-element="[element name]"></span>` while rendering in the editing mode.
|
|
132
|
+
*
|
|
133
|
+
* @readonly
|
|
134
|
+
* @member {Array.<String>} module:engine/view/domconverter~DomConverter#unsafeElements
|
|
135
|
+
*/
|
|
136
|
+
this.unsafeElements = [ 'script', 'style' ];
|
|
137
|
+
|
|
130
138
|
/**
|
|
131
139
|
* The DOM-to-view mapping.
|
|
132
140
|
*
|
|
@@ -672,7 +680,7 @@ export default class DomConverter {
|
|
|
672
680
|
const attrs = domNode.attributes;
|
|
673
681
|
|
|
674
682
|
if ( attrs ) {
|
|
675
|
-
for ( let
|
|
683
|
+
for ( let l = attrs.length, i = 0; i < l; i++ ) {
|
|
676
684
|
viewElement._setAttribute( attrs[ i ].name, attrs[ i ].value );
|
|
677
685
|
}
|
|
678
686
|
}
|
|
@@ -1564,7 +1572,7 @@ export default class DomConverter {
|
|
|
1564
1572
|
_shouldRenameElement( elementName ) {
|
|
1565
1573
|
const name = elementName.toLowerCase();
|
|
1566
1574
|
|
|
1567
|
-
return this.renderingMode === 'editing' &&
|
|
1575
|
+
return this.renderingMode === 'editing' && this.unsafeElements.includes( name );
|
|
1568
1576
|
}
|
|
1569
1577
|
|
|
1570
1578
|
/**
|
package/src/view/element.js
CHANGED
|
@@ -608,6 +608,9 @@ export default class Element extends Node {
|
|
|
608
608
|
// is changed by e.g. toWidget() function from ckeditor5-widget. Perhaps this should be one of custom props.
|
|
609
609
|
cloned.getFillerOffset = this.getFillerOffset;
|
|
610
610
|
|
|
611
|
+
// Clone unsafe attributes list.
|
|
612
|
+
cloned._unsafeAttributesToRender = this._unsafeAttributesToRender;
|
|
613
|
+
|
|
611
614
|
return cloned;
|
|
612
615
|
}
|
|
613
616
|
|
package/src/view/filler.js
CHANGED
|
@@ -56,7 +56,7 @@ export const NBSP_FILLER = domDocument => domDocument.createTextNode( '\u00A0' )
|
|
|
56
56
|
export const MARKED_NBSP_FILLER = domDocument => {
|
|
57
57
|
const span = domDocument.createElement( 'span' );
|
|
58
58
|
span.dataset.ckeFiller = true;
|
|
59
|
-
span.
|
|
59
|
+
span.innerText = '\u00A0';
|
|
60
60
|
|
|
61
61
|
return span;
|
|
62
62
|
};
|
package/src/view/renderer.js
CHANGED
|
@@ -234,6 +234,10 @@ export default class Renderer {
|
|
|
234
234
|
else if ( this._inlineFiller && this._inlineFiller.parentNode ) {
|
|
235
235
|
// While the user is making selection, preserve the inline filler at its original position.
|
|
236
236
|
inlineFillerPosition = this.domConverter.domPositionToView( this._inlineFiller );
|
|
237
|
+
|
|
238
|
+
if ( inlineFillerPosition.parent.is( '$text' ) ) {
|
|
239
|
+
inlineFillerPosition = ViewPosition._createBefore( inlineFillerPosition.parent );
|
|
240
|
+
}
|
|
237
241
|
}
|
|
238
242
|
|
|
239
243
|
for ( const element of this.markedAttributes ) {
|