diff --git wp-includes/formatting.php wp-includes/formatting.php
index c162a35..acb2144 100644
--- wp-includes/formatting.php
+++ wp-includes/formatting.php
@@ -1799,6 +1799,78 @@ function convert_smilies($text) {
 }
 
 /**
+ * Extract a URL from passed content, if possible
+ * Checks for a URL on the first line of the content or the first encountered href attribute.
+ *
+ * @since 3.6.0
+ *
+ * @param string $content A string which might contain a URL.
+ * @param boolean $remove Whether the remove the found URL from the passed content.
+ * @return string The found URL.
+ */
+function get_content_link( &$content, $remove = false ) {
+	if ( empty( $content ) )
+		return;
+
+	// the content is a URL
+	$trimmed = trim( $content );
+	if ( 0 === stripos( $trimmed, 'http' ) && ! preg_match( '#\s#', $trimmed ) ) {
+		if ( $remove )
+			$content = '';
+
+		return $trimmed;
+	// the content is HTML so we grab the first href
+	} elseif ( preg_match( '/<a\s[^>]*?href=[\'"](.+?)[\'"]/is', $content, $matches ) ) {
+		return esc_url_raw( $matches[1] );
+	}
+
+	$lines = explode( "\n", $trimmed );
+	$line = trim( array_shift( $lines ) );
+
+	// the content is a URL followed by content
+	if ( 0 === stripos( $line, 'http' ) ) {
+		if ( $remove )
+			$content = trim( join( "\n", $lines ) );
+
+		return esc_url_raw( $line );
+	}
+}
+
+/**
+ * Attempt to retrieve a URL from a post's content
+ *
+ * @since 3.6.0
+ *
+ * @param int $id Optional. Post ID.
+ * @return string A URL, if found.
+ */
+function get_the_link( $id = 0 ) {
+	$post = empty( $id ) ? get_post() : get_post( $id );
+
+	if ( empty( $post ) )
+		return;
+
+	if ( has_post_format( 'link', $post ) ) {
+		$meta = get_post_format_meta( $post->ID );
+		if ( ! empty( $meta['url'] ) )
+			return esc_url_raw( $meta['url'] );
+	}
+
+	if ( ! empty( $post->post_content ) )
+		return get_content_link( $post->post_content );
+}
+
+/**
+ * Attempt to output a URL from a post's content
+ *
+ * @since 3.6.0
+ *.
+ */
+function the_link() {
+	echo get_the_link( 0 );
+}
+
+/**
  * Return the class for a post format content wrapper
  *
  * @since 3.6.0
@@ -1864,14 +1936,23 @@ function post_formats_compat( $content, $id = 0 ) {
 			if ( ! empty( $meta['url'] ) ) {
 				$esc_url = preg_quote( $meta['url'], '#' );
 				// Make sure the same URL isn't in the post (modified/extended versions allowed)
-				if ( ! preg_match( '#' . $esc_url . '[^/&\?]#', $content ) ) {
-					$format_output .= sprintf(
-						'<a %shref="%s">%s</a>',
-						empty( $compat['link_class'] ) ? '' : sprintf( 'class="%s" ', esc_attr( $compat['link_class'] ) ),
-						esc_url( $meta['url'] ),
-						empty( $post->post_title ) ? esc_url( $meta['url'] ) : apply_filters( 'the_title', $post->post_title )
-					);
-				}
+				if ( ! preg_match( '#' . $esc_url . '[^/&\?]#', $content ) )
+					$url = $meta['url'];
+			} else {
+				$compat['position'] = 'before';
+				$content_before = $content;
+				$url = get_content_link( $content, true );
+				if ( $content_before == $content )
+					$url = '';
+			}
+
+			if ( ! empty( $url ) ) {
+				$format_output .= sprintf(
+					'<a %shref="%s">%s</a>',
+					empty( $compat['link_class'] ) ? '' : sprintf( 'class="%s" ', esc_attr( $compat['link_class'] ) ),
+					esc_url( $url ),
+					empty( $post->post_title ) ? esc_url( $meta['url'] ) : apply_filters( 'the_title', $post->post_title )
+				);
 			}
 			break;
 
@@ -3531,7 +3612,7 @@ function sanitize_trackback_urls( $to_ping ) {
  * @return string|array Slashed $value
  */
 function wp_slash( $value ) {
-	if ( is_array( $value ) ) { 
+	if ( is_array( $value ) ) {
 		foreach ( $value as $k => $v ) {
 			if ( is_array( $v ) ) {
 				$value[$k] = wp_slash( $v );
@@ -3540,10 +3621,10 @@ function wp_slash( $value ) {
 			}
 		}
 	} else {
-		$value = addslashes( $value ); 
-	} 
+		$value = addslashes( $value );
+	}
 
-	return $value; 
+	return $value;
 }
 
 /**
@@ -3562,5 +3643,5 @@ function wp_slash( $value ) {
  * @return string|array Unslashed $value
  */
 function wp_unslash( $value ) {
-	return stripslashes_deep( $value ); 
+	return stripslashes_deep( $value );
 }
diff --git wp-includes/post.php wp-includes/post.php
index 14fbe75..1dd65ae 100644
--- wp-includes/post.php
+++ wp-includes/post.php
@@ -1968,7 +1968,7 @@ function get_post_format_meta( $post_id = 0 ) {
 		'media'        => '',
 	);
 
-	foreach ( $values as $key => $value )
+	foreach ( array_keys( $values ) as $key )
 		$values[$key] = get_post_meta( $post_id, '_wp_format_' . $key, true );
 
 	return $values;
