Hi, I'm using CKEditor and Wysiwyg with Drupal 7, and I'm having a problem where my HTML source code is being reformatted, so HTML I enter like this:
<p>Para 1</p>
<p>Para 2</p>
gets turned into this:
<p>Para 1</p><p>Para 2</p>
Ideally I'd like the source code to not be reformatted at all, but if it is going to be reformatted, I'd like it to look like this:
<p>Para 1</p>
<p>Para 2</p>
or this:
<p>Para 1</p>
<p>Para 2</p>
I've read a number of things about editing ckeditor.config.js in sites/all/modules/ckeditor, or editing ckeditor.js in sites/all/libraries/ckeditor, but nothing I've tried is working. For instance, I've tried adding this block of code to either config file, clearing the browser cache, and re-testing:
CKEDITOR.on( 'instanceReady', function( ev ) {
this.dataProcessor.writer.setRules( 'p',
{
indent : false,
breakBeforeOpen : true,
breakAfterOpen : false,
breakBeforeClose : false,
breakAfterClose : true
});
});
So, I'm wondering if this is a bug, or something I'm doing wrong.
Also, it may help to know that in Text Formats (admin/config/content/formats) the only filter I have enabled is "Converts Media tags to Markup", and in the Wysiwyg profile (admin/config/content/wysiwyg) for the Full HTML input format, in the Cleanup and Output section I have the "Verify HTML" checkbox selected, and none others.
If this is a bug, I'll be glad to test any patches that are needed. (Also, I haven't posted a bug or question like this here before, so I hope I've done this correctly.)
Thanks,
Al
Comments
Comment #1
jcisio commentedIt looks like you're using wysiwyg.module, disable it first. Don't use both.
The correct file to editor is ckeditor.config.js in the module folder (or you can move it to your theme folder, there is an option for that), or better, edit directly in the CKEditor profile settings page.
Even better, instead of doing those modifications, there is an option for them! You don't have to edit anything, just check some checkboxes.
Comment #2
alvinj commentedThanks. Yes, I am using both ... honestly, I don't remember why, though I'm sure I read it somewhere. I'll give this a try.
Also, thanks for letting me know which file to edit, that wasn't clear to me, so I kept trying my changes in both files.
I'll close this "bug" if everything works. Thanks again.
Comment #3
alvinj commentedThis definitely does improve the HTML output, so I'm closing this "bug".
After switching back to using just the CKEditor, I remember why I was using Wysiwyg and CKEditor: I wanted to be able to use the Media module, and this looked like an easy way to get that functionality.