On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • I haven’t really seen any central location to figure this out, so I figured I’d just post a thread here. I know this works in the latest SVN trunk, but it should theoretically work in any MODx release that has TinyMCE 2.0.6.1 installed.

    To prevent TinyMCE from stripping your newlines and uglyifying your HTML, in:

    /assets/plugins/tinymce/jscripts/tiny_mce/tiny_mce.js

    change:

    this._def("apply_source_formatting", false);
    TO
    this._def("apply_source_formatting", true);

    AND change:

    this._def("remove_linebreaks", true);
    TO
    this._def("remove_linebreaks", false);


    And viola, nicely readable source.
      shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
    • Heh heh...you’re one step ahead of me! I’m addressing this in the next update for the TinyMCE plugin. And, instead of altering the TinyMCE javascript file directly, I’ll be setting these parameters in the call to TinyMCE. But, yeah, your solution works too...which is ok till I get the next update out. smiley
        Jeff Whitfield

        "I like my coffee hot and strong, like I like my women, hot and strong... with a spoon in them."
      • Alright, thanks a lot for this trick, finally the source will be human-readable as well :p
        • I’ll be committing this trick until the updated version is available... wink
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me