Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#11203 closed Bug (invalid)

CKEditor adding content automatically when viewed in Source Mode.

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

Description

Recently I upgraded CK Editor from 3.6 to 4.2.2 on my website for testing phase and when viewing my old data entered through CK Editor 3.6 , I am getting output which you can refer in screen shot.

HTML is getting appended automatically such as span and div tags in source content.

Attachments (1)

data_appended_to_my_original_content.txt (2.4 KB) - added by Ameya Sohoni 6 years ago.
details of original data and data in source mode.

Download all attachments as: .zip

Change History (10)

Changed 6 years ago by Ameya Sohoni

details of original data and data in source mode.

comment:1 Changed 6 years ago by Ameya Sohoni

Please refer the attached file for details.

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

Status: newpending

Hm... It doesn't look as CKEditor has something to do with this (except failing to parse that incorrect HTML). Those weird things are added by Chrome/Safari or some of addons you installed.

  • Could you describe how to reproduce this more precisely, so we could do that too?
  • What browser do you use and what extensions do you have installed?

comment:3 Changed 6 years ago by Ameya Sohoni

I use Chrome Version 31.0.1650.57 m and Firefox 25.0.1 for testing the changes and I have installed developer tools, firebug, webpg extensions for on my browser.

This issue is only coming for my old content , but when I try to add up a new Content from CK Editor it shows and works fine. The Old Data was inserted through CK Editor 3.6, so it may be Copy pasted or written from the editor while submitting data.

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

Ok. So what's the source (before loading to CKEditor) of the data inserted through CKEditor 3.6? Because I'm a little bit lost what's in that attachment.

comment:5 Changed 6 years ago by Ameya Sohoni

Before it was added in editor area it was copied from notepad++ and then pasted into editor area in CK Editor 3.6 .After that now I am fetching it from my Database so its rendering what i have in file. the first block in file is the source and the second one is the actual text added when CK Editor 3.6 was used.

I have no idea of Source for that text when it was added [ from CK Editor 3.6 ] .

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

Resolution: invalid
Status: pendingclosed
Version: 4.2.2

Unfortunately that source is so bad that neither CKEditor 3.6 nor CKEditor 4.2 will fix this. I have no idea what happened to that data and if it was CKEditor, Chrome or your backend/database, but your data have to be manually corrected now.

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

comment:7 Changed 6 years ago by Ameya Sohoni

So can you please tell me a fix for it maybe through Source plugin which will render the only part is understands and rest should be stripped or ignored.

because manually remove will take up a lot of time, which i suppose is not feasible as It will also tamper my data.

Any help which I can try at least to get a satisfactory result. Thanks.

comment:8 Changed 6 years ago by Jakub Ś

So can you please tell me a fix for it maybe through Source plugin which will render the only part is understands and rest should be stripped or ignored.

This isn't possible. Editor has some rules that it needs to follow and when it sees invalid HTML like whole table in font tag or div inside span tag it will try to fix it. There is no don't stick to specification switch.

Code you have shown us was most likely missing some crucial tag(s), tag closing and/or messed up quotes inside such tag.

The problem is that it is hard to say when it was done. Perhaps this invalid code was modified by editor 3.6 or by something in your application (some filter or regex)?

If you have more records with such data then please try getting it from DB (with some select or DB procedure), checking it with HTML5 validator, and then pasting it into editor (best standalone and not connected to your application).
I think validator will give you an idea what is wrong. If however there is a code that validates in HTML5 validator and doesn’t work in CKEditor, you should report it to us. Please bear in mind that we need source HTML that causes problems and not resulting HTML.

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

This isn't possible. Editor has some rules that it needs to follow and when it sees invalid HTML like whole table in font tag or div inside span tag it will try to fix it. There is no don't stick to specification switch.

It's not even about following some rules... That data does not even resemble the expected output. There's no text which should be there. Only a wizard could help ;)

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