From 4e70f2f0d20bbfc800aafb1b78cc6a41f4617d32 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 26 Aug 2009 13:24:51 -0400 Subject: htmltidy: Print a warning message if tidy fails. Closes: #543722 --- IkiWiki/Plugin/htmltidy.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'IkiWiki/Plugin') diff --git a/IkiWiki/Plugin/htmltidy.pm b/IkiWiki/Plugin/htmltidy.pm index 6f3379ef4..fc0d3b1d6 100644 --- a/IkiWiki/Plugin/htmltidy.pm +++ b/IkiWiki/Plugin/htmltidy.pm @@ -46,7 +46,10 @@ sub sanitize (@) { waitpid $pid, 0; $SIG{PIPE}="DEFAULT"; - return "" if $sigpipe || ! defined $ret; + if ($sigpipe || ! defined $ret) { + print STDERR gettext("warning: tidy failed")."\n"; + return ""; + } return $ret; } -- cgit v1.2.3 From 5eec60d4c6c34b6f3d0d2bc002f5d4158354910a Mon Sep 17 00:00:00 2001 From: intrigeri Date: Wed, 26 Aug 2009 07:56:33 +0200 Subject: po: do not beautify urls on the recentchanges page ... else, the recentchanges page shows a link such as "sandbox.es". But, clicking on it goes to the English (or negotiated language) version of the page. It is better in this one case if the link goes direct to the translated version of the page. (cherry picked from commit 496e8523c6706d096f1b794e3f3ba5dd2fa260f3) --- IkiWiki/Plugin/po.pm | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'IkiWiki/Plugin') diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index 414906999..a9517adce 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -602,17 +602,21 @@ sub myurlto ($$;$) { # so that one is redirected to the just-edited page rather than to the # negociated translation; to prevent unnecessary fiddling with caller/inject, # we only do so when our beautify_urlpath would actually do what we want to - # avoid, i.e. when po_link_to = negotiated + # avoid, i.e. when po_link_to = negotiated. + # also avoid doing so when run by cgi_goto, so that the links on recentchanges + # page actually lead to the exact page they pretend to. if ($config{po_link_to} eq "negotiated") { my @caller = caller(1); - my $run_by_editpage = 0; - $run_by_editpage = 1 if (exists $caller[3] && defined $caller[3] - && $caller[3] eq "IkiWiki::cgi_editpage"); + my $use_orig = 0; + $use_orig = 1 if (exists $caller[3] && defined $caller[3] + && ($caller[3] eq "IkiWiki::cgi_editpage" || + $caller[3] eq "IkiWiki::Plugin::goto::cgi_goto") + ); inject(name => "IkiWiki::beautify_urlpath", call => $origsubs{'beautify_urlpath'}) - if $run_by_editpage; + if $use_orig; my $res = $origsubs{'urlto'}->($to,$from,$absolute); inject(name => "IkiWiki::beautify_urlpath", call => \&mybeautify_urlpath) - if $run_by_editpage; + if $use_orig; return $res; } else { -- cgit v1.2.3