--- ../drupal-cvs/modules/node.module	2004-02-02 14:45:11.000000000 -0500
+++ modules/node.module	2004-02-02 19:30:19.000000000 -0500
@@ -573,6 +573,8 @@
   $output .= form_select(t('Number of posts on main page'), 'default_nodes_main', variable_get('default_nodes_main', 10), array(1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 =>  5, 6 => 6, 7 => 7, 8 => 8, 9 => 9, 10 => 10, 15 => 15, 20 => 20, 25 => 25, 30 => 30), t('The default maximum number of posts to display per page on overview pages such as the main page.'));
   $output .= form_select(t('Length of trimmed posts'), 'teaser_length', variable_get('teaser_length', 600), array(0 => t('Unlimited'), 200 => t('200 characters'), 400 => t('400 characters'), 600 => t('600 characters'), 800 => t('800 characters'), 1000 => t('1000 characters'), 1200 => t('1200 characters'), 1400 => t('1400 characters'), 1600 => t('1600 characters'), 1800 => t('1800 characters'), 2000 => t('2000 characters')), t("The maximum number of characters used in the trimmed version of a post.  Drupal will use this setting to determine at which offset long posts should be trimmed.  The trimmed version of a post is typically used as a teaser when displaying the post on the main page, in XML feeds, etc.  To disable teasers, set to 'Unlimited'."));
   $output .= form_radios(t('Preview post'), 'node_preview', variable_get('node_preview', 0), array(t('Optional'), t('Required')), t('Must users preview posts before submitting?'));
+  $output .= form_select(t("Strip Tags in RSS"), "node_strip_rss", variable_get("node_strip_rss", 0), array(t("Full HTML"),t("Remove Tags")), t("Remove HTML tags from the RSS feed descriptions?"));
+  $output .= form_select(t("Trim RSS description"), "rss_desc_length", variable_get("rss_desc_length", 0), array(0 => t("Same as Node"), 80 => t("80 characters"), 120 => t("120 characters"), 200 => t("200 characters")), t("Drupal normally includes the teaser as the RSS description.  To conserve bandwidth, you can shorten this description to just a lead-in fragment by setting a maximum; this will only apply if 'Strip Tags' is also enabled.  Characters past this point will be trimmed and followed by an ellipsis.  To include full teaser, set to 'Same as Node'."));
 
   return $output;
 }
@@ -1009,7 +1011,26 @@
 
     $item = node_load(array('nid' => $node->nid));
     $link = url("node/view/$node->nid");
-    $items .= format_rss_item($item->title, $link, ($item->teaser ? $item->teaser : $item->body), array('pubDate' => date('r', $item->changed)));
+//    $items .= format_rss_item($item->title, $link, ($item->teaser ? $item->teaser : $item->body), array('pubDate' => date('r', $item->changed)));
+    $desc = ($item->teaser ? $item->teaser : $item->body);
+	if (variable_get("node_strip_rss", 0)) {
+		$desc = strip_tags(check_output($desc));
+	    $desc_length = variable_get("rss_desc_length", 0);
+		if (($desc_length > 0) && ($desc_length < strlen($desc))) {
+			$desc = substr( $desc, 0, $desc_length );
+			if ($length = strrpos($desc, ". ")) {
+			    $desc = substr($desc, 0, $length + 1);	
+			} elseif ($length = strrpos($desc, "! ")) {
+			    $desc = substr($desc, 0, $length + 1);	
+			} elseif ($length = strrpos($desc, ": ")) {
+			    $desc = substr($desc, 0, $length + 1);	
+			} elseif ($length = strrpos($desc, " ")) {
+			    $desc = substr($desc, 0, $length);	
+			}
+		    $desc .= ' ...';
+		}
+	}
+    $items .= format_rss_item($item->title, $link, $desc, array("pubDate" => date("r", $item->changed)));
   }
 
   $output .= "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
