How to Get TinyMCE to Format HTML Source Correctly in TinyMCE 2.0.6.1
From MODx Wiki
Note: This has been fixed in the latest SVN trunk of MODx 0.9.5. All users using prior versions will need this update.
Note 2: This only works in TinyMCE versions 2.0.6.1 and newer.
Contents |
[edit]
Fixing Source Formatting
To prevent TinyMCE from stripping your newlines and uglyifying your HTML, in:
/assets/plugins/tinymce/jscripts/tiny_mce/tiny_mce.js
[edit]
Turn On Apply Source Formatting
this._def("apply_source_formatting", false);
TO
this._def("apply_source_formatting", true);
[edit]
Turn Off Removing Linebreaks
this._def("remove_linebreaks", true);
TO
this._def("remove_linebreaks", false);
[edit]
You're Done!
And viola, nicely readable source.
Alternatively you can simply override these parameters, when initiating tinyMCE:
tinyMCE.init({
mode : "textareas",
theme : "advanced",
apply_source_formatting : true,
remove_linebreaks: false
});
