ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Rich Text Editor - line breaks disappear

May 17, 2012 6:58am

Subscribe [37]
  • #46 / Dec 02, 2013 11:13pm

    coltonbrugger's avatar

    coltonbrugger

    3 posts

    +1

    Really, not fixed still. Very disappointing. Was trying to roll back clients from third-party WYSIWYG editors just to find that this basic line break functionality within RTE just doesn’t work.

    Very sad.

  • #47 / Aug 27, 2014 3:01pm

    turbo255

    45 posts

    Any official fix for this yet?
    8 months since the last post about this and still nothing, seriously??

    Running 2.7.2 on the site I’m launching soon for a client and I set ‘Auto br’ text formatting for a field called {article_body} and I get no line breaks or returns in the articles.

    I can only get it to work properly if I set “Allow override on publish page?” to ‘Yes’.

    I don’t think my client will want to have to remember to pick ‘Auto br’ formatting every single time they post a new article.

  • #48 / Aug 28, 2014 3:27am

    muabancanho

    6 posts

    topic usefull . thanks admin

  • #49 / Feb 19, 2015 10:35am

    chrishopkins

    1 posts

    6 months later, any update on this? I guess I’m just going to have to use a third party WYSIWYG, the one that comes with EE 2.9 doesn’t work as expected (it deletes your newlines).

  • #50 / Sep 10, 2015 9:35am

    Jason OD

    1 posts

    We had to make the adjustment too as it was critical for us to use the < br > line break tag in the Rich Text Editor (RTE). Here is the code that was changed for ExpressionEngine 2.10.1:

    Edit the file:

    /system/expressionengine/modules/rte/libraries/Rte_lib.php

    Comment out the lines in the save_field() function:

    452 // Strip newlines around 
    s
    453 //$data = preg_replace("#\n?(
    |
    )\n?#i", "\n", $data);
    
    455  // Strip 
    s
    456  //$data = preg_replace("#
    |
    #i", "\n", $data);

    Note: when you try to re-edit the Entry field, the < br > will have been removed in the RTE display. Saving it will cause the line break to be lost. In order to prevent this from happening, you will also need to comment out the following line in the display_field() function:

    528  //$data = preg_replace("/
    \n/is", "\n", $data);
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases