We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18899
    • 9 Posts
    I can’t figure out why this happens in both TinyMCE and FCKEDitor but when I edit the HTML source go to the WYSIWYG editor and then go back to view the HTML source the source never stays the way I left it.

    For example, if I change this:
    <p>This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.</p>

    to this:
    <p>This is some <strong>sample text</strong>.
    You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.
    </p>

    When I go back to the source view the content again looks like this:
    <p>This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.</p>

    Am I doing something wrong?
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Line breaks do not transfer to HTML code. If you want a line break, you need to use
      tags.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 18899
        • 9 Posts
        sottwell,

        Thanks for the reply, I think maybe I wasn’t clear or used the wrong terminology.

        When I’m editing the source code and make changes such as breaking the source into multiple lines when I go to the WYSIWYG editor and then back to source the source is no longer on multiple lines.

        In my example no matter what I do the source alway reverts to being on the same line.

        How do I change the source so that it retains any formatting changes I make?
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Just making a new line in a WYSIWYG editor does not automatically add a
          tag to the HTML. If you do not have a
          tag in the HTML, you will not get a new line. Certain HTML tags automatically cause the browser to break to a new line; <p> tags and <li> tags are some others besides
          that do so. Having a line break in text does not.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 18899
            • 9 Posts
            sottwell,

            I’m not making the new line in the WYSIWYG editor, I’m making it in the source. My question concerns only editing and viewing code in the source. I put in the part about the WYSWIG editor just the make the point that the source changes/reverts when I leave the source, go to the WYSIWYG editor and then go back to the source. I’m not making any changes in the WYSIWYG editor.
              • 22303 MODX Staff
              • 10,725 Posts
              I believe the RTE’s both have default options that "cleanup" the source, causing this "reformatting", but where or how to set those, I can’t recall at the moment.
                • 18899
                • 9 Posts
                For TinyMCE, the "cleanup" option is at Resources/Manage Resources/Plugins/TinyMCE/Configuration. I disabled cleanup but I am still getting the same results.
                  • 22303 MODX Staff
                  • 10,725 Posts
                  http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/remove_linebreaks maybe?
                    • 18899
                    • 9 Posts
                    No, that didn’t work either.