X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/f1ddf4bd98821a597d8fa1532092f09d3d9b5483..73f4a8835876c8cb07808367cd72d9ae972893e8:/IkiWiki.pm?ds=inline diff --git a/IkiWiki.pm b/IkiWiki.pm index 3430c5742..5d5c7f0d0 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1026,6 +1026,13 @@ sub urlto ($$;$) { return beautify_urlpath($link); } +sub isselflink ($$) { + my $page=shift; + my $link=shift; + + return $page eq $link; +} + sub htmllink ($$$;@) { my $lpage=shift; # the page doing the linking my $page=shift; # the page that will contain the link (different for inline) @@ -1051,7 +1058,7 @@ sub htmllink ($$$;@) { } return "$linktext" - if length $bestlink && $page eq $bestlink && + if length $bestlink && isselflink($page, $bestlink) && ! defined $opts{anchor}; if (! $destsources{$bestlink}) { @@ -1407,7 +1414,7 @@ sub check_content (@) { my %old=map { $_ => 1 } split("\n", readfile(srcfile($pagesources{$params{page}}))); foreach my $line (split("\n", $params{content})) { - push @diff, $line if ! exists $old{$_}; + push @diff, $line if ! exists $old{$line}; } $params{diff}=join("\n", @diff); }