How do I overcome the Magento CMS editor reformatting my html (removing new lines)

I write down this


And after I save it looks like this



Maybe these settings can help in tinymce.iniu

  remove_linebreaks : false,
  preformatted : true,
  • I have revised my original answer. Have you tried a different browser? – ProxiBlue Oct 12 '14 at 13:47

Note: I had revised my answer after some more investigations.

Although tinymce has hardly any code formatting capabilities (really, they are not something to go crazy over), it should not remove new lines.

Having had a look at magento 1.9 demo cms, I find it's formatting (for me in chrome) retains new lines. From http://www.tinymce.com/wiki.php/Configuration3x:remove_linebreaks this may be browser dependant.

Have you tried a different browser (chrome) to see if the same happens?

As previously stated: There are numerous modules available that replaces the default WYSIWYG with more modern ones. This would most likely be your best bet.

I do not have any personal experience with any of those, so cannot recommend a good one.

  • Which demo are you using? (url) thx – snh_nl Oct 13 '14 at 9:00
  • I use chrome. And if I test here then I see the same: demo-admin.magentocommerce.com/index.php/admin/cms_page/edit/… – snh_nl Oct 13 '14 at 11:35
  • I was using a local install of 1.9. I now also noticed (not did before) that your issue is surrounding the block tags. Notice that in your last div, there IS a new line, thus it is not the newlines per say that is stripped out, but only when you have the {{}} block insertions. – ProxiBlue Oct 14 '14 at 0:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.