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 removing <p> tags from text

May 12, 2013 12:13pm

Subscribe [23]
  • #1 / May 12, 2013 12:13pm

    teel

    1 posts

    I have a problem with rich text editor removing paragraph tags from text every time I save an entry. This results in really ugly text, not to mention semantically broken articles. How can I prevent this?

    I have the latest version of EE (2.6.1)

  • #2 / May 15, 2013 5:34am

    megatrond

    6 posts

    I too have this issue, but the strange thing is the first entry from a {exp:channel:entries} tag is rendered correctly. Subsequent entries are stripped of all p tags.

    The tags are shown correctly in the editor.

    EDIT: There are also empty p tags at the end of almost every entry

  • #3 / May 15, 2013 11:21am

    NiB

    2 posts

    Same issue here :/ everything is ok in the backoffice, but tags are stripped when ee renders the page

  • #4 / May 15, 2013 1:49pm

    Riverboy's avatar

    Riverboy

    2993 posts

    dunno if this help at all but would it be some sort of semi-solution that you just put your textarea shortname-tag inside of p-tags in the template?

    And i would make a bug report with example codes and more info (what fieldtype etc. is used).?

  • #5 / May 15, 2013 2:14pm

    megatrond

    6 posts

    I’ll file a bug report tomorrow.

    Strange thing I found out - if I switch the field to a normal textarea fieldtype all text is rendered inside p tags again, so that’s a workaround for now.

    Also the problem seem to be that the string from the database isn’t tagged with the proper text_format, i.e the first entry is tagged with ‘xhtml’, but the subsequent ones are tagged as ‘none’, and thus the string isn’t sent to the auto_typography() method in (I think) EE_typography.php

    Why this only happens to the rest and not the first entry I haven’t been able to figure out.

  • #6 / May 15, 2013 2:37pm

    Riverboy's avatar

    Riverboy

    2993 posts

    I have run into troubles with 3rd party fieldtypes (Wygwam and such) and i think all issues on those are related in what version of PHP the system is using where EE is installed. Maybe the issue with native Rich Text fieldtype is somehow also affected by what version of php is behind the scene?

     

  • #7 / May 15, 2013 2:39pm

    NiB

    2 posts

    i installed wygwam and when i look at source code, i have my

    tag plus a ​

    which is unicode for ZERO WIDTH SPACE… maybe it is the trouble source

  • #8 / May 15, 2013 2:53pm

    Riverboy's avatar

    Riverboy

    2993 posts

    Well i had to deinstall Wygwam for the moment at least and i started (bought) DevDemons Editor (that also has issues but not that big ones that i had with PT’s fieldtype).

    We tracked issues with PT’s Wygwam and one point was that if the php’s magic_quotes_gpc”  was enabled in php.ini, it did make a total mess when using the fieldtype via front end, or at least that was one idea what might tricker some holymoly things when editing.

    Now im waiting to get my php to latest and i will then testdrive all and see if the version of my php was the one and only reason behind my issues… (i so hope so)....

  • #9 / May 16, 2013 3:22am

    megatrond

    6 posts

    Ok, so I found out some more - the incorrect rendering is only happening if I add a ordinary textarea fieldtype into the entries tag.

  • #10 / May 16, 2013 3:51pm

    Pascal Kriete's avatar

    Pascal Kriete

    2589 posts

    I haven’t reproduced yet, but it definitely sounds like something is wrong. One of our goals with the rte is that it simply works as you would expect, so let’s see if we can’t get this figured out.

    Could I get everyone to confirm three things:
    1) EE version
    2) PHP version
    3) Field formatting (xhtml, br, or none) in the database

  • #11 / May 16, 2013 4:14pm

    megatrond

    6 posts

    I’ve filed a bug report, let’s see if it turns something up.

    In the meanwhile, here’s a pastie detailing the problem: http://pastie.org/7914803

    EE: 2.6.1
    PHP: 5.4.4
    Field formatting in the database is set to xhtml.

    Also, if all fields within the channel entries tag are xhtml, everything works dandy.

  • #12 / May 16, 2013 4:23pm

    Pascal Kriete's avatar

    Pascal Kriete

    2589 posts

    Aha! Found it.

    In system/expressionengine/modules/rte/ft.rte.php around line 80 where it currently reads:

    array(
        'html_format' => $this->row['channel_html_formatting'],

    Change that to:

    array(
        'text_format' => 'xhtml',
        'html_format' => $this->row['channel_html_formatting'],

    EDIT: I don’t see your bug report.

  • #13 / May 16, 2013 4:31pm

    megatrond

    6 posts

    Ticket number is 73299

  • #14 / May 17, 2013 1:10am

    Clive Portman's avatar

    Clive Portman

    83 posts

    In system/expressionengine/modules/rte/ft.rte.php around line 80 where it currently reads:

    array(
        'html_format' => $this->row['channel_html_formatting'],

    Change that to:

    array(
        'text_format' => 'xhtml',
        'html_format' => $this->row['channel_html_formatting'],

     

    That works for me,
    Clive

  • #15 / May 21, 2013 5:14am

    megatrond

    6 posts

    Yeah, that fixed it! Thanks!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases