diff --git a/formats/HtmlFormat.php b/formats/HtmlFormat.php
index d995aae6..b9a7aba1 100644
--- a/formats/HtmlFormat.php
+++ b/formats/HtmlFormat.php
@@ -67,13 +67,11 @@ class HtmlFormat extends FormatAbstract {
$entryEnclosures = '
Attachments:
';
foreach($item->getEnclosures() as $enclosure) {
+ $template = '
%s';
$url = $this->sanitizeHtml($enclosure);
+ $anchorText = substr($url, strrpos($url, '/') + 1);
- $entryEnclosures .= '
'
- . substr($url, strrpos($url, '/') + 1)
- . '';
+ $entryEnclosures .= sprintf($template, $url, $anchorText);
}
$entryEnclosures .= '
';