--- misc/teaser.js.1.10	Sun Dec 16 01:19:26 2007
+++ misc/teaser.js	Wed Dec 26 19:45:35 2007
@@ -17,6 +17,7 @@ Drupal.behaviors.teaser = function(conte
     // Move teaser textarea before body, and remove its form-item wrapper.
     var body = $('#'+ Drupal.settings.teaser[this.id]);
     var checkbox = $('#'+ Drupal.settings.teaserCheckbox[this.id]).parent();
+    var checked = $(checkbox).children('input').attr('checked') ? true : false;
     var parent = teaser[0].parentNode;
     $(body).before(teaser);
     $(parent).remove();
@@ -30,13 +31,19 @@ Drupal.behaviors.teaser = function(conte
       if (teaser.val()) {
         body.val(trim(teaser.val()) +'\r\n\r\n'+ trim(body.val()));
       }
-      // Hide and disable teaser
+      // Empty, hide and disable teaser.
+      teaser[0].value = '';
       $(teaser).attr('disabled', 'disabled');
       $(teaser).parent().slideUp('fast');
-      // Change label
+      // Change label.
       $(this).val(Drupal.t('Split summary at cursor'));
-      // Show separate teaser checkbox
+      // Hide separate teaser checkbox.
       $(checkbox).hide();
+      // Force a hidden checkbox to be checked (to ensure that the body is
+      // correctly processed on form submit when teaser/body are in joined
+      // state), and remember the current checked status.
+      checked = $(checkbox).children('input').attr('checked') ? true : false;
+      $(checkbox).children('input').attr('checked', true);
     }
 
     // Split the teaser from the body.
@@ -54,8 +61,8 @@ Drupal.behaviors.teaser = function(conte
       $(teaser).parent().slideDown('fast');
       // Change label
       $(this).val(Drupal.t('Join summary'));
-      // Show separate teaser checkbox
-      $(checkbox).show();
+      // Show separate teaser checkbox, restore checked value.
+      $(checkbox).show().children('input').attr('checked', checked);
     }
 
     // Add split/join button.
@@ -75,7 +82,7 @@ Drupal.behaviors.teaser = function(conte
     else {
       $(teaser).hide();
       $('input', button).val(Drupal.t('Split summary at cursor')).toggle(split_teaser, join_teaser);
-      $(checkbox).hide();
+      $(checkbox).hide().children('input').attr('checked', true);
     }
 
   });
Index: modules/system/system.css
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.css,v
retrieving revision 1.45
diff -u -r1.45 system.css
--- modules/system/system.css	13 Dec 2007 10:14:18 -0000	1.45
+++ modules/system/system.css	21 Dec 2007 01:47:13 -0000
@@ -397,6 +397,9 @@
   padding-right: 5%; /* LTR */
   margin: 0;
 }
+.teaser-checkbox {
+  margin-bottom: -2em;
+}
 .teaser-checkbox div.form-item {
   float: right; /* LTR */
   margin: 0 5% 0 0; /* LTR */
--- modules/node/node.module.1.923	Sun Dec 16 01:19:26 2007
+++ modules/node/node.module	Fri Jan 04 00:36:45 2008
@@ -238,11 +238,45 @@ function node_teaser_js(&$form, &$form_s
 }
 
 /**
- * Automatically generate a teaser for a node body.
+ * Ensure that auto-generated teasers are not stripped out of the node body.
+ *
+ * This check is for non-JS users: if JS is active then it is used to enforce
+ * the same condition.  
+ */
+function node_teaser_include_no_js(&$form, &$form_state) {
+  // For non-empty body and unchecked "teaser include" checkbox, test for
+  // teaser delimiter within the body. If absent, then force checkbox
+  // to be checked.
+  // The form has just been submitted iff $form['#post']['body'] is set
+  if (isset($form['#post']['body']) && $form_state['values']['teaser_include'] == 0) {
+    if (strpos($form_state['values']['body'], '<!--break-->') === FALSE) {
+      $msg = t('You specified that the summary should not be shown when this post is displayed in full view. This setting has been ignored since you have not defined a summary for the post.');
+    }
+    elseif  (strpos($form_state['values']['body'], '<!--break-->') === 0) {
+      // Teaser is empty string
+      $msg = t('You specified that the summary should not be shown when this post is displayed in full view. This setting has been ignored since the summary is empty.');
+    }
+    
+    if (isset($msg)) {
+      drupal_set_message($msg, 'warning');
+    
+      // Pass value onto preview/submit
+      form_set_value($form['teaser_include'], 1, $form_state);
+      // Pass value back onto form
+      $form['teaser_include']['#value'] = 1;
+    }
+  }
+
+  return $form;
+}
+
+/**
+ * Generate a teaser for a node body.
  *
  * If the end of the teaser is not indicated using the <!--break--> delimiter
- * then we try to end it at a sensible place, such as the end of a paragraph,
- * a line break, or the end of a sentence (in that order of preference).
+ * then we generate the teaser automatically, trying to end it at a sensible
+ * place such as the end of a paragraph, a line break, or the end of a
+ * sentence (in that order of preference).
  *
  * @param $body
  *   The content for which a teaser will be generated.
@@ -777,7 +811,7 @@ function node_submit($node) {
   // Convert the node to an object, if necessary.
   $node = (object)$node;
 
-  // Auto-generate the teaser, but only if it hasn't been set (e.g. by a
+  // Generate the teaser, but only if it hasn't been set (e.g. by a
   // module-provided 'teaser' form item).
   if (!isset($node->teaser)) {
     if (isset($node->body)) {
--- modules/node/node.pages.inc.1.16+1.20	Tue Dec 25 00:45:51 2007
+++ modules/node/node.pages.inc	Fri Jan 04 00:23:34 2008
@@ -264,7 +264,7 @@ function node_body_field(&$node, $label,
   $include = !isset($node->teaser) || ($node->teaser == substr($node->body, 0, strlen($node->teaser)));
 
   $form = array(
-    '#after_build' => array('node_teaser_js'));
+    '#after_build' => array('node_teaser_js', 'node_teaser_include_no_js'));
 
   $form['#prefix'] = '<div class="body-field-wrapper">';
   $form['#suffix'] = '</div>';
@@ -281,7 +281,7 @@ function node_body_field(&$node, $label,
     '#type' => 'checkbox',
     '#title' => t('Show summary in full view'),
     '#default_value' => $include,
-    '#prefix' => '<div class="teaser-checkbox">',
+    '#prefix' => '<div class="teaser-checkbox clear-block">',
     '#suffix' => '</div>',
   );
 
@@ -417,7 +417,21 @@ function node_preview($node) {
  */
 function theme_node_preview($node) {
   $output = '<div class="preview">';
-  if (!empty($node->teaser) && !empty($node->body) && $node->teaser != $node->body) {
+  $preview_trimmed_version = FALSE;
+  if (isset($node->teaser) && isset($node->body)) {
+    // Process teaser and body to find out if we need to preview trimmed version
+    $teaser = trim($node->teaser);
+    $body = trim(str_replace('<!--break-->', '', $node->body));
+
+    // Preview trimmed version if teaser and body will appear different;
+    // also (edge case) if both teaser and body have been specified by the user
+    // and are actually the same
+    if ($teaser != $body || strpos($node->body, '<!--break-->') === 0) {
+      $preview_trimmed_version = TRUE;
+    }
+  }
+  
+  if ($preview_trimmed_version) {
     drupal_set_message(t('The trimmed version of your post shows what your post looks like when promoted to the main page or when exported for syndication.<span class="no-js"> You can insert the delimiter "&lt;!--break--&gt;" (without the quotes) to fine-tune where your post gets split.</span>'));
     $output .= '<h3>'. t('Preview trimmed version') .'</h3>';
     $output .= node_view(drupal_clone($node), 1, FALSE, 0);
