From b84763d4e349b7992727329e612b60b8b9fd6178 Mon Sep 17 00:00:00 2001 From: godai78 Date: Fri, 3 Dec 2021 11:54:15 +0100 Subject: [PATCH] docs: migration to 31.1.0; minor docs fixes. --- .../guides/migration/migration-to-31.md | 61 ++++++++++++++++- .../guides/migration/migration-to-32.md | 67 ------------------- 2 files changed, 59 insertions(+), 69 deletions(-) delete mode 100644 docs/builds/guides/migration/migration-to-32.md diff --git a/docs/builds/guides/migration/migration-to-31.md b/docs/builds/guides/migration/migration-to-31.md index 8e4a478bf99..26748b22029 100644 --- a/docs/builds/guides/migration/migration-to-31.md +++ b/docs/builds/guides/migration/migration-to-31.md @@ -3,10 +3,10 @@ category: builds-migration menu-title: Migration to v31.x order: 93 -modified_at: 2021-10-01 +modified_at: 2021-12-03 --- -# Migration to CKEditor 5 v31.0.0 +# Migration to CKEditor 5 v31.x.0 When updating your CKEditor 5 installation, make sure **all the packages are the same version** to avoid errors. @@ -14,6 +14,63 @@ modified_at: 2021-10-01 For custom builds, you may try removing the `package-lock.json` or `yarn.lock` files (if applicable) and reinstalling all packages before rebuilding the editor. For best results, make sure you use the most recent package versions. +## Migration to CKEditor 5 v31.1.0 + +For the entire list of changes introduced in version 31.1.0, see the [changelog for CKEditor 5 v31.1.0](https://github.com/ckeditor/ckeditor5/blob/master/CHANGELOG.md#3110-2021-12-03). + +Listed below are the most important changes that require your attention when upgrading to CKEditor 5 v31.1.0. + +### Interactive content filtering in the {@link framework/guides/architecture/editing-engine#editing-pipeline editing pipeline} + +#### Interactive attributes + +Starting from v31.1.0, the editor engine will detect attributes that may interrupt the editing experience and rename them to `data-ck-unsafe-attribute-[original attribute name]`, for instance: + +```html + +

Interactive paragraph

+ + +

Interactive paragraph

+``` + + + Please keep in mind this new mechanism does not affect the {@link builds/guides/integration/saving-data data saved by the editor} (e.g. the output of `editor.getData()`). The filtering only applies during the editing when the user interacts with the editor. + + +If you are the author of a plugin that generates this kind of content in the {@link framework/guides/architecture/editing-engine#editing-pipeline editing pipeline} and you want it to be preserved, you can configure this when creating the element using {@link module:engine/view/downcastwriter~DowncastWriter} during the {@link framework/guides/architecture/editing-engine#conversion model–view conversion}. Methods such as {@link module:engine/view/downcastwriter~DowncastWriter#createContainerElement}, {@link module:engine/view/downcastwriter~DowncastWriter#createAttributeElement}, or {@link module:engine/view/downcastwriter~DowncastWriter#createEmptyElement} accept an option that will disable filtering of specific attributes: + +```js +/* Before v31.1.0. */ +const paragraph = writer.createContainerElement( 'p', + { + class: 'clickable-paragraph', + onclick: 'alert( "Paragraph clicked!" )' + } +); + +/* After v31.1.0. */ +const paragraph = writer.createContainerElement( 'p', + { + class: 'clickable-paragraph', + onclick: 'alert( "Paragraph clicked!" )' + }, + { + // Make sure the "onclick" attribute will pass through. + renderUnsafeAttributes: [ 'onclick' ] + } +); +``` + +#### Blocking script elements + +Also, starting from v31.1.0, any `` tags) and there is no way to opt out of it. + + +## Migration to CKEditor 5 v31.0.0 + For the entire list of changes introduced in version 31.0.0, see the [changelog for CKEditor 5 v31.0.0](https://github.com/ckeditor/ckeditor5/blob/master/CHANGELOG.md#3100-2021-10-25). Listed below are the most important changes that require your attention when upgrading to CKEditor 5 v31.0.0. diff --git a/docs/builds/guides/migration/migration-to-32.md b/docs/builds/guides/migration/migration-to-32.md deleted file mode 100644 index 4d750ab5643..00000000000 --- a/docs/builds/guides/migration/migration-to-32.md +++ /dev/null @@ -1,67 +0,0 @@ - ---- -category: builds-migration -menu-title: Migration to v32.x -order: 92 -modified_at: 2021-10-25 ---- - -# Migration to CKEditor 5 v32.0.0 - - - When updating your CKEditor 5 installation, make sure **all the packages are the same version** to avoid errors. - - For custom builds, you may try removing the `package-lock.json` or `yarn.lock` files (if applicable) and reinstalling all packages before rebuilding the editor. For best results, make sure you use the most recent package versions. - - -For the entire list of changes introduced in version 32.0.0, see the [changelog for CKEditor 5 v32.0.0](https://github.com/ckeditor/ckeditor5/blob/master/CHANGELOG.md#3200-2021-10-25). - -Listed below are the most important changes that require your attention when upgrading to CKEditor 5 v32.0.0. - -### Interactive content filtering in the {@link framework/guides/architecture/editing-engine#editing-pipeline editing pipeline} - -#### Interactive attributes - -Starting from v32.0.0, the editor engine will detect attributes that may interrupt the editing experience and rename them to `data-ck-unsafe-attribute-[original attribute name]`, for instance: - -```html - -

Interactive paragraph

- - -

Interactive paragraph

-``` - - - Please keep in mind this new mechanism does not affect the {@link builds/guides/integration/saving-data data saved by the editor} (e.g. the output of `editor.getData()`). The filtering only applies during the editing when the user interacts with the editor. - - -If you are the author of a plugin that generates this kind of content in the {@link framework/guides/architecture/editing-engine#editing-pipeline editing pipeline} and you want it to be preserved, you can configure this when creating the element using {@link module:engine/view/downcastwriter~DowncastWriter} during the {@link framework/guides/architecture/editing-engine#conversion model–view conversion}. Methods such as {@link module:engine/view/downcastwriter~DowncastWriter#createContainerElement}, {@link module:engine/view/downcastwriter~DowncastWriter#createAttributeElement}, or {@link module:engine/view/downcastwriter~DowncastWriter#createEmptyElement} accept an option that will disable filtering of specific attributes: - -```js -/* Before v32.0.0. */ -const paragraph = writer.createContainerElement( 'p', - { - class: 'clickable-paragraph', - onclick: 'alert( "Paragraph clicked!" )' - } -); - -/* After v32.0.0. */ -const paragraph = writer.createContainerElement( 'p', - { - class: 'clickable-paragraph', - onclick: 'alert( "Paragraph clicked!" )' - }, - { - // Make sure the "onclick" attribute will pass through. - renderUnsafeAttributes: [ 'onclick' ] - } -); -``` - -#### Blocking script elements - -Also, starting from v32.0.0, any `` tags) and there is no way to opt out of it.