Results 1 to 2 of 2

Thread: DS Rich Text Editor - Line Breaks

  1. #1
    Join Date
    May 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default DS Rich Text Editor - Line Breaks

    1) Script Title: Ritch Text Editor

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...itor/index.htm

    3) Describe problem: when editing a page that i have previously posted i constantly get multipul like breaks that i do not need e.g.

    Code:
    <P>apples are green and melons to.</P><BR>
    <P>&nbsp;</P><BR>
    <P>AIDS</P><BR>
    anyone go any ideas here is the code im using

    Code:
    <script language='JavaScript' type='text/javascript'>
    <!--
    
    //Usage: writeRichText(fieldname, html, width, height, buttons, readOnly)
    writeRichText('content', '<?=str_replace("\n", '\n', $content)?>', 500, 500, true, false);
    //-->
    </script>
    Last edited by Dava; 05-04-2011 at 08:43 PM. Reason: Didnt Finish

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    I don't think there is much you can do about this if it is just part of the script. However, on the demo page I don't see the same effect.

    I think this might be caused by your use of \n in the PHP:
    Code:
    <?=str_replace("\n", '\n', $content)?>
    What happens if you remove that line?

    Or, possibly, what happens if you use:
    Code:
    <?=str_replace("\n", '<br>', $content)?>
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •