Opened 3 years ago

Closed 3 years ago

#14888 closed Bug (invalid)

Editor removing some tags when html content is copied and pasted in source button.

Reported by: Anjaneyulu Owned by:
Priority: Normal Milestone:
Component: General Version:
Keywords: Cc:

Description

Steps to reproduce

  1. Click on source button
  2. Copy the content from this link http://www.w3schools.com/icons/tryit.asp?filename=tryicons_awesome

and paste it in source view.

  1. Now close source view and see the view,changes are not reflected completely.

Expected result

It should not delete <i> tags.

Actual result

it deletes all <i> tags from source.

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

All browsers (tested on firefox ,chrome, and Edge), tested on windows OS

Change History (1)

comment:1 Changed 3 years ago by Jakub Ś

Component: UI : Source ViewGeneral
Resolution: invalid
Status: newclosed
Version: 4.5.11

The problem is that you use i as an icon and its meaning is different. I know it is heavily used (e.g. by Facebook) but because you go against the specification this causes problems.

First of all this tag is not allowed by default to be used with styles classes or attributes by ACF. Second, it is an empty inline tag which by default is treated as garbage and removed from the editor. Third because it means italic text, it is used in core styles and in order to have it used in the editor you need to allow it in core styles as well.

CKEDITOR.dtd.$removeEmpty.i = 0;
var editor = CKEDITOR.replace( 'editor1', {
	extraAllowedContent : 'i{*}(*)[*]',
	coreStyles_italic : { element: 'i', overrides: 'em' }
});
Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy