Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add EmptyBlocks plugin that prevents adding   in exported data. #17756

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

Mati365
Copy link
Member

@Mati365 Mati365 commented Jan 15, 2025

Suggested merge commit message (convention)

Feature (html-support): Add EmptyBlocks plugin that prevents adding   in exported data.


Additional information

It's part of https://github.com/cksource/ckeditor5-commercial/pull/6942
Original issue https://github.com/cksource/ckeditor5-commercial/issues/6941

More details: Notion

@Mati365 Mati365 marked this pull request as ready for review January 15, 2025 12:44
@Mati365 Mati365 changed the title Add EmptyBlocks plugin that allows for preserving empty block elements in the editor. Add EmptyBlocks plugin that prevents adding   in exported data. Jan 15, 2025
@Mati365 Mati365 requested review from niegowski and arkflpc January 15, 2025 13:05
Copy link
Contributor

@niegowski niegowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from the comments below, the clipboard integration is missing.

packages/ckeditor5-html-support/src/emptyblocks.ts Outdated Show resolved Hide resolved
packages/ckeditor5-html-support/src/emptyblocks.ts Outdated Show resolved Hide resolved
packages/ckeditor5-html-support/src/emptyblocks.ts Outdated Show resolved Hide resolved
packages/ckeditor5-html-support/src/emptyblocks.ts Outdated Show resolved Hide resolved
packages/ckeditor5-html-support/src/emptyblocks.ts Outdated Show resolved Hide resolved
packages/ckeditor5-html-support/src/emptyblocks.ts Outdated Show resolved Hide resolved
packages/ckeditor5-html-support/src/emptyblocks.ts Outdated Show resolved Hide resolved
packages/ckeditor5-html-support/src/emptyblocks.ts Outdated Show resolved Hide resolved
packages/ckeditor5-html-support/src/emptyblocks.ts Outdated Show resolved Hide resolved
packages/ckeditor5-html-support/tests/emptyblocks.js Outdated Show resolved Hide resolved
@Mati365 Mati365 force-pushed the ck/skip-block-filler-option branch from b1e0b3b to e57d7f5 Compare January 17, 2025 06:23
@Witoso
Copy link
Member

Witoso commented Jan 17, 2025

Please link to API docs of this plugin in the table:
image

Mention from which version available.

@Mati365 Mati365 requested a review from niegowski January 17, 2025 11:15
packages/ckeditor5-html-support/src/emptyblocks.ts Outdated Show resolved Hide resolved
packages/ckeditor5-html-support/src/emptyblocks.ts Outdated Show resolved Hide resolved
packages/ckeditor5-html-support/src/emptyblocks.ts Outdated Show resolved Hide resolved
packages/ckeditor5-html-support/src/emptyblocks.ts Outdated Show resolved Hide resolved
packages/ckeditor5-html-support/src/emptyblocks.ts Outdated Show resolved Hide resolved
packages/ckeditor5-html-support/tests/emptyblocks.js Outdated Show resolved Hide resolved
packages/ckeditor5-table/src/converters/upcasttable.ts Outdated Show resolved Hide resolved
@Mati365 Mati365 requested a review from niegowski January 20, 2025 10:56
packages/ckeditor5-html-support/src/emptyblocks.ts Outdated Show resolved Hide resolved
packages/ckeditor5-html-support/src/emptyblocks.ts Outdated Show resolved Hide resolved
packages/ckeditor5-html-support/src/emptyblocks.ts Outdated Show resolved Hide resolved
packages/ckeditor5-html-support/src/emptyblocks.ts Outdated Show resolved Hide resolved
packages/ckeditor5-html-support/src/emptyblocks.ts Outdated Show resolved Hide resolved
packages/ckeditor5-html-support/src/emptyblocks.ts Outdated Show resolved Hide resolved
packages/ckeditor5-html-support/src/emptyblocks.ts Outdated Show resolved Hide resolved
packages/ckeditor5-html-support/src/emptyblocks.ts Outdated Show resolved Hide resolved
'<paragraph htmlEmptyBlock="true" listIndent="0" listType="bulleted"></paragraph>'
);

expect( editor.getData() ).to.equal( '<p>A</p><ul><li><p></p></li></ul>' );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd expect the output would not have an empty <p> as there wasn't one in the input.

packages/ckeditor5-html-support/tests/emptyblocks.js Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants