Index: wp-includes/formatting.php
===================================================================
--- wp-includes/formatting.php	(revision 22329)
+++ wp-includes/formatting.php	(working copy)
@@ -965,7 +965,7 @@
  * @return string The sanitized title.
  */
 function sanitize_title_with_dashes($title, $raw_title = '', $context = 'display') {
-	$title = strip_tags($title);
+	$title = wp_filter_nohtml_kses( $title );
 	// Preserve escaped octets.
 	$title = preg_replace('|%([a-fA-F0-9][a-fA-F0-9])|', '---$1---', $title);
 	// Remove percent signs that are not part of an octet.
@@ -981,7 +981,8 @@
 	}
 
 	$title = strtolower($title);
-	$title = preg_replace('/&.+?;/', '', $title); // kill entities
+	$title = preg_replace('/(\S)&.+?;/', '$1-', $title); // turn entities next to chars into dashes
+	$title = preg_replace('/&.+?;/', '', $title); // kill remaining entities
 	$title = str_replace('.', '-', $title);
 
 	if ( 'save' == $context ) {
