]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki.pm
htmllink: allow a title attribute to be specified
[ikiwiki.git] / IkiWiki.pm
index 1e9d1ca2a73d42343534fb582dd50542926b71f1..611ba6f6540c6ae6b789bd49d477876b500b9eaf 100644 (file)
@@ -1081,11 +1081,10 @@ sub htmllink ($$$;@) {
        }
 
        my @attrs;
-       if (defined $opts{rel}) {
-               push @attrs, ' rel="'.$opts{rel}.'"';
-       }
-       if (defined $opts{class}) {
-               push @attrs, ' class="'.$opts{class}.'"';
+       foreach my $attr (qw{rel class title}) {
+               if (defined $opts{$attr}) {
+                       push @attrs, " $attr=\"".$opts{attr}.'"';
+               }
        }
 
        return "<a href=\"$bestlink\"@attrs>$linktext</a>";