Hi:
I have looked all over and cannot find the answer to this question. We have CK Editor installed with Drupal 7. It works fine, however, it "changes" the HTML in ways that break our code. I have it set to a text format that is set to make no changes at all to the HTML. However, when you load the editor, it re-arranges the code, it puts in extra
tags, amoung other things. It seems that if I save the HTML without the editor, things work fine, but as soon as I load the editor, it breaks my html.
Is there any way to stop the editor from doing any "processing" of the html? It seems like it is trying to clean it up, but that is actually breaking it for our content.
Please let me know any ideas. I have tried everything I can think of. I would prefer not to have to re-write the entire content base along with all the css styles that control it. So, any solutions are welcomed.
Thanks.
Maxx
Comments
Comment #1
David Latapie commentedI have the exact same problem. I moved to Full HTML, I deactivated "correct broken or choppy HTML"... No success, HTML is still changed. I know it comes from ckeditor, because when I deactivate ckeditor, it worked fine. Also, a lot of people are reporting this.
Does Drupal 8 fix this? How to fix it for D7?
A stupid piece of code should not assume it knows HTML better than I do! If I want
<samp>,<var>,<code>or<del>in my code, don't messle with it! As someone stated "The idea that CKeditor knows better and should protect people from their mistakes is one that should have been dismissed from the start."By the way, this also holds true for Drupal's interpretation of the
<code>element, but at least this one I expect it to be deactivable.Comment #2
David Latapie commentedComment #3
hmartens commentedI experience the same problem and it's very irrirating as I use Fontawesome icons where you use the tag and when I save it I can see the icons but when I click edit again I don't see that code, although it's still there because the icons still apear, but when I click edit and I click on the Sourcecode button, the code is not there.
Very fustrating!
p.s I'm using jquery 1.8 if that helps.
Comment #4
David Latapie commentedIt seems to be fixed with Drupal 8 (at least with 8.0x-dev, I did not check with beta6, which has another unrelated but very annoying bug). You can test by going to http://simplytest.me and type Drupal Core on the left and select the 8.0x branch on the dropdown menu on the right.
Comment #5
hmartens commentedI found a solution to my issue in another forum and this worked for me:
Go to /admin/config/content/ckeditor/edit/Full and under the "Advance Options" add the following line under "Custom JavaScript configuration" :
I added the following code:
config.allowedContent = true;
config.extraAllowedContent = 'p(*)[*]{*};div(*)[*]{*};li(*)[*]{*};ul(*)[*]{*}';
CKEDITOR.dtd.$removeEmpty.i = 0;
After this Ckeditor didn't hide my empty tags. Hope this helps someone ;)