In /wp-includes/post-template.php, function prepend_attachment() has been rewritten to prepend different content based on post_mime_type.
Only image, audio and video MIME types are handled. Other MIME types, such as “text” and “application”, fall out the bottom of the if/elseif tests and leave the $p variable undefined.
This produces a PHP Notice: regarding the undefined variable.
Perhaps adding a final else clause to show the icon for other MIME types would be useful
$p = '<p class="attachment">';
// show the medium sized image representation of the attachment if available, and link to the raw file
$p .= wp_get_attachment_link(0, 'medium', false, true );
$p .= '</p>';