I've got CKEditor running under wysiwyg.module as per http://state68.com/content/setting-wysiwyg-editor-drupal-6 (in the interests of disclosure I should point out that that's my blog; I'm not linking to it here in order to promote it but in order to clarify this issue).
The "Source" button is enabled in the editor, so that I can get at the source code easily. The source code displays fine, but it's all compressed into one line. It would be great if the code included line breaks that were inserted at appropriate places. http://www.textfixer.com/html/uncompress-html-code.php achieves this nicely.
I appreciate that the "show source code" functionality might be provided by the editor itself, but it would be great if this fix could be applied at the module level so that it would work for all of the editors. I'm not sure if this is technically possible, but it would be good to know either way.
Comments
Comment #1
codewatson commentedWhile i've only used this with tinymce and am not sure if it works for ckeditor, when you configure the wysiwyg profile under the "Cleanup and output" section is an option called "Apply source formatting", if that is checked then the source code should get formatted so it doesn't all show up on one line. Again, i don't know if this is compatible with other editors, but it works for tinmyce.
Comment #2
twodThere's no explicit compresssion or minification of the contents. The editors rebuild the markup each time we get it from them and they are responsible for the source formatting. (Most of them have code that is MUCH better at it than what Wysiwyg could ever hope to do.) If "Apply source formatting" isn't checked, the editors don't have to insert whitespaces at all, which is probably what you're seeing.
We only support source formatting for editors which have that feature, which pretty much boils down to the more popular ones like CKEditor, TinyMCE, FCKeditor. Some of them have LOTS of ways to configure this but we haven't had time to make that configurable from within Wysiwyg. We've tried to enable settings which will produce reasonably similar results across editors when checking "Apply source formatting".
Note: The Teaser Break plugin may mess up source formatting if enabled. Especially in IE.