View Full Version : DS Rich Text Editor - Line Breaks

05-04-2011, 08:41 PM
1) Script Title: Ritch Text Editor

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex16/richtexteditor/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.

<P>apples are green and melons to.</P><BR>

anyone go any ideas here is the code im using

<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);

05-04-2011, 09:13 PM
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:

<?=str_replace("\n", '\n', $content)?>

What happens if you remove that line?

Or, possibly, what happens if you use:

<?=str_replace("\n", '<br>', $content)?>