]> git.sesse.net Git - webpdf/blobdiff - last.pl
Show the rest of the filename if we truncate.
[webpdf] / last.pl
diff --git a/last.pl b/last.pl
index 602473901f71f49dfa106ddbef2c63eada94a441..3576ba9a30744991165e46c9440c9bf238874ee0 100755 (executable)
--- a/last.pl
+++ b/last.pl
@@ -58,9 +58,13 @@ for my $t (@thumbnails[0..$pdfweb::config::show_last-1]) {
        close DESC;
 
        if (length($desc) > 30) {
-               $desc = substr($desc, 0, 30) . " ...";
+               # Is this <abbr> abuse?
+               $desc = HTML::Entities::encode_entities(substr($desc, 0, 30)) . " <abbr title=\"" .
+                       HTML::Entities::encode_entities($desc)
+               . "\">...</abbr>";
+       } else {
+               $desc = HTML::Entities::encode_entities($desc);
        }
-       $desc = HTML::Entities::encode_entities($desc);
 
        my $time = (stat($t))[9];
        my $date = POSIX::strftime("%Y-%m-%d %H:%M", localtime($time));