I am using CKEditor 4.1 and it is changing my html.
For example:
If I pass in "<p> </p> <a href="">test</a>" it changes it to "<p></p> <a href="">test</a>".
Notice that the is stripped out.
I have the following set:
CKEDITOR.config.allowedContent = true; // don't filter my data
Is there a configuration that will tell the editor to not change my html AT ALL?
update
I made the following configuration changes and my are preserved. But I didn't find a case where it isn't in IE9. My user has a soft-hypen in the html. So if i have <p>­ </p> it isn't preserved in IE9. It seems fine in chrome.
CKEDITOR.config.enterMode = CKEDITOR.ENTER_BR;
CKEDITOR.config.forcePasteAsPlainText = false; // default so content won't be manipulated on load
CKEDITOR.config.basicEntities = true;
CKEDITOR.config.entities = true;
CKEDITOR.config.entities_latin = false;
CKEDITOR.config.entities_greek = false;
CKEDITOR.config.entities_processNumerical = false;
CKEDITOR.config.fillEmptyBlocks = function (element) {
return true; // DON'T DO ANYTHING!!!!!
};
CKEDITOR.config.allowedContent = true; // don't filter my data
First one isn't error, second is
I figured out the issue 1. It
I figured out the issue 1. It was being caused by running the YUI minify dll on ckeditor on deployment. I turned it off and now it works. I'm still having a number of content issues though.
1. I have custom tag that are messing up real tags. So I have <p><answer ></p>. The closing p is being converted to an opening p "<p>".
2. http://dev.ckeditor.com/ticket/9998 <-- styles and span tags being added
3. http://dev.ckeditor.com/ticket/10146 < -- br tags are being removed. The workaround is causing tags to be added so content is still being changed.
I need a way for the html, regardless of whatever it is, is not automatically modified on load.
If br is the last element in
If br is the last element in the html it's removed. So if I have "testing *html for br" only "testing" is kept.
This is an important issue
This is an important issue that seems to get worse over time, not better. Source mode is typically going to be used by people with existing valid HTML fragments. The idea that CKeditor knows better and should protect people from their mistakes is one that should have been dismissed from the start. "Don't touch my HTML" should be the DEFAULT behaviour for source view. I've tried all the options like autoParagraph, allowedContent, fillEmptyBlocks, etc but there seems to be no straightforward answer to make CKEditor and plugins leave source changes alone.
A simple search of this forum and Google show an almost daily repetition of "ckeditor is changing my X ..." threads and tickets. I can accept that some responsibility lies with the browser (especially IE) but there is no reason for CKEditor to make things worse.
If the developers feel it's too late to change the default behaviour then at least give us a single unambigious preserveSource option that prevents all other source auto "correction" regardless of whether it is core or plugin related and regardless of whether the fragment is "valid" or "dangerous". These are all value judgments that presume knowledge of the fragments' purpose and intended usage.
In summary, please provide a SINGLE, unoveriddable option to: not change my entities, not fix my unclosed tags, not add "missing" tags, not change whitespace and indents, not remove empty elements, not correct Word snippets, not remove scripts, not replace tags, not remove unknown tags, not remove doctypes, not remove comments, not change html to xhtml, not do anything to the source - ever!
The only way to preserve the
The only way to preserve the HTML source without any change is to use a textarea, not a wysiwyg editor.
some of the issues that you have mentioned are due to the browsers themselves, and so it's pointless to keep talking bad about the editor when the problem is not it.
Check this simple test: http://jsbin.com/uxuxik/2
The <p> shows as closed although I've left it open in the source, the "repeater" element is also automatically closed and in Firefox and Chrome is moved before the table.
If the browser parses that code that way, how do you expect CKEditor to revert back those changes?
How is the br tag being the
How is the br tag being the removed when its' the last element a browser issue?
What about the ACF being turned on by default and stripping my html a browser issue?
I understand that ther must be valid html but I don't want anything removed or encoded automatically on load.
I said that some of the
I said that some of the issues are due to the browsers, not all of them; and ACF being turned on or off is just a setting. You can change it to whatever you prefer but that won't fix the problems that aren't related to it.
Just stating "don't change my HTML" only has one answer: don't use a WYSIWYG editor.
On the other side talking about specific issues like that last <br> being removed is surely due to a bug in CKEditor, so if you want to see it fixed you can try to debug the code and find out what's going on, that might speed up getting a fix.
Ok. Since you are defensive I
Ok. Since you are defensive I will change what I would expect.
Being a paying customer I would request that my html not be changed incorrectly (this is not the only issue).and when I find bugs with the editor it be fixed in a timely manner.
Better?
Timely manner, that would be
Timely manner, that would be nice.
Does that apply only to the bugs that you report or that anyone else reports?
Because there are too many bugs filed right now that have been reported for a very long time and you can bet that the people that reported them are expecting them to be fixed. And in some bugs there are even patches that fixed the bug but even then the bug is still being ignored.
Because if they just focus on your bugs, then they won't have the time to look at other issues and you can bet that some other people are also paying customers and so they should have the same priviledges as you.
It would be nice if it were
It would be nice if it were just
my bugsyour bugs that I report but I understand that there are others to look at also.The large number of bugs filed is a reflection of your attention to detail, not my request for resolutions in a timely matter.
Instead of argueing with a customer about his frustrations with your product you should concentrate on something you CAN change.
It seems that you're too
It seems that you're too confused:
I'm not a CKSource employee, I don't speak for CKSource and probably CKSource might disagree with whatever I say.
All the CKSource employees are using a signature stating that, so I don't understand why you think that I speak for CKSource.
My way to change things is to propose fixes for the bugs that affect me, not to rant about them.
I thought you were an
I thought you were an employee just based on how defensive you are. I didn't realize you were just an adoring fan.
An employee would rather
An employee would rather avoid answering because these topics are a waste of time and people don't like to be told that they can't have their magical solution.
Certainly I'm not an adoring fan, I think that currently CKEditor is the best one currently available, but it has lots of bugs and problems. And surely I've cursed CKEditor far more times that you will ever do.
And I just pointed out that mixing browser bugs with issues due to CKEditor is a dead way, but you don't like to hear that. And in no way ranting about your favorite bugs will speed up fixing them.
First of all, thanks Alfonso
First of all, thanks Alfonso for clarifying few things in this topic, because most of what SpliFF and jnoreiga wrote is just complete nonsense. You're right that most of us avoid answering in such threads, although from time to time a situation is becoming so ridiculous that it is time to speak.
By buying a commercial license AFAIK you're buying a support, not a custom development. Therefore you cannot request from us to fix issues you report, because you haven't paid for that. I'm not saying that we ignore bug reports - I would love to fix most of the real bugs (not an incorrectly understood behaviors), but we're not able to do this. Developing WYSIWYG editor is a real pain in the ass (read my summary of the current situation in browsers) and thanks to that: a) fixing issues takes a lot of time, b) we are generating more issues than we normally would because problems we need to solve are so complicated.
CKEditor is not a code editor, but a WYSIWYG editor. You might be confused by the presence of source mode, but there's a huge difference between them. In fact, personally I think that we should head in the direction where the source mode would be redundant. Most often it is needed when a user (a developer in this case, cause he knows HTML) wants to insert/change something what is not possible with the UI. But this is only a replacement of the real solution which is needed. Developer can write HTML - he does not need a WYSIWYG editor. Normal users, on the other hand, need WYSIWYG editor, so they should be able to edit entire documents in WYSIWYG mode. To achieve this editor needs to be correctly configured (styles, templates, formats, etc.) and it needs new features like widgets on which I'm currently working on.
So again - if what matters for you is "LEAVE MY HTML AS IT IS", then use a code editor, not a WYSIWYG editor. Code editor cares about your code, WYSIWYG editor cares about yours document contents (created in WYSIWYG mode). And carrying about contents requires from us not carrying about (very often invalid from semantical or spec's POV) HTML so much.
BTW. I wonder if community's better knowledge about contenteditable and how WYSIWYG editors work would help in such cases. I believe so, so I'm working on article about that.
I hope we'd avoid such ridiculous requests :|.
Piotrek (Reinmar) Koszuliński
CKEditor JavaScript Developer
--
CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+
This started as a simple
This started as a simple question:
Instead of answering that simple question with a "no" this has evolved into a debate on whether users should be using CKEditor for code editing.I'm glad what I'm paying for is this
"support"lack of support in answering a simple question. The original question was asked out of frustration that your editor is removing formatting. The simplest question would then be, can you set the editor to not change anything so I asked it after searching and not seeing any response on other posts.Since the answer to this question is no, the next logical question would be: can the editor not change my html incorrectly. Removing the br tag and removing tags that have the soft hypen in them are not browser issues so don't make excuses.
BTW. the only thing ridiculous is the support provided and the excuses made for buggy software.
I would not consider fixing
I would not consider fixing bugs in the software a magical solution.
If you followed the thread it started with a simple question; which no would have been a fine response to. Then I found 2 bugs that are not browser issues.
I logged tickets for these bugs and I'm now waiting for patches. There is no ranting about favorite bugs because there are way too many to choose from. Just responding to your undying support.
FFS. What a hostile community
FFS. What a hostile community and even the devs!
There is nothing RIDICULOUS about asking CKEditor to leave the source alone. It does not NEED to be injected back into contenteditable as that is an implementation issue (it could just as easily be written UNMODIFIED into a textarea/memory backing store and retreived with getData regardless of the contentEditable state). A simple "Save Source" button would suffice.
Your assumption that source mode is not used or unnessessary is completely wrong. I have put ckeditor into about 30 client websites and at least 5 of those clients use the source mode regularly (1 in every 6 clients). Most of those use the source mode because of limitations in the WYSIWYG mode.
Your statement that this is a browser issue is also wrong. While I can't speak for jnoreiga I can say that I specifically mentioned that I can accept browser limitations if I have to but this is about those changes made by ckeditor. I KNOW ckeditor makes changes because the behaviour of several of the issues raised has changed between ckeditor versions but not browser versions - ergo; ckeditor modifies the source and does not document clearly the ways in which it does so or the means of disabling it entirely. It took me several hours to piece together a set of configuration options and they still don't disable all of ckeditors changes.
This could have been a civilised discussion but all you've done is muddy the issue and insult your clients. Call your clients ridiculous and tell them what they need at your own peril.
You've made this topic a mess
You've made this topic a mess before I even read it. You found Alfonso being too defensive, as you thought a developer would be, but you couldn't be more wrong. He is neither a core developer nor a blind fan. His feedback, often quite negative, is always very helpful. And you accused him of being too defensive...
I've read the beginning of this thread one more time now and I see that all questions were answered. You fixed your original issue (which I'm not able to reproduce) and j.swiderski reported a ticket for the ­ case which might be caused by editor or by the IEs - hard to tell now.
Then you listed 3 issues:
But the only question was:
And as was answered - it is impossible. Editor needs to prepare the content to be loaded to the contenteditable, then browser does its changes and then editor have no information what was the intention of source's author before all this.
EOT for me.
Piotrek (Reinmar) Koszuliński
CKEditor JavaScript Developer
--
CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+
Wow what a mess
I am looking for a solution to the serious problem I experience in an email marketing product I bought which has CKEditor as part of it. I have clients who create their own HTML Emails - when it is pasted in the product I bought CKEditor WYSIWYG editor, the HTML that appeared fine in a browser (IE, Chrome, Safari, etc) beofre is changed by CKEditor - resulting in an unacceptable end result.
From the arrogance and antagonism I read in this thread towards the simple question asked initially, it seems that I should have been more careful when I bought a product that uses CKEditor - because I DO NOT WANT IT TO CHANGE THE HTML I PASTE INTO THE EDITOR. So, maybe you should tell the world more boldly that you change the HTML you allow them to enter in order to make your maintenance of the product easier BEFORE they use it as part of their products they sell on to unsuspecting idiots like me.
Pity
CKEditor is a WYSIWYG editor
CKEditor is a WYSIWYG editor for documents, not an HTML editor or a WYSIWYG website builder. Because of the job it is supposed to do and technologies we can use, it has to "touch" loaded HTML. We are not responsible for other developers choosing wrong tool for the job or not configuring CKEditor properly.
Piotrek (Reinmar) Koszuliński
CKEditor JavaScript Developer
--
CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+
Thhanks but oyu remain evasive
Thank you. I agree in principle, but then those product vendors should also be advised by you because they are clearly not. You also now refer to configuring CKEditor "properly" which can clearly NOT be configured to do this. So, your product does WYSIWYG and should not allow the user to see or change the HTML. Remove that button/functionality and then all confusuoin will go away !
Enough said on this topic and no further "clever" response required thanks,
how can i keep the space between textarea tag when we toggele..
Hi All,
how can i keep the space between textarea tag when we toggele the source to UI mode like the following <textarea> </textarea>
what i mean to say here is where can i add this space in Ckeditor.js(I think) ,this is only for textarea not for others so can any one help me.
Thanks in advance