# register a dependency.
add_depends($params{page}, $params{pages});
- my @broken;
+ my %broken;
foreach my $page (keys %links) {
if (pagespec_match($page, $params{pages}, location => $params{page})) {
my $discussion=gettext("discussion");
next if $link =~ /.*\/\Q$discussion\E/i && $config{discussion};
my $bestlink=bestlink($page, $link);
next if length $bestlink;
- push @broken, sprintf(gettext("%s from %s"),
- htmllink($page, $params{destpage}, $link, noimageinline => 1),
- htmllink($params{page}, $params{destpage}, $page, noimageinline => 1));
+ push @{$broken{$link}}, $page;
}
}
}
+
+ my @broken;
+ foreach my $link (keys %broken) {
+ my $page=$broken{$link}->[0];
+ push @broken, sprintf(gettext("%s from %s"),
+ htmllink($page, $params{destpage}, $link, noimageinline => 1),
+ join(", ", map {
+ htmllink($params{page}, $params{destpage}, $_, noimageinline => 1)
+ } @{$broken{$link}}));
+ }
- return gettext("There are no broken links!") unless @broken;
- my %seen;
- return "<ul>\n".join("\n", map { "<li>$_</li>" } grep { ! $seen{$_}++ } sort @broken)."</ul>\n";
+ return gettext("There are no broken links!") unless %broken;
+ return "<ul>\n"
+ .join("\n",
+ map {
+ "<li>$_</li>"
+ }
+ sort @broken)
+ ."</ul>\n";
} # }}}
1
* Better error message when a setup file has a syntax error.
Closes: #451666
* Fix mercurial historyurl in example setup file.
+ * More compact output for the brokenlinks plugin.
- -- Joey Hess <joeyh@debian.org> Sat, 17 Nov 2007 14:43:26 -0500
+ -- Joey Hess <joeyh@debian.org> Sat, 17 Nov 2007 15:59:54 -0500
ikiwiki (2.12) unstable; urgency=low
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2007-11-14 09:23-0500\n"
+"POT-Creation-Date: 2007-11-17 16:11-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
msgid "creating new page %s"
msgstr ""
-#: ../IkiWiki/Plugin/brokenlinks.pm:29
+#: ../IkiWiki/Plugin/brokenlinks.pm:37
#, perl-format
msgid "%s from %s"
msgstr ""
-#: ../IkiWiki/Plugin/brokenlinks.pm:36
+#: ../IkiWiki/Plugin/brokenlinks.pm:44
msgid "There are no broken links!"
msgstr ""