I have made many websites and I have mostly stuck with TinyMCE as a choice of wisiwyg editor. My greatest concern with TinyMCE in Drupal has been that when you click on "Souce" button or "HTML" or "Disable rich text",it gives you a popup with allof the HTMLcode piled into a one continuous pile of code. This is really a pain in the neck, because it becomes impossible to read that code. This doesn't happen in Wordpress which preserves the line-breaks within the code and you can quickly switch between TinyMCE and HTML tabs to see the source code, and edit it if necessary.

Is this a bug? if not, how can we make the source code appear with line-breaks again?

Thank you!


TwoD’s picture

Category:bug» support
Issue tags:-tinymce, -#wysiwyg

The source formatting option is turned off by default but can be enabled under "Cleanup and output" -> "Apply source formatting" when configuring an editor.

Exactly what the formatted source code will look like depends on the editor as they don't use the same rules for indenting and newlines. We've tried to configure those that support source formatting so the output becomes reasonably similar. To some extent, it also depends on which browser is being used and which plugins are enabled. (Our Teaser Break plugin in combination with IE is a notoriously bad combination because IE it does not care much about what markup looks like when fetched via the .innerHTML property.)

Please note that manually inserted whitespaces won't always be preserved because they are allowed to be collapsed when parsing HTML and editors generate the markup from scratch each time they sync contents back to the original textarea or show it in "source mode".

TWD’s picture


TwoD’s picture

Status:Active» Fixed

@TWD There's a "Follow" button at the top for doing just that.

Since there's been no additional info or questions, I'll mark this fixed. Please change the status back to "active" if you comment.

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.