Opened 8 years ago

Last modified 7 years ago

#14614 confirmed Bug

Whitespace is removed when pasting content in visual mode

Reported by: John Whitlock Owned by:
Priority: Normal Milestone:
Component: Core : Pasting Version: 4.5.0
Keywords: Blink Webkit Firefox Cc:

Description

This behavior changed between v4.5.4 and v4.5.7. In v4.5.4, if you pasted content with whitespace, the whitespace was preserved. In v4.5.7, the whitespace is trimmed. It appears on the current demo page as well.

Steps to reproduce

  1. Open http://ckeditor.com/demo
  2. Switch to Source mode
  3. Add a fixed width section, like:
    <pre>
      |\_/|
     / @ @ \
    ( > º < )
     `>>x<<´
     /  O  \
    </pre>
    
  4. Switch back to WYSIWYG mode
  5. Copy the ASCII art
  6. Paste it. Consecutive whitespace is removed.
  7. Switch back to Source mode. Paste. Whitespace is retained

Expected result

In either visual or source mode, the whitespace is retained.

Actual result

Whitespace is only retained in source mode.

Other details (browser, OS, CKEditor version, installed plugins)

Also reproduces on developer.mozilla.org, using CKEditor v4.5.7. and plugins:

dialogui, dialog, a11yhelp, autogrow, basicstyles, bidi, blockquote, clipboard, panel, floatpanel, menu, contextmenu, dialogadvtab, elementspath, enterkey, entities, find, htmlwriter, image, indent, indentlist, button, menubutton, language, fakeobjects, link, list, liststyle, magicline, maximize, pastefromword, pastetext, removeformat, resize, scayt, sharedspace, showblocks, showborders, sourcearea, listblock, richcombo, stylescombo, tab, table, tabletools, toolbar, undo, wsc, wysiwygarea, mdn-attachment, mdn-format, mdn-sticky-toolbar, mdn-image-attachment, mdn-link-customization, mdn-link-launch, mdn-redirect, mdn-sample-finder, mdn-sampler, mdn-spell, mdn-syntaxhighlighter, mdn-system-integration, mdn-table-customization, mdn-toggle-block, mdn-wrapstyle, mdn-youtube, descriptionlist, tablesort, texzilla

Change History (5)

comment:1 Changed 8 years ago by Jakub Ś

Keywords: Blink Webkit Firefox added
Status: newconfirmed
Version: 4.5.74.5.0

Starting from CKEditor 4.5.0 white spaces are no longer preserved in Firefox, Webkit and Blink. IE works the same i.e. when you paste this art its rows get moved a little bit but that was also happening before version 4.5.0.

NOTE: @jwhitlock go to http://ckeditor.com/demo#full perform your steps but when around step 5, in wysiwyg mode click on the ASCII art and then click on pre in elements path. You will see that whole tag gest selected and when you copy paste it, result will be correct. You can use this as a workaround.

comment:2 Changed 8 years ago by John Whitlock

Thanks, that process works on the demo, but not on our website. I'm not sure if this is a CKEditor difference, or an interaction with one of the plugins.

We're tracking our bug in https://bugzilla.mozilla.org/show_bug.cgi?id=1268941

comment:3 in reply to:  1 Changed 8 years ago by Eric Shepherd

Replying to j.swiderski:

Starting from CKEditor 4.5.0 white spaces are no longer preserved in Firefox, Webkit and Blink. IE works the same i.e. when you paste this art its rows get moved a little bit but that was also happening before version 4.5.0.

Was this an intentional change? Is there a way to disable it? Requiring a workaround to get the content in the desired form is not great UX on a public site, so we kind of need to find a way to restore the previous behavior.

Thanks!

comment:4 Changed 8 years ago by Jakub Ś

Was this an intentional change? Is there a way to disable it?

It's a bug so it wasn't intentional. At the moment, you can use workaround I have given you.

so we kind of need to find a way to restore the previous behavior

The bug was accepted but final decision when to fix it will be taken by core development team. If you wish to have this bug fixed on demand, you should get SLA agreement which is part of https://cksource.com/enterprise.

comment:5 Changed 8 years ago by Jakub Ś

It turns out we have quite a few issues with pasting and they all may be related as they all can be reproduced from 4.5.0:
Styles Stripping: #13860, #13926, #14250, #14358
Styles stripping on Chrome in various test cases: #14921, #14593, #13753, #13751, #16454
ForcePasteAsPlainText pastes formatted HTML with Ctrl+V: #13969
Weird event pasting relation (not sure): #13763
White spaces not preserved: #14614
Problem with pasting in LibreOffice: #14622 (we do not support it but I have added this issue because general solution might also bring back old behaviour).

Last edited 7 years ago by Jakub Ś (previous) (diff)
Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy