--- gcal_events.module.old	2009-01-27 16:17:38.000000000 -0600
+++ gcal_events.module	2009-01-27 16:15:19.000000000 -0600
@@ -209,6 +209,20 @@ function gcal_events_admin_name_validate
   form_set_error('gcal_events_admin_name', 'Admin name not funny enough');
 }
 
+
+/** Implementation of hook_theme()
+ * New registration function introduced in Drupal 6
+ *
+ * @return array
+ */
+function gcal_events_theme() {
+  return array(
+    'gcal_events_contents' => array(
+      'arguments' => array('gcal_events' => NULL)
+    )
+  );
+}
+
 /**
  * Implementation of hook_block().
  *
@@ -472,7 +486,7 @@ function gcal_events_contents($which_blo
   // Change this to 'true' to see lots of fancy debug code
   $debug_mode=variable_get('gcal_events_debug', FALSE);
 
-  $output_text = "";
+  $gcal_events = array();
 
   $calendar_id = variable_get('gcal_events_calendar_id_'. $which_block, '');
   $private_id = variable_get('gcal_events_private_id_'. $which_block, ''); 
@@ -723,9 +737,9 @@ function gcal_events_contents($which_blo
     }
 
     // Check for invalid html
-    $temp_event = check_markup($temp_event, $input_format);
+    $temp_event = check_markup($temp_event, $input_format, FALSE);
 
-    $output_text = $output_text . $temp_event ."<br>";
+    $gcal_events[] = $temp_event;
     if ($num_events==0) {
       break;
     }
@@ -733,12 +747,20 @@ function gcal_events_contents($which_blo
   if ($debug_mode) {
     drupal_set_message('GCal Events[' . $admin_name . '] Feed processing took ' . (microtime(true) - $time_feed_process) . ' seconds');
   }
+  
+  return theme('gcal_events_contents', $gcal_events);
+}
 
-  if ($output_text == "") {
-    $output_text .= variable_get('gcal_events_empty_'. $which_block, 'none');
+function theme_gcal_events_contents($gcal_events) {
+  $output = '';
+  if (empty($gcal_events)) {
+    $output .= variable_get('gcal_events_empty_'. $which_block, 'none');
+  }
+  else {
+    $output .= theme('item_list', $gcal_events, NULL, 'ul', array('class' => 'gcal_events'));
   }
 
-  $output_text .= variable_get('gcal_events_footer_'. $which_block, '');
+  $output .= variable_get('gcal_events_footer_'. $which_block, '');
   
-  return check_markup($output_text, $input_format, true);
+  return $output;
 }
