Index: misc/teaser.js =================================================================== RCS file: /cvs/drupal/drupal/misc/teaser.js,v retrieving revision 1.10 diff -u -p -r1.10 teaser.js --- misc/teaser.js 13 Nov 2007 14:04:08 -0000 1.10 +++ misc/teaser.js 29 Nov 2007 12:49:40 -0000 @@ -21,14 +21,17 @@ Drupal.behaviors.teaser = function(conte $(body).before(teaser); $(parent).remove(); - function trim(text) { - return text.replace(/^\s+/g, '').replace(/\s+$/g, ''); + function ltrim(text) { + return text.replace(/^\s+/,""); + } + function rtrim(text) { + return text.replace(/\s+$/,""); } // Join the teaser back to the body. function join_teaser() { if (teaser.val()) { - body.val(trim(teaser.val()) +'\r\n\r\n'+ trim(body.val())); + body.val(ltrim(teaser.val()) + rtrim(body.val())); } // Hide and disable teaser $(teaser).attr('disabled', 'disabled'); @@ -47,8 +50,8 @@ Drupal.behaviors.teaser = function(conte var text = body.val(); // Note: using val() fails sometimes. jQuery bug? - teaser[0].value = trim(text.slice(0, split)); - body[0].value = trim(text.slice(split)); + teaser[0].value = ltrim(text.slice(0, split)); + body[0].value = rtrim(text.slice(split)); // Reveal and enable teaser $(teaser).attr('disabled', ''); $(teaser).parent().slideDown('fast'); @@ -66,8 +69,8 @@ Drupal.behaviors.teaser = function(conte // Extract the teaser from the body, if set. Otherwise, stay in joined mode. var text = body.val().split('', 2); if (text.length == 2) { - teaser[0].value = trim(text[0]); - body[0].value = trim(text[1]); + teaser[0].value = ltrim(text[0]); + body[0].value = rtrim(text[1]); $(teaser).attr('disabled', ''); $('input', button).val(Drupal.t('Join summary')).toggle(join_teaser, split_teaser); $(teaser).show();