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

Page break support for paste from word #2602

Merged
merged 15 commits into from
Feb 1, 2019
Merged

Page break support for paste from word #2602

merged 15 commits into from
Feb 1, 2019

Conversation

jacekbogdanski
Copy link
Member

What is the purpose of this pull request?

New feature

Does your PR contain necessary tests?

All patches which 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

  • Unit tests
  • Manual tests

What changes did you make?

I think that it makes the most sense to introduce this feature as optional if pagebreak plugin is available. Requiring pagebreak plugin by pastefromword will force users to use pagebreak plugin which may not be wanted behavior (especially that it changes toolbar).

Closes #2598

plugins/pagebreak/plugin.js Show resolved Hide resolved
plugins/pagebreak/plugin.js Show resolved Hide resolved
tests/plugins/pagebreak/pagebreak.js Show resolved Hide resolved
'br': function( element ) {
var styles = tools.parseCssText( element.attributes.style );

if ( editor.plugins.pagebreak && styles[ 'page-break-before' ] === 'always' ) {
Copy link
Member

Choose a reason for hiding this comment

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

editor.plugins.pagebreak should be moved to the beginning of the function, as an early return. If the plugin is no loaded, there is no need to even parse element's styles.

Copy link
Member

@Comandeer Comandeer left a comment

Choose a reason for hiding this comment

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

Unit test is failing in IE 8.

Additionally it seems that the feature does not work in IE8.

@@ -0,0 +1,27 @@
@bender-tags: feature, 4.12.0, pastefromword
Copy link
Member

Choose a reason for hiding this comment

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

Please add issue reference.

Copy link
Member

@Comandeer Comandeer left a comment

Choose a reason for hiding this comment

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

Still not working, this time in Safari.

@jacekbogdanski
Copy link
Member Author

It looks like Safari PFW contains a different tag to recognize page breaks.

@Comandeer Comandeer self-assigned this Jan 2, 2019
Copy link
Member

@Comandeer Comandeer left a comment

Choose a reason for hiding this comment

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

It'd be nice to have additional fixtures, at least for IE8 and Edge.

Copy link
Member

@Comandeer Comandeer left a comment

Choose a reason for hiding this comment

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

LGTM!

@Comandeer Comandeer merged commit d73bef3 into major Feb 1, 2019
@CKEditorBot CKEditorBot deleted the t/2598 branch February 1, 2019 15:51
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.

2 participants