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

Failure to paste content from word with list style disabled via inline style #5712

Closed
bendemboski opened this issue Nov 7, 2019 · 1 comment Β· Fixed by ckeditor/ckeditor5-paste-from-office#91
Labels
package:paste-from-office type:bug This issue reports a buggy (incorrect) behavior.

Comments

@bendemboski
Copy link
Contributor

πŸ“ Provide detailed reproduction steps (if any)

  1. Copy all of the content from this word document
  2. Paste it into an editor with the paste from office plugin enabled, e.g. the classic demo

βœ”οΈ Expected result

Content appears in editor

❌ Actual result

Nothing appears in editor and the following exception is thrown:

Uncaught CKEditorError: unexpected-error {"originalError":{"message":"Cannot read property '2' of null","stack":"TypeError: Cannot read property '2' of null\n    at ib (https://ckeditor.com/assets/libs/ckeditor5/15.0.0/ckeditor.js:5:576129)\n    at https://ckeditor.com/assets/libs/ckeditor5/15.0.0/ckeditor.js:5:575075\n    at eb (https://ckeditor.com/assets/libs/ckeditor5/15.0.0/ckeditor.js:5:575158)\n    at hb.execute (https://ckeditor.com/assets/libs/ckeditor5/15.0.0/ckeditor.js:5:579948)\n    at nh.t.plugins.get.on.priority (https://ckeditor.com/assets/libs/ckeditor5/15.0.0/ckeditor.js:5:580355)\n    at nh.fire (https://ckeditor.com/assets/libs/ckeditor5/15.0.0/ckeditor.js:5:128164)\n    at ro.listenTo.priority (https://ckeditor.com/assets/libs/ckeditor5/15.0.0/ckeditor.js:5:423188)\n    at ro.fire (https://ckeditor.com/assets/libs/ckeditor5/15.0.0/ckeditor.js:5:128164)\n    at ro.i (https://ckeditor.com/assets/libs/ckeditor5/15.0.0/ckeditor.js:5:421444)\n    at ro.fire (https://ckeditor.com/assets/libs/ckeditor5/15.0.0/ckeditor.js:5:128164)","name":"TypeError"}}
    at Function.rethrowUnexpectedError (https://ckeditor.com/assets/libs/ckeditor5/15.0.0/ckeditor.js:5:3929)
    at nh.fire (https://ckeditor.com/assets/libs/ckeditor5/15.0.0/ckeditor.js:5:128401)
    at ro.listenTo.priority (https://ckeditor.com/assets/libs/ckeditor5/15.0.0/ckeditor.js:5:423188)
    at ro.fire (https://ckeditor.com/assets/libs/ckeditor5/15.0.0/ckeditor.js:5:128164)
    at ro.i (https://ckeditor.com/assets/libs/ckeditor5/15.0.0/ckeditor.js:5:421444)
    at ro.fire (https://ckeditor.com/assets/libs/ckeditor5/15.0.0/ckeditor.js:5:128164)
    at eh.fire (https://ckeditor.com/assets/libs/ckeditor5/15.0.0/ckeditor.js:5:207744)
    at eh.onDomEvent (https://ckeditor.com/assets/libs/ckeditor5/15.0.0/ckeditor.js:5:422142)
    at lr.listenTo.useCapture (https://ckeditor.com/assets/libs/ckeditor5/15.0.0/ckeditor.js:5:207655)
    at lr.fire (https://ckeditor.com/assets/libs/ckeditor5/15.0.0/ckeditor.js:5:128164)

πŸ“ƒ Other details

  • MS Word version: 16.30
  • OS: OSX

It looks like the issue is that the second paragraph has a numbered list style applied, but list numbering is disabled via an inline style. This comes across the clipboard as

<p class=Customnumbered style='mso-list:none;tab-stops:.5in'>not numbered<o:p></o:p></p>

which causes this code to throw an exception since the mso-list is set to none, which the regex doesn't match.


If you'd like to see this fixed sooner, add a πŸ‘ reaction to this post.

@bendemboski bendemboski added the type:bug This issue reports a buggy (incorrect) behavior. label Nov 7, 2019
bendemboski added a commit to bendemboski/ckeditor5-paste-from-office that referenced this issue Nov 7, 2019
@bendemboski
Copy link
Contributor Author

Pull request with fix here

Reinmar added a commit to ckeditor/ckeditor5-paste-from-office that referenced this issue Nov 7, 2019
@Reinmar Reinmar added this to the iteration 28 milestone Nov 7, 2019
bendemboski added a commit to bendemboski/ckeditor5-paste-from-office that referenced this issue Nov 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:paste-from-office type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants