1 Here's an attempt to make `htmllink` "do the right thing" with in-page anchors:
5 ===================================================================
6 --- IkiWiki.pm (revision 2657)
7 +++ IkiWiki.pm (working copy)
9 my $noimageinline=shift; # don't turn links into inline html images
10 my $forcesubpage=shift; # force a link to a subpage
11 my $linktext=shift; # set to force the link text to something
13 + my $anchor = ($link =~ s/#(.+)$// ? $1 : undef);
16 if (! $forcesubpage) {
18 if (! $noimageinline && isinlinableimage($bestlink)) {
19 return "<img src=\"$bestlink\" alt=\"$linktext\" />";
21 - return "<a href=\"$bestlink\">$linktext</a>";
23 + $bestlink .= "#$anchor" if $anchor;
25 + return "<a href=\"$bestlink\">$linktext</a>";
28 sub htmlize ($$$) { #{{{