Opened 6 years ago

Closed 6 years ago

Last modified 23 months ago

#11110 closed Bug (fixed)

Image2: iframes/flashes are converted into image2 widgets when pasted

Reported by: Marek Lewandowski Owned by: Piotrek Koszuliński
Priority: Normal Milestone: CKEditor 4.3
Component: General Version: 4.3
Keywords: Cc:

Description (last modified by Marek Lewandowski)

Image2: iframes/flashes are converted into image2 widgets when pasted

since: 4.3 until major

It seems that currently enabling image2 plugin will convert iframes/flashes into its widget.

  1. open image2 sample (/samples/plugins/image2/image2.html)
  2. switch to source mode
  3. input following code
    <p>n t<iframe frameborder="0" scrolling="no" src="www.wikipedia.org"></iframe>e d</p>
    
  4. switch back to wysiwyg mode
  5. ctrl+a (select all)
  6. ctrl+c (copy)
  7. move cursor at the end of content
  8. ctrl+p (paste)

Expected result:
Pasted content should contain iframe. Produced source code:

<p>n t<iframe frameborder="0" scrolling="no" src="www.wikipedia.org"></iframe>e dn t<iframe frameborder="0" scrolling="no" src="www.wikipedia.org"></iframe>e d</p>

Current result:
Pasted content contain image2 instead of an iframe. Code with image:

<p>n t<iframe frameborder="0" scrolling="no" src="www.wikipedia.org"></iframe>e dn t<img alt="IFrame" src="http://presets.ckeditor.dev/4.3/full-all/ckeditor/plugins/fakeobjects/images/spacer.gif?t=DA89" title="IFrame" />e d</p>

additional info:

  1. issue does not occur for other widget-based plugins like mathjax, placeholder
  2. issue seems to be cross browser

Change History (8)

comment:1 Changed 6 years ago by Piotr Jasiun

Status: newconfirmed

comment:2 Changed 6 years ago by Piotrek Koszuliński

Milestone: CKEditor 4.3
Owner: set to Piotrek Koszuliński
Status: confirmedassigned

comment:3 Changed 6 years ago by Piotrek Koszuliński

Status: assignedreview

Pushed t/11110 on dev and tests.

comment:4 Changed 6 years ago by Piotrek Koszuliński

Status: reviewreview_failed

Pasting still does not work ;|

comment:5 Changed 6 years ago by Piotrek Koszuliński

Status: review_failedreview

It turned out that fakeobjects does not allow HTML which it requires, so when there is no image plugin (which allows all classes), the cke_iframe class was stripped.

I pushed the easiest fix for that I could think of - we just allow all important properties on images with data-cke-realelement attributes. It's not ideal, because ideally we should be more precise (and filter the real element's HTML), but fakeobjects is kind of old-school plugin, so we can accept this solution.

The dev changes should not have impact on editor's behaviour, however, may have on tests.

comment:6 Changed 6 years ago by Frederico Caldeira Knabben

Status: reviewreview_passed

comment:7 Changed 6 years ago by Piotrek Koszuliński

Resolution: fixed
Status: review_passedclosed

Fixed on major with git:bfd103821 on dev and 358db53 + 9fdbc07 on tests.

Last edited 6 years ago by Piotrek Koszuliński (previous) (diff)

comment:8 Changed 23 months ago by Marek Lewandowski

Description: modified (diff)
Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy