ckeditor / ckeditor4

The best enterprise-grade WYSIWYG editor. Fully customizable with countless features and plugins.
https://ckeditor.com/ckeditor-4
Other
5.78k stars 2.46k forks source link

Add margins support for list in PFW plugin #5438

Closed KarolDawidziuk closed 1 year ago

KarolDawidziuk commented 1 year ago

What is the purpose of this pull request?

New feature

Does your PR contain necessary tests?

All patches that change the editor code must include tests. You can always read more on PR testing, how to set the testing environment and how to create tests in the official CKEditor documentation.

This PR contains

Did you follow the CKEditor 4 code style guide?

Your code should follow the guidelines from the CKEditor 4 code style guide which helps keep the entire codebase consistent.

What is the proposed changelog entry for this pull request?

* [#5316](https://github.com/ckeditor/ckeditor4/issues/5316): Feature: Add margins support for list elements in PFW plugin when [pasteTools_keepZeroMargins](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-pasteTools_keepZeroMargins) is ON.

What changes did you make?

As lists are unwrapped during the cleaning process and we lost information about margins, I've added a temporary attribute called cke-list-style-margins to save information about zero margins. Then margins are applied during creating a new list when the pasteTools_keepZeroMargins config option is ON.

To prepare a unit test I've used our getClipboard tool and I've take an appropriate html from each browser.

Which issues does your PR resolve?

Closes #5316.

github-actions[bot] commented 1 year ago

It's been a while since we last heard from you. We are marking this pull request as stale due to inactivity. Please provide the requested feedback or the pull request will be closed after next 7 days.

KarolDawidziuk commented 1 year ago

Thanks, @Comandeer for the review. I've simplified code and PR is ready for another check.

KarolDawidziuk commented 1 year ago

Thanks @Comandeer for the review.

I've added support for non-zero margins for list by default when ACF will be properly set. In addition I've added missing unit and manual test for non-zero ones and PR is ready for another check.

KarolDawidziuk commented 1 year ago

@Comandeer, fixtures updated

Comandeer commented 1 year ago

Rebased on to the latest master.

KarolDawidziuk commented 1 year ago

@Comandeer handling of the horizontal margins in lists images was removed.

Comandeer commented 1 year ago

Rebased onto the latest master.

KarolDawidziuk commented 1 year ago

@Comandeer PR is ready to review.