Index: wp-includes/comment-template.php
===================================================================
--- wp-includes/comment-template.php	(revision 20805)
+++ wp-includes/comment-template.php	(working copy)
@@ -1245,11 +1245,11 @@
 			case 'div':
 				break;
 			case 'ol':
-				echo "<ol class='children'>\n";
+				echo '<ol class="children">' . "\n";
 				break;
 			default:
 			case 'ul':
-				echo "<ul class='children'>\n";
+				echo '<ul class="children">' . "\n";
 				break;
 		}
 	}
@@ -1269,11 +1269,11 @@
 			case 'div':
 				break;
 			case 'ol':
-				echo "</ol>\n";
+				echo "</ol><!-- .children -->\n";
 				break;
 			default:
 			case 'ul':
-				echo "</ul>\n";
+				echo "</ul><!-- .children -->\n";
 				break;
 		}
 	}
@@ -1330,13 +1330,13 @@
 		$depth++;
 		$GLOBALS['comment_depth'] = $depth;
 
-		if ( !empty($args['callback']) ) {
-			call_user_func($args['callback'], $comment, $args, $depth);
+		if ( !empty( $args['callback'] ) ) {
+			call_user_func( $args['callback'], $comment, $args, $depth );
 			return;
 		}
 
 		$GLOBALS['comment'] = $comment;
-		extract($args, EXTR_SKIP);
+		extract( $args, EXTR_SKIP );
 
 		if ( 'div' == $args['style'] ) {
 			$tag = 'div';
@@ -1345,36 +1345,54 @@
 			$tag = 'li';
 			$add_below = 'div-comment';
 		}
-?>
-		<<?php echo $tag ?> <?php comment_class(empty( $args['has_children'] ) ? '' : 'parent') ?> id="comment-<?php comment_ID() ?>">
-		<?php if ( 'div' != $args['style'] ) : ?>
-		<div id="div-comment-<?php comment_ID() ?>" class="comment-body">
-		<?php endif; ?>
-		<div class="comment-author vcard">
-		<?php if ($args['avatar_size'] != 0) echo get_avatar( $comment, $args['avatar_size'] ); ?>
-		<?php printf(__('<cite class="fn">%s</cite> <span class="says">says:</span>'), get_comment_author_link()) ?>
-		</div>
-<?php if ($comment->comment_approved == '0') : ?>
-		<em class="comment-awaiting-moderation"><?php _e('Your comment is awaiting moderation.') ?></em>
-		<br />
-<?php endif; ?>
+		
+		switch ( $comment->comment_type ) :
+			case 'pingback' :
+			case 'trackback' :
+			// Display trackbacks differently than normal comments.
+		?>
+		<<?php echo $tag ?> <?php comment_class(); ?> id="comment-<?php comment_ID(); ?>">
+			<div class="comment-body"><?php _e( 'Pingback:' ); ?> <?php comment_author_link(); ?> <?php edit_comment_link( __( '(Edit)' ), '<span class="edit-link">', '</span>' ); ?></div>
+		<?php
+				break;
+			default :
+			// Proceed with normal comments.
+		?>
+		<<?php echo $tag ?> <?php comment_class( empty( $args['has_children'] ) ? '' : 'parent' ); ?> id="comment-<?php comment_ID(); ?>">
+			<?php if ( 'div' != $args['style'] ) : ?>
+			<div id="div-comment-<?php comment_ID(); ?>" class="comment-body">
+			<?php endif; ?>
+			<div class="comment-author vcard">
+				<?php
+					if ( 0 != $args['avatar_size'] )
+						echo get_avatar( $comment, $args['avatar_size'] );
+				?>
+				<?php printf( __( '<cite class="fn">%s</cite> <span class="says">says:</span>' ), get_comment_author_link() ); ?>
+			</div><!-- .comment-author -->
 
-		<div class="comment-meta commentmetadata"><a href="<?php echo htmlspecialchars( get_comment_link( $comment->comment_ID ) ) ?>">
-			<?php
-				/* translators: 1: date, 2: time */
-				printf( __('%1$s at %2$s'), get_comment_date(),  get_comment_time()) ?></a><?php edit_comment_link(__('(Edit)'),'&nbsp;&nbsp;','' );
-			?>
-		</div>
+			<div class="comment-meta commentmetadata">
+				<a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>">
+				<?php printf( __( '%1$s at %2$s' ), get_comment_date(),  get_comment_time() ); /* translators: 1: date, 2: time */ ?></a>
+				<?php edit_comment_link( __( '(Edit)' ), '<span class="edit-link">', '</span>' ); ?>
+			</div><!-- .comment-meta -->
 
-		<?php comment_text() ?>
+			<?php if ( '0' == $comment->comment_approved ) : ?>
+				<p class="comment-awaiting-moderation"><em><?php _e( 'Your comment is awaiting moderation.' ); ?></em><p>
+			<?php endif; ?>
 
-		<div class="reply">
-		<?php comment_reply_link(array_merge( $args, array('add_below' => $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
-		</div>
-		<?php if ( 'div' != $args['style'] ) : ?>
-		</div>
-		<?php endif; ?>
-<?php
+			<div class="comment-text">
+				<?php comment_text(); ?>
+			</div><!-- .comment_text -->
+
+			<div class="reply">
+				<?php comment_reply_link( array_merge( $args, array( 'add_below' => $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
+			</div><!-- .reply -->
+			<?php if ( 'div' != $args['style'] ) : ?>
+		</div><!-- div-comment-## -->
+			<?php endif;
+
+			break;
+		endswitch; // end comment_type check
 	}
 
 	/**
@@ -1386,17 +1404,16 @@
 	 * @param int $depth Depth of comment.
 	 * @param array $args
 	 */
-	function end_el(&$output, $comment, $depth = 0, $args = array() ) {
-		if ( !empty($args['end-callback']) ) {
-			call_user_func($args['end-callback'], $comment, $args, $depth);
+	function end_el( &$output, $comment, $depth = 0, $args = array() ) {
+		if ( !empty( $args['end-callback'] ) ) {
+			call_user_func( $args['end-callback'], $comment, $args, $depth );
 			return;
 		}
 		if ( 'div' == $args['style'] )
-			echo "</div>\n";
+			echo "</div><!-- #comment-## -->\n";
 		else
-			echo "</li>\n";
+			echo "</li><!-- #comment-## -->\n";
 	}
-
 }
 
 /**
