Index: wp-includes/nav-menu-template.php
===================================================================
--- wp-includes/nav-menu-template.php	(revision 23501)
+++ wp-includes/nav-menu-template.php	(working copy)
@@ -80,13 +80,15 @@
 
 		$output .= $indent . '<li' . $id . $value . $class_names .'>';
 
-		$attributes  = ! empty( $item->attr_title ) ? ' title="'  . esc_attr( $item->attr_title ) .'"' : '';
-		$attributes .= ! empty( $item->target )     ? ' target="' . esc_attr( $item->target     ) .'"' : '';
-		$attributes .= ! empty( $item->xfn )        ? ' rel="'    . esc_attr( $item->xfn        ) .'"' : '';
-		$attributes .= ! empty( $item->url )        ? ' href="'   . esc_attr( $item->url        ) .'"' : '';
+		$atts = array();
+		$atts['title']  = empty( $item->attr_title ) ? '' : sprintf( 'title="%s"', esc_attr( $item->attr_title ) );
+		$atts['target'] = empty( $item->target )     ? '' : sprintf( 'target="%s"', esc_attr( $item->target ) );
+		$atts['rel']    = empty( $item->xfn )        ? '' : sprintf( 'rel="%s"', esc_attr( $item->xfn ) );
+		$atts['href']   = empty( $item->url )        ? '' : sprintf( 'href="%s"', esc_attr( esc_url( $item->url ) ) );
+		$attributes = implode( ' ', apply_filters( 'nav_menu_a_attributes', $atts, $item, $args ) );
 
 		$item_output = $args->before;
-		$item_output .= '<a'. $attributes .'>';
+		$item_output .= '<a '. $attributes .'>';
 		$item_output .= $args->link_before . apply_filters( 'the_title', $item->title, $item->ID ) . $args->link_after;
 		$item_output .= '</a>';
 		$item_output .= $args->after;
