Problem/Motivation

During the usability sessions, all participants were required to copy and paste from word, which is a pretty common use case. It created empty paragraphs in CKeditor. Many participants switched to source view to clear this up.

Proposed resolution

A quick google seems to give hope that this is a simple fix http://www.nodenerd.com/prevent-ckeditor-creating-empty-paragraphs-upon-...

Remaining tasks

Implement the config change
Test

User interface changes

No empty paragraphs in content! Whoop.

API changes

None

Data model changes

None

Comments

merilainen’s picture

The autoParagraph config mentioned in the linked blog post seems to be deprecated
http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-autoParagraph

merilainen’s picture

Status: Active » Needs review
StatusFileSize
new1.11 KB

I found some working javascript to fix this issue here http://stackoverflow.com/questions/17447274/ckeditor-4-removing-nbsp-and...

I added one more removal when pasting from LibreOffice and another for Pages, maybe somebody could test the Word removal on a PC with Word, since I'm on Mac OS X and I don't have Word installed.

Also I'm not sure if the code is properly formatted, not very experienced javascript writer, especially not sure if this is done in a correct Drupal way.

merilainen’s picture

StatusFileSize
new420.6 KB
new673.21 KB

Uploaded before and after screenshots.

wim leers’s picture

This is related to the long pre-existing issue #1955300: Ensure CKEditor's "Paste From Word" feature works stellarly before Drupal 8 release.

@mErilainen: Could you instead test #2521820: Update CKEditor library to 4.5.3, which should fix this? Ideally, we don't have work-arounds like this one that we have to maintain ourselves (and that WILL become outdated/incomplete).

merilainen’s picture

StatusFileSize
new472.19 KB

I did a fresh install after applying the patch in the other issue, then created a new article by copy-pasting text and it seems to work fine. Tested again from LibreOffice and Pages.

wim leers’s picture

Status: Needs review » Closed (duplicate)

Woooot! :) :) Then closing this in favor of #2521820, see #2521820-26: Update CKEditor library to 4.5.3 :)