Index: wp-includes/formatting.php
===================================================================
--- wp-includes/formatting.php	(revision 11119)
+++ wp-includes/formatting.php	(working copy)
@@ -2004,7 +2004,7 @@
 	 * link starting with / or a php file).
 	 */
 	if ( strpos($url, ':') === false &&
-		substr( $url, 0, 1 ) != '/' && !preg_match('/^[a-z0-9-]+?\.php/i', $url) )
+		substr( $url, 0, 1 ) != '/' && substr( $url, 0, 1 ) != '#' && !preg_match('/^[a-z0-9-]+?\.php/i', $url) )
 		$url = 'http://' . $url;
 
 	// Replace ampersands and single quotes only when displaying.
