Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
261 commits
Select commit Hold shift + click to select a range
614059c
Simplify `_validateConfigColorValue`.
Mati365 Feb 3, 2025
7cd23a8
More strict testing.
Mati365 Feb 3, 2025
d2d8990
Sort deps.
Mati365 Feb 3, 2025
d6ce9c9
Improve docs.
Mati365 Feb 3, 2025
84dfedb
Rename error codes a bit.
Mati365 Feb 3, 2025
85f853c
Docs: warning language review. [skip ci]
godai78 Feb 3, 2025
8d66ae0
Update packages/ckeditor5-email/src/emailintegrationconfig.ts
godai78 Feb 4, 2025
5cfa581
Update packages/ckeditor5-email/src/emailintegrationutils.ts
godai78 Feb 4, 2025
24e3e4c
Update packages/ckeditor5-email/src/emailintegrationutils.ts
godai78 Feb 4, 2025
2e850d8
Sorting dependenecies.
godai78 Feb 4, 2025
20fda48
Add console info warnings in emptyblock and exportinlinestyles integr…
Mati365 Feb 4, 2025
0de872d
Docs: update API links [short flow]
godai78 Feb 4, 2025
05e3fd4
Restore warning in export inline styles integration checker.
Mati365 Feb 4, 2025
23924ff
Merge remote-tracking branch 'origin' into ck/epic/email-editing
Mati365 Feb 4, 2025
dab8242
Add empty block doc section.
Mati365 Feb 4, 2025
79b17b1
Docs: minor fixes. [short flow]
godai78 Feb 4, 2025
99d8122
Docs: lead in. [short flow]
godai78 Feb 4, 2025
609c411
Update packages/ckeditor5-email/docs/features/email.md
godai78 Feb 4, 2025
16edc5a
Update packages/ckeditor5-email/src/emailintegrationutils.ts
godai78 Feb 4, 2025
f655616
Update packages/ckeditor5-email/src/emailintegrationutils.ts
godai78 Feb 4, 2025
fa77ab3
Update packages/ckeditor5-email/src/emailintegrationutils.ts
godai78 Feb 4, 2025
64b6622
Update packages/ckeditor5-email/src/integrations/list.ts
godai78 Feb 4, 2025
6de45e9
Update packages/ckeditor5-email/tests/manual/emailintegration.md
godai78 Feb 4, 2025
15387ea
Update packages/ckeditor5-email/docs/features/email.md
godai78 Feb 4, 2025
a72cbb4
Extend the FullPage plugin with ability to render styles from <head> …
pszczesniak Feb 4, 2025
73574cc
Add missing `@module` to `email/index.ts`.
Mati365 Feb 4, 2025
f6713a8
Reorder imports.
Mati365 Feb 4, 2025
487f903
Added tests for 'allowRenderStylesFromHead' option.
pszczesniak Feb 4, 2025
7f19a9e
Change color warnings descriptions.
Mati365 Feb 5, 2025
ed892d6
Split color validation functions.
Mati365 Feb 5, 2025
51e6afe
Add missing unit tests for `_logInfo()`.
Mati365 Feb 5, 2025
f28f4f9
Check table / font config only when the table / font plugins are pres…
Mati365 Feb 5, 2025
3b01c42
Fix typo in docs.
Mati365 Feb 5, 2025
9cb494f
Improve inspector attach.
Mati365 Feb 5, 2025
f9db1dc
Update packages/ckeditor5-email/docs/_snippets/features/email.js
godai78 Feb 5, 2025
3b44877
Added 'sanitizeCss' config option.
pszczesniak Feb 5, 2025
90f005e
Added tests for 'sanitizeCss' option.
pszczesniak Feb 5, 2025
098e1cd
Use editors domParser.
pszczesniak Feb 6, 2025
1caf9aa
Api docs fixes. [skip ci]
pszczesniak Feb 6, 2025
b0231e0
Typo fix. [skip ci]
pszczesniak Feb 6, 2025
ac40945
Api docs fixes. [skip ci]
pszczesniak Feb 6, 2025
0bef7bb
Docs: related features. [skip ci]
godai78 Feb 6, 2025
2df1785
Update of the manual test description. [skip ci]
pszczesniak Feb 6, 2025
540e00c
Fix typo in docs.
Mati365 Feb 6, 2025
022812b
Add more unsupported color formats.
Mati365 Feb 6, 2025
825fa25
Add `rgba` to unsupported formats.
Mati365 Feb 6, 2025
7755161
Fix minor typos in docs.
Mati365 Feb 6, 2025
137541f
Remove styles from head of the main document while editor is destroyed.
pszczesniak Feb 6, 2025
e8cac27
Removed unnecessary function from tests.
pszczesniak Feb 6, 2025
abf83b5
Docs: minor snippet cleanup. [short flow]
godai78 Feb 6, 2025
f5eac62
Add `dll:build` to `package.json`.
Mati365 Feb 6, 2025
3c2ae8a
Revert webpack config
Mati365 Feb 6, 2025
6692cbd
Fix deps.
Mati365 Feb 6, 2025
cd396bd
Center the plain table in the output.
mmotyczynska Feb 6, 2025
e788e43
Adjust manual test.
mmotyczynska Feb 6, 2025
378d334
Update tests for plain tables.
mmotyczynska Feb 6, 2025
b6b8cab
Add test for consuming 'table' class.
mmotyczynska Feb 6, 2025
cacbf1e
Normalize imports, apply CR remarks.
Mati365 Feb 7, 2025
ca7c113
Check for non-glue plugins in font plugin asseration.
Mati365 Feb 7, 2025
e69a4eb
Print `Markdown` as unsupported plugin.
Mati365 Feb 7, 2025
0119e0d
Fix email integration sample
Mati365 Feb 7, 2025
72c01c2
Review suggestions applied.
pszczesniak Feb 10, 2025
eeb4737
Restore `skipComments` option on reinitialization of the data process…
Mati365 Feb 10, 2025
6413857
Fixes after review.
pszczesniak Feb 10, 2025
ce8cc6a
Merge branch 'ck/epic/email-editing' into ck/13482-render-style-eleme…
pszczesniak Feb 10, 2025
d087026
Merge pull request #17889 from ckeditor/ck/17888-plain-table-not-alig…
mmotyczynska Feb 10, 2025
72a5a99
Merge pull request #17880 from ckeditor/ck/13482-render-style-element…
pszczesniak Feb 11, 2025
11d3b64
Merge branch 'master' into ck/epic/email-editing
pszczesniak Feb 11, 2025
6f794d8
Fixed missing comma.
pszczesniak Feb 11, 2025
64b9e8e
Extend guide for Full page HTML feature.
pszczesniak Feb 11, 2025
743d471
Merge branch 'master-it84' into ck/epic/email-editing
Mati365 Feb 11, 2025
33c9f1e
Removed property 'parsedDocument' from the 'HtmlPageDataProcessor' to…
pszczesniak Feb 11, 2025
c057ee0
Merge pull request #17907 from ckeditor/ck/13482-html-page-data-proce…
niegowski Feb 11, 2025
53a8620
Docs: Proofread the Full page HTML guide.
gorzelinski Feb 11, 2025
91369f7
Merge pull request #17906 from ckeditor/ck/13482-render-style-element…
pszczesniak Feb 12, 2025
1980877
Merge branch 'master-it84' into ck/epic/email-editing
pszczesniak Feb 12, 2025
60b8e89
Drop `Demo` section from email guide as there is no demo.
Mati365 Feb 12, 2025
fe19a66
Drop `TODO` in fullpage for now.
Mati365 Feb 12, 2025
17fd8d5
Drop more demo links.
Mati365 Feb 12, 2025
ac9bfa2
Added link for Full page HTML feature in error code API docs.
pszczesniak Feb 12, 2025
1119b9d
Merge pull request #17916 from ckeditor/ck/13482-extending-api-docs-o…
pszczesniak Feb 12, 2025
098b57f
Warn about missing TableLayout plugin.
mmotyczynska Feb 12, 2025
b3b2ee0
Add basic tests for TableLayout for code coverage.
mmotyczynska Feb 12, 2025
3e23e5e
Fix: Small tweaks.
gorzelinski Feb 13, 2025
a8fe7df
Docs: Tweak the warn message.
gorzelinski Feb 13, 2025
c4c567e
Update method description.
mmotyczynska Feb 13, 2025
153636c
Merge pull request #17920 from ckeditor/ck/warn-about-missing-table-l…
mmotyczynska Feb 13, 2025
dc05d9e
Table layout ui.
mmotyczynska Feb 13, 2025
59e0a32
Table layout ui tests.
mmotyczynska Feb 13, 2025
6052679
Add insertTableLayout to menu bar.
mmotyczynska Feb 13, 2025
7d8bdad
Implementation of TableLayout plugin.
pszczesniak Feb 14, 2025
f8fdb68
Added tests for insert table layout command.
pszczesniak Feb 14, 2025
ceb47f0
Disable toggleTableCaption button for tables that disallow captions.
mmotyczynska Feb 14, 2025
42372be
Extend manual test with more table features.
mmotyczynska Feb 14, 2025
7ea4713
Temporarily modify the implementation of the command (for testing pur…
mmotyczynska Feb 14, 2025
a5a6539
Remove unnecessary command option.
mmotyczynska Feb 14, 2025
6b76b4c
Docs: minor fixes. [short flow]
godai78 Feb 17, 2025
f68668e
Merge branch 'master-it84' into ck/epic/email-editing
Mati365 Feb 17, 2025
0e90fb1
Add table layout to related features in email integration docs. (#17935)
Mati365 Feb 17, 2025
eadbf01
Update of the upcast conversion.
pszczesniak Feb 17, 2025
64d562f
Added more tests.
pszczesniak Feb 17, 2025
f10bb2b
Add basic clipboard support for table layout editing.
Mati365 Feb 17, 2025
6fbb45e
Add clipboard preview to table layout manual.
Mati365 Feb 17, 2025
18259c6
Remove clipboard integration logic, add tests.
Mati365 Feb 17, 2025
4f017c1
Merge pull request #17939 from ckeditor/ck/table-layout-plugin-clipboard
Mati365 Feb 17, 2025
b7707bc
Added Caption to manual test.
pszczesniak Feb 17, 2025
f79b914
Override the original table upcast to met table layout conditions.
pszczesniak Feb 19, 2025
86ecec6
Added support for header rows and header columns + tests.
pszczesniak Feb 19, 2025
26b7a34
Added missing type import.
pszczesniak Feb 19, 2025
d888ede
Added tests.
pszczesniak Feb 19, 2025
0eecf8e
Merge branch 'master-it84' into ck/epic/email-editing
Mati365 Feb 19, 2025
6ac18b8
Added missing test.
pszczesniak Feb 19, 2025
783a788
Fix incorrect automerge in email package `package.json` file.
Mati365 Feb 19, 2025
31e6e43
Add missing `ckeditor5-metadata.json`
Mati365 Feb 19, 2025
0ede24b
Fix wrong path in `ckeditor5-metadata.js` of email package.
Mati365 Feb 19, 2025
11fdb92
Added description to the manual test. [skip ci]
pszczesniak Feb 19, 2025
8c11254
Merge remote-tracking branch 'origin/ck/epic/email-editing' into ck/t…
mmotyczynska Feb 19, 2025
65939e2
Remove unnecessary command params.
mmotyczynska Feb 19, 2025
d42ff28
Applied suggested improvements from code review.
pszczesniak Feb 20, 2025
295d2cf
Merge branch 'ck/epic/email-editing' into ck/table-layout-plugin
pszczesniak Feb 20, 2025
8c9235e
Fix for manual test. [skip ci]
pszczesniak Feb 20, 2025
4c1e456
Docs: Refinement of the Plugins guide.
gorzelinski Feb 20, 2025
305a2e0
Update test description.
mmotyczynska Feb 20, 2025
2ae594a
Add url to the mentioned issue. [skip ci]
mmotyczynska Feb 20, 2025
d9f726c
Partial fixes after code review.
pszczesniak Feb 21, 2025
261c65c
Merge pull request #17924 from ckeditor/ck/table-layout-ui
mmotyczynska Feb 21, 2025
6d7495f
Added TableColumnResize as required.
pszczesniak Feb 21, 2025
bfa35e7
TableWidth upcasting fix.
pszczesniak Feb 21, 2025
1cc0654
Merge branch 'ck/epic/email-editing' into ck/table-layout-plugin.
pszczesniak Feb 21, 2025
cebec5f
Widget type around stylization.
pszczesniak Feb 24, 2025
7a653e3
Default layout table look in the editing view.
pszczesniak Feb 24, 2025
a1a79be
Do not reserve space above and below the layout table.
pszczesniak Feb 24, 2025
bad3acb
Fixes after review.
pszczesniak Feb 24, 2025
19015f6
Update icon for table layout.
pszczesniak Feb 25, 2025
1717ad3
Cleanup of the table layout icon.
pszczesniak Feb 25, 2025
f383923
Restore clipboard handler.
Mati365 Feb 25, 2025
ed5fc28
Add missing test.
Mati365 Feb 25, 2025
c75af25
Added external table to manual test.
pszczesniak Feb 25, 2025
bfc35b5
Merge branch 'ck/table-layout-plugin' into ck/table-layout-styling
pszczesniak Feb 25, 2025
ee63db1
Show widget handlers only on hovered one, without showing them on his…
pszczesniak Feb 25, 2025
ad97a04
Added postfixer to make sure that all tables gets tableType attribute.
pszczesniak Feb 25, 2025
ef3195d
Merge branch 'ck/table-layout-plugin' into ck/table-layout-styling
pszczesniak Feb 25, 2025
8413d71
Table layout icon cleaned.
pszczesniak Feb 25, 2025
196716c
Docs: updating guide headers. [short flow]
godai78 Feb 26, 2025
cc5087d
Docs: moving features. [skip ci]
godai78 Feb 26, 2025
03d3c9e
Extended postfixer to cover all cases.
pszczesniak Feb 26, 2025
019a6f8
Drop email package from `ckeditor5` `package.json`.
Mati365 Feb 26, 2025
d9c97d4
Merge branch 'master-it84' into ck/epic/email-editing
Mati365 Feb 26, 2025
2f0e4a1
Drop hard typing dependency to `ckeditor-email` package in GHS.
Mati365 Feb 26, 2025
fa8c82a
Remove export from `ckeditor5`
Mati365 Feb 26, 2025
680f301
Remove `ckeditor5-email` references from GHS.
Mati365 Feb 26, 2025
5a05451
Fix module import due to umberto crashes.
Mati365 Feb 26, 2025
67a1b07
Simplified the postfixer.
pszczesniak Feb 26, 2025
99ec58e
Small code refactor.
pszczesniak Feb 26, 2025
d8b449f
Merge pull request #17931 from ckeditor/ck/table-layout-plugin
pszczesniak Feb 26, 2025
3fcd3e0
Merge branch 'ck/table-layout-plugin' into ck/table-layout-styling
pszczesniak Feb 26, 2025
18d14c3
Remove GHS email integration plugin.
Mati365 Feb 27, 2025
78aaac4
Add missing `DataFilterRegisterEvent` export.
Mati365 Feb 27, 2025
772b6f3
Fixed issue with showing nested selection handler when it should be h…
pszczesniak Feb 27, 2025
92a30da
Merge branch 'master-it84' into ck/epic/email-editing
Mati365 Feb 27, 2025
566c94e
Split styles between feature package and theme-lark.
pszczesniak Feb 27, 2025
d014cb8
Drag & drop table no longer merges table with destination table.
Mati365 Feb 27, 2025
41d4972
Add missing reset `isDrop` flag.
Mati365 Feb 28, 2025
6f4ed80
Override min-width for table cell when cell has got width.
pszczesniak Feb 28, 2025
27cd0f8
Add tests.
Mati365 Feb 28, 2025
4386eda
Table layot fix.
pszczesniak Feb 28, 2025
7145a3a
Added more strict condition to know when show outline and when not.
pszczesniak Feb 28, 2025
4bdfa62
Merge branch 'ck/epic/email-editing' into ck/table-layout-styling
pszczesniak Mar 3, 2025
2cfb650
Fixes in manual HTML test.
pszczesniak Mar 3, 2025
32f641c
Fixed scoping of border styling.
pszczesniak Mar 3, 2025
b13f5e3
Present known issues in manual test.
pszczesniak Mar 3, 2025
50b6548
Fix the intendation.
pszczesniak Mar 3, 2025
dc6c60d
Remove comments.
pszczesniak Mar 3, 2025
735ca4d
Remove border spacing on layout tables.
pszczesniak Mar 3, 2025
7db9258
Fixed consume CSS layout classes + outline on focused table cell.
pszczesniak Mar 3, 2025
5345926
Added missing GHS with layout tables tests.
pszczesniak Mar 3, 2025
e5b8ba3
Simplify CSS selector.
pszczesniak Mar 4, 2025
67866b2
Added missing CSS import.
pszczesniak Mar 4, 2025
571f244
Refine manual test.
gorzelinski Mar 4, 2025
602ed81
Merge branch 'master' into ck/epic/email-editing
Mati365 Mar 5, 2025
060febd
Fixes after code review + code refactor.
pszczesniak Mar 5, 2025
b6081a9
Fake caret position changed for layout tables.
pszczesniak Mar 5, 2025
c1943b3
Added missing comment. [skip ci]
pszczesniak Mar 6, 2025
8364e9a
Set indent to the bogus paragraph inside layout table cell.
pszczesniak Mar 6, 2025
0ecca23
Fixed text-indent.
pszczesniak Mar 6, 2025
2035f83
Added comment to make the caret visible. [skip ci]
pszczesniak Mar 6, 2025
2deda34
Merge pull request #17989 from ckeditor/ck/table-layout-styling
pszczesniak Mar 6, 2025
b127ae7
Docs: enabling email. [short flow]
godai78 Mar 6, 2025
3a91d00
Merge pull request #18074 from ckeditor/ck/emailenablement
godai78 Mar 6, 2025
f949045
Merge branch 'master' into ck/epic/email-editing
Mati365 Mar 7, 2025
257299b
-SMake the layout table outline visible when layout table is inside a…
pszczesniak Mar 7, 2025
d96dd7d
Change fixed value to be a dedicated variable.[skip ci]
pszczesniak Mar 7, 2025
ffc53bd
Merge branch 'master' into ck/epic/email-editing
Mati365 Mar 10, 2025
9f683ad
Refine comments. [skip ci]
gorzelinski Mar 10, 2025
0821c95
Merge pull request #18081 from ckeditor/ck/layout-table-overflow-with…
pszczesniak Mar 10, 2025
6e97a84
Merge branch 'ck/epic/email-editing' into ck/epic/email-editing-table…
Mati365 Mar 10, 2025
0700b61
Switch to `isPaste` detection.
Mati365 Mar 10, 2025
57c8b02
Adjust logic.
Mati365 Mar 10, 2025
4aaf3a3
Adjust logic.
Mati365 Mar 10, 2025
97496ab
Add comments.
Mati365 Mar 10, 2025
8572752
Simplify condition.
Mati365 Mar 10, 2025
aa8db43
Merge pull request #18011 from ckeditor/ck/epic/email-editing-table-p…
Mati365 Mar 11, 2025
103df04
Merge branch 'master' into ck/epic/email-editing
godai78 Mar 11, 2025
2e2fe32
Docs: feature description. [short flow]
godai78 Mar 11, 2025
c884278
Docs: TOC category rename. [skip ci]
godai78 Mar 12, 2025
0ab09cd
Introduce set table type command.
pszczesniak Mar 12, 2025
96d8d93
Merge branch 'master' into ck/epic/email-editing
godai78 Mar 13, 2025
bcc49e9
Docs: fleshing out the layotu tables guide. [short flow]
godai78 Mar 13, 2025
61718d8
Merge branch 'ck/epic/email-editing' into ck/set-table-type-command
godai78 Mar 13, 2025
cf0d013
Merge branch 'master' into ck/epic/email-editing
godai78 Mar 13, 2025
b0ca582
Merge branch 'master' into ck/epic/email-editing
godai78 Mar 13, 2025
cfc022b
Introduce layout table heuritics configuration.
pszczesniak Mar 13, 2025
f4c6466
Docs: layout demo placeholde; minor fixes. [short flow]
godai78 Mar 14, 2025
3618db4
Review fixes.
pszczesniak Mar 14, 2025
dad6579
Added tests.
pszczesniak Mar 14, 2025
46a5ebf
Remove comments. [skip ci]
pszczesniak Mar 14, 2025
57c73f0
Added manual test.
pszczesniak Mar 14, 2025
a08d663
Use dedicated method to remove disallowed attributes from element.
pszczesniak Mar 14, 2025
cd7def3
Update types.
pszczesniak Mar 14, 2025
9cc5580
Applied review requested changes.
pszczesniak Mar 17, 2025
03f853c
Description for TableType type.
pszczesniak Mar 17, 2025
d67ea9e
Improved typings.
pszczesniak Mar 17, 2025
91578b1
Adde postfixer to prevent potential issues with the layout table stru…
pszczesniak Mar 17, 2025
ac846c9
Merge pull request #18121 from ckeditor/ck/email-editing/layout-table…
pszczesniak Mar 18, 2025
1268710
Merge branch 'ck/epic/email-editing' into ck/set-table-type-command
pszczesniak Mar 18, 2025
130e16a
Fix for type import.
pszczesniak Mar 18, 2025
2bd1d9b
Merge branch 'master' into ck/epic/email-editing
Mati365 Mar 18, 2025
41ff15e
Merge branch 'ck/epic/email-editing' into ck/set-table-type-command
pszczesniak Mar 18, 2025
f0b7f12
Docs: various changes to table dcos. [short flow]
godai78 Mar 18, 2025
261dade
Docs: minor changes. [short flow]
godai78 Mar 18, 2025
3afce35
Merge branch 'ck/epic/email-editing' into ck/set-table-type-command
Mati365 Mar 18, 2025
74767c5
Docs: placeholders for tables docs. [skip ci]
godai78 Mar 18, 2025
8b38a20
Merge branch 'ck/epic/email-editing' into ck/set-table-type-command
godai78 Mar 18, 2025
2b4d43a
Merge pull request #18109 from ckeditor/ck/set-table-type-command
pszczesniak Mar 18, 2025
dc18055
Table type toggling feature (#18135)
Mati365 Mar 19, 2025
c27c8b8
Docs: limiting the territorial expansion of layout tables. [short flow]
godai78 Mar 19, 2025
6c60f94
Docs: minor demo fixes. [short flow]
godai78 Mar 19, 2025
0ad6188
Improving table styles.
pszczesniak Mar 19, 2025
c70e012
Merge branch 'master' into ck/epic/email-editing
godai78 Mar 20, 2025
a530371
Code refactor.
pszczesniak Mar 20, 2025
62a1c01
Fix typo.
pszczesniak Mar 20, 2025
6af4685
Added revert instead of fixed value.
pszczesniak Mar 20, 2025
1aeb5dc
Set equal column width while creating layout tables.
pszczesniak Mar 20, 2025
fe140ba
Fixed comment. [skip ci]
pszczesniak Mar 20, 2025
cfad18f
Merge branch 'master' into ck/epic/email-editing
godai78 Mar 21, 2025
fdcec7d
Docs: bump dates. [short flow]
godai78 Mar 21, 2025
6eaf734
Merge pull request #18171 from ckeditor/ck/18169-improving-table-styles
pszczesniak Mar 21, 2025
611def4
Docs: demos. [short flow]
godai78 Mar 21, 2025
5f4ee95
Fixed plugin dependency.
niegowski Mar 24, 2025
2b6a814
Merge pull request #18184 from ckeditor/ck/resize-columns-on-creating…
pszczesniak Mar 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions docs/framework/architecture/plugins.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
---
# Scope:
# * Introduction to plugins.
# * Exemplify use cases.
# * Point to resources to learn plugin development.

category: framework-architecture
menu-title: Plugins in CKEditor 5
meta-title: Plugins in CKEditor 5 | CKEditor 5 Documentation
toc-limit: 1
order: 10
---

# Plugins in CKEditor&nbsp;5
# Plugins in CKEditor 5

Features in CKEditor are introduced by plugins. In fact, without plugins, CKEditor&nbsp;5 is an empty API with no use. Plugins provided by the CKEditor core team are available in [npm](https://www.npmjs.com/search?q=ckeditor5) (and [GitHub](https://github.com/ckeditor?utf8=%E2%9C%93&q=ckeditor5&type=&language=), too) in the form of npm packages. A package may contain one or more plugins (for example, the [`@ckeditor/ckeditor5-image`](https://www.npmjs.com/package/@ckeditor/ckeditor5-image) package contains {@link features/images-overview several granular plugins}).

Expand Down
5 changes: 5 additions & 0 deletions docs/umberto.json
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,11 @@
}
]
},
{
"name": "Email editing",
"id": "features-email",
"slug": "email-editing"
},
{
"name": "File management",
"id": "features-file-management",
Expand Down
56 changes: 56 additions & 0 deletions packages/ckeditor5-html-support/docs/features/full-page-html.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,68 @@ ClassicEditor
.create( document.querySelector( '#editor' ), {
licenseKey: '<YOUR_LICENSE_KEY>', // Or 'GPL'.
plugins: [ FullPage, /* ... */ ],
htmlSupport: {
fullPage: {
// Configuration.
}
}
} )
.then( /* ... */ )
.catch( /* ... */ );
```
</code-switcher>

## Configuration

### Render styles

By default, the full page HTML feature does not render the CSS from `<style>` that may be located in the `<head>` section edited content. To enable that possibility, set the {@link module:html-support/generalhtmlsupportconfig~FullPageConfig#allowRenderStylesFromHead `config.htmlSupport.fullPage.allowRenderStylesFromHead`} option to `true`.

Plugin extracts `<style>` elements from the edited content moves them to the main document `<head>`, and renders them. When CSS in `<style>` tag is changed using, for example, the {@link features/source-editing-enhanced Enhanced source code editing} feature, previously added `<style>` elements to the main document `<head>` will be replaced by the new ones.

However, by enabling the ability to render CSS from `<style>` elements located in the `<head>` section of the edited content, you expose the users of your system to the **risk of executing malicious code inside the editor**. Therefore, we highly recommend sanitizing your CSS using some library that will strip the malicious code from the styles before rendering them. You can plug in the sanitizer by defining the {@link module:html-support/generalhtmlsupportconfig~FullPageConfig#sanitizeCss `config.htmlSupport.fullPage.sanitizeCss`} option.

```js
ClassicEditor
.create( document.querySelector( '#editor' ), {
// ... Other configuration options ...
htmlSupport: {
fullPage: {
allowRenderStylesFromHead: true,
// Strip unsafe properties and values, for example:
// values like url( ... ) that may execute malicious code
// from an unknown source.
sanitizeCss( CssString ) {
const sanitizedCss = sanitize( CssString );

return {
css: sanitizedCss,
// true or false depending on whether
// the sanitizer stripped anything.
hasChanged: true
};
}
}
}
} )
.then( /* ... */ )
.catch( /* ... */ );
```

### Security

It is a plain security risk. The user may provide a CSS mistakenly copied from a malicious website. It could also end up in the user’s clipboard (as it would usually be copied and pasted) by any other means.

You can instruct some advanced users to never paste CSS code from untrusted sources. However, in most cases, it is highly recommended to secure the system by configuring the Full page HTML feature to use a CSS sanitizer and, optionally, by setting strict Content Security Policy (CSP) rules.

#### Sanitizer

The {@link module:html-support/generalhtmlsupportconfig~FullPageConfig#sanitizeCss `config.htmlSupport.fullPage.sanitizeCss`} option allows plugging an external sanitizer.

#### CSP

In addition to using a sanitizer, you can use the built-in browser mechanism called [Content Security Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP). By using CSP, you can let the browser know the allowed sources that CSS can use.

## Additional feature information

Here are some examples of the HTML elements you can enable with this plugin:
Expand Down
121 changes: 116 additions & 5 deletions packages/ckeditor5-html-support/src/fullpage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,15 @@
* @module html-support/fullpage
*/

import { Plugin } from 'ckeditor5/src/core.js';
import { UpcastWriter, type DataControllerToModelEvent, type DataControllerToViewEvent } from 'ckeditor5/src/engine.js';
import { Plugin, type Editor } from 'ckeditor5/src/core.js';
import { logWarning, global } from 'ckeditor5/src/utils.js';
import {
UpcastWriter,
type DataControllerToModelEvent,
type DataControllerToViewEvent,
type RootElement
} from 'ckeditor5/src/engine.js';

import HtmlPageDataProcessor from './htmlpagedataprocessor.js';

/**
Expand All @@ -32,11 +39,39 @@ export default class FullPage extends Plugin {
/**
* @inheritDoc
*/
public init(): void {
const editor = this.editor;
const properties = [ '$fullPageDocument', '$fullPageDocType', '$fullPageXmlDeclaration' ];
constructor( editor: Editor ) {
super( editor );

editor.config.define( 'htmlSupport.fullPage', {
allowRenderStylesFromHead: false,
sanitizeCss: rawCss => {
/**
* When using the Full page with the `config.htmlSupport.fullPage.allowRenderStylesFromHead` set to `true`,
* it is strongly recommended to define a sanitize function that will clean up the CSS
* which is present in the `<head>` in editors content in order to avoid XSS vulnerability.
*
* For a detailed overview, check the {@glink features/html/full-page-html Full page HTML feature} documentation.
*
* @error css-full-page-provide-sanitize-function
*/
logWarning( 'css-full-page-provide-sanitize-function' );

return {
css: rawCss,
hasChanged: false
};
}
} );

editor.data.processor = new HtmlPageDataProcessor( editor.data.viewDocument );
}

/**
* @inheritDoc
*/
public init(): void {
const editor = this.editor;
const properties = [ '$fullPageDocument', '$fullPageDocType', '$fullPageXmlDeclaration', '$fullPageHeadStyles' ];

editor.model.schema.extend( '$root', {
allowAttributes: properties
Expand All @@ -55,6 +90,10 @@ export default class FullPage extends Plugin {
}
}
} );

if ( isAllowedRenderStylesFromHead( editor ) ) {
this._renderStylesFromHead( root );
}
}, { priority: 'low' } );

// Apply root attributes to the view document fragment.
Expand Down Expand Up @@ -103,4 +142,76 @@ export default class FullPage extends Plugin {
args[ 0 ].trim = false;
}, { priority: 'high' } );
}

/**
* @inheritDoc
*/
public override destroy(): void {
super.destroy();

if ( isAllowedRenderStylesFromHead( this.editor ) ) {
this._removeStyleElementsFromDom();
}
}

/**
* Checks if in the document exists any `<style>` elements injected by the plugin and removes them,
* so these could be re-rendered later.
* There is used `data-full-page-style-id` attribute to recognize styles injected by the feature.
*/
private _removeStyleElementsFromDom(): void {
const existingStyleElements = Array.from(
global.document.querySelectorAll( `[data-full-page-style-id="${ this.editor.id }"]` )
);

for ( const style of existingStyleElements ) {
style.remove();
}
}

/**
* Extracts `<style>` elements from the full page data and renders them in the main document `<head>`.
* CSS content is sanitized before rendering.
*/
private _renderStyleElementsInDom( root: RootElement ): void {
const editor = this.editor;

// Get `<style>` elements list from the `<head>` from the full page data.
const styleElements = root.getAttribute( '$fullPageHeadStyles' ) as Array<HTMLStyleElement> | undefined;

if ( !styleElements ) {
return;
}

const sanitizeCss = editor.config.get( 'htmlSupport.fullPage.sanitizeCss' )!;

// Add `data-full-page-style-id` attribute to the `<style>` element and render it in `<head>` in the main document.
for ( const style of styleElements ) {
style.setAttribute( 'data-full-page-style-id', editor.id );

// Sanitize the CSS content before rendering it in the editor.
const sanitizedCss = sanitizeCss( style.innerText );

if ( sanitizedCss.hasChanged ) {
style.innerText = sanitizedCss.css;
}

global.document.head.append( style );
}
}

/**
* Removes existing `<style>` elements injected by the plugin and renders new ones from the full page data.
*/
private _renderStylesFromHead( root: RootElement ): void {
this._removeStyleElementsFromDom();
this._renderStyleElementsInDom( root );
}
}

/**
* Normalize the Full page configuration option `allowRenderStylesFromHead`.
*/
function isAllowedRenderStylesFromHead( editor: Editor ): boolean {
return editor.config.get( 'htmlSupport.fullPage.allowRenderStylesFromHead' )!;
}
93 changes: 93 additions & 0 deletions packages/ckeditor5-html-support/src/generalhtmlsupportconfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,97 @@ export interface GeneralHtmlSupportConfig {
* @default false
*/
preserveEmptyBlocksInEditingView?: boolean;

/**
* The configuration of the Full page editing feature.
* The option is used by the {@link module:html-support/fullpage~FullPage} feature.
*
* ```ts
* ClassicEditor
* .create( {
* htmlSupport: {
* fullPage: ... // Full page feature config.
* }
* } )
* .then( ... )
* .catch( ... );
* ```
*/
fullPage?: FullPageConfig;
}

/**
* The configuration of the Full page editing feature.
*/
export interface FullPageConfig {

/**
* Whether the feature should allow the editor to render styles from the `<head>` section of editor data content.
*
* When set to `true`, the editor will render styles from the `<head>` section of editor data content.
*
* ```ts
* ClassicEditor
* .create( {
* htmlSupport: {
* fullPage: {
* allowRenderStylesFromHead: true
* }
* }
* } )
* .then( ... )
* .catch( ... );
* ```
*
* @default false
*/
allowRenderStylesFromHead?: boolean;

/**
* Callback used to sanitize the CSS provided by the user in editor content
* when option `htmlSupport.fullPage.allowRenderStylesFromHead` is set to `true`.
*
* We strongly recommend overwriting the default function to avoid XSS vulnerabilities.
*
* The function receives the CSS (as a string), and should return an object
* that matches the {@link module:html-support/generalhtmlsupportconfig~CssSanitizeOutput} interface.
*
* ```ts
* ClassicEditor
* .create( editorElement, {
* htmlSupport: {
* fullPage: {
* allowRenderStylesFromHead: true,
*
* sanitizeCss( CssString ) {
* const sanitizedCss = sanitize( CssString );
*
* return {
* css: sanitizedCss,
* // true or false depending on whether the sanitizer stripped anything.
* hasChanged: ...
* };
* }
* }
* }
* } )
* .then( ... )
* .catch( ... );
* ```
*
*/
sanitizeCss?: ( css: string ) => CssSanitizeOutput;
}

export interface CssSanitizeOutput {

/**
* An output (safe) CSS that will be inserted into the document.
*/
css: string;

/**
* A flag that indicates whether the output CSS is different than the input value.
*/
hasChanged: boolean;
}
5 changes: 5 additions & 0 deletions packages/ckeditor5-html-support/src/htmlpagedataprocessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ export default class HtmlPageDataProcessor extends HtmlDataProcessor {
// Using the DOM document with body content extracted as a skeleton of the page.
writer.setCustomProperty( '$fullPageDocument', domFragment.ownerDocument.documentElement.outerHTML, viewFragment );

// List of `<style>` elements extracted from document's `<head>` element.
const headStylesElements = Array.from( domFragment.ownerDocument.querySelectorAll( 'head style' ) );

writer.setCustomProperty( '$fullPageHeadStyles', headStylesElements, viewFragment );

if ( docType ) {
writer.setCustomProperty( '$fullPageDocType', docType, viewFragment );
}
Expand Down
2 changes: 1 addition & 1 deletion packages/ckeditor5-html-support/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

export { default as GeneralHtmlSupport } from './generalhtmlsupport.js';
export { default as DataFilter } from './datafilter.js';
export { default as DataFilter, type DataFilterRegisterEvent } from './datafilter.js';
export { default as DataSchema, type DataSchemaBlockElementDefinition } from './dataschema.js';
export { default as HtmlComment } from './htmlcomment.js';
export { default as FullPage } from './fullpage.js';
Expand Down
Loading