From 7bd0d536442493a8898981a8a784bf16126085c5 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 9 Mar 2009 14:01:40 -0400 Subject: git: Fix utf-8 encoding of author names. I guess what's happening here is that since the name is passed to git via an environment variable, perl's normal utf-8 IO layer stuff doesn't work. So we have to explicitly decode the string from perl's internal representation into utf-8. --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'debian/changelog') diff --git a/debian/changelog b/debian/changelog index c66db85a2..a7e7544c6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +ikiwiki (3.08) UNRELEASED; urgency=low + + * git: Fix utf-8 encoding of author names. + + -- Joey Hess Mon, 09 Mar 2009 14:00:21 -0400 + ikiwiki (3.07) unstable; urgency=low * Updated German translation (Kai Wasserbäch). Closes: #518377 -- cgit v1.2.3 From 4ac0b2953131d7a53562ab8918c8e5a49952d8ac Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 9 Mar 2009 14:18:55 -0400 Subject: git: Manually decode git output from utf-8, avoids warning messages on invalidly encoded output. --- IkiWiki/Plugin/git.pm | 12 +++++++----- debian/changelog | 2 ++ 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'debian/changelog') diff --git a/IkiWiki/Plugin/git.pm b/IkiWiki/Plugin/git.pm index 12f3a74cb..b386ab71b 100644 --- a/IkiWiki/Plugin/git.pm +++ b/IkiWiki/Plugin/git.pm @@ -136,14 +136,16 @@ sub safe_git (&@) { } # In parent. + # git output is probably utf-8 encoded, but may contain + # other encodings or invalidly encoded stuff. So do not rely + # on the normal utf-8 IO layer, decode it by hand. + binmode($OUT); + my @lines; while (<$OUT>) { + $_=decode_utf8($_, 0); + chomp; - - # check for invalid utf-8, and toss it back to avoid crashes - if (! utf8::valid($_)) { - $_=encode_utf8($_); - } push @lines, $_; } diff --git a/debian/changelog b/debian/changelog index a7e7544c6..77b5d9fa6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,8 @@ ikiwiki (3.08) UNRELEASED; urgency=low * git: Fix utf-8 encoding of author names. + * git: Manually decode git output from utf-8, avoids + warning messages on invalidly encoded output. -- Joey Hess Mon, 09 Mar 2009 14:00:21 -0400 -- cgit v1.2.3 From c176dcde982dfa3095cf7c2d05db4cb71c1713e5 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 15 Mar 2009 17:39:14 -0400 Subject: Fix bug that caused weird things to appear as page types. The problem was introduced by the recent noextension patches. Object autovivification caused junk to get into %htmlize, and all keys of that showed up as page types. --- IkiWiki.pm | 6 ++++-- debian/changelog | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'debian/changelog') diff --git a/IkiWiki.pm b/IkiWiki.pm index a876bbb44..ee07258ec 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -639,8 +639,10 @@ sub pagetype ($) { if ($file =~ /\.([^.]+)$/) { return $1 if exists $hooks{htmlize}{$1}; } - elsif ($hooks{htmlize}{basename($file)}{noextension}) { - return basename($file); + my $base=basename($file); + if (exists $hooks{htmlize}{$base} && + $hooks{htmlize}{$base}{noextension}) { + return $base; } return; } diff --git a/debian/changelog b/debian/changelog index 77b5d9fa6..2c9d1a75a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,7 @@ ikiwiki (3.08) UNRELEASED; urgency=low * git: Fix utf-8 encoding of author names. * git: Manually decode git output from utf-8, avoids warning messages on invalidly encoded output. + * Fix bug that caused weird things to appear as page types. -- Joey Hess Mon, 09 Mar 2009 14:00:21 -0400 -- cgit v1.2.3 From 42dddf6a3f0c548d25add20634b3c19895821094 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 15 Mar 2009 18:24:57 -0400 Subject: releasing version 3.08 --- debian/changelog | 4 ++-- po/ikiwiki.pot | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'debian/changelog') diff --git a/debian/changelog b/debian/changelog index 2c9d1a75a..a8f47bfc7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,11 +1,11 @@ -ikiwiki (3.08) UNRELEASED; urgency=low +ikiwiki (3.08) unstable; urgency=low * git: Fix utf-8 encoding of author names. * git: Manually decode git output from utf-8, avoids warning messages on invalidly encoded output. * Fix bug that caused weird things to appear as page types. - -- Joey Hess Mon, 09 Mar 2009 14:00:21 -0400 + -- Joey Hess Sun, 15 Mar 2009 17:54:47 -0400 ikiwiki (3.07) unstable; urgency=low diff --git a/po/ikiwiki.pot b/po/ikiwiki.pot index ffe2d09e3..94ea19f66 100644 --- a/po/ikiwiki.pot +++ b/po/ikiwiki.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-03-08 19:02-0400\n" +"POT-Creation-Date: 2009-03-15 17:56-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -54,7 +54,7 @@ msgstr "" msgid "You are banned." msgstr "" -#: ../IkiWiki/CGI.pm:390 ../IkiWiki/CGI.pm:391 ../IkiWiki.pm:1209 +#: ../IkiWiki/CGI.pm:390 ../IkiWiki/CGI.pm:391 ../IkiWiki.pm:1211 msgid "Error" msgstr "" @@ -327,18 +327,18 @@ msgstr "" msgid "fortune failed" msgstr "" -#: ../IkiWiki/Plugin/git.pm:624 ../IkiWiki/Plugin/git.pm:642 +#: ../IkiWiki/Plugin/git.pm:626 ../IkiWiki/Plugin/git.pm:644 #: ../IkiWiki/Receive.pm:129 #, perl-format msgid "you are not allowed to change %s" msgstr "" -#: ../IkiWiki/Plugin/git.pm:664 +#: ../IkiWiki/Plugin/git.pm:666 #, perl-format msgid "you cannot act on a file with mode %s" msgstr "" -#: ../IkiWiki/Plugin/git.pm:668 +#: ../IkiWiki/Plugin/git.pm:670 msgid "you are not allowed to change file modes" msgstr "" @@ -1018,12 +1018,12 @@ msgstr "" msgid "failed to load external plugin needed for %s plugin: %s" msgstr "" -#: ../IkiWiki.pm:1192 +#: ../IkiWiki.pm:1194 #, perl-format msgid "preprocessing loop detected on %s at depth %i" msgstr "" -#: ../IkiWiki.pm:1730 +#: ../IkiWiki.pm:1732 msgid "yes" msgstr "" -- cgit v1.2.3 From 86956b3392f7e768fa8f527a0b3a4b7d1a080aef Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 19 Mar 2009 15:36:31 -0400 Subject: title_natural patch merged --- debian/changelog | 7 +++++++ doc/todo/inline:_numerical_ordering_by_title.mdwn | 2 ++ doc/todo/natural_sorting.mdwn | 5 ++--- 3 files changed, 11 insertions(+), 3 deletions(-) (limited to 'debian/changelog') diff --git a/debian/changelog b/debian/changelog index a8f47bfc7..8266afa09 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +ikiwiki (3.09) UNRELEASED; urgency=low + + * inline: Add title_natural sort order, using Sort::Naturally + (chrysn) + + -- Joey Hess Thu, 19 Mar 2009 15:32:49 -0400 + ikiwiki (3.08) unstable; urgency=low * git: Fix utf-8 encoding of author names. diff --git a/doc/todo/inline:_numerical_ordering_by_title.mdwn b/doc/todo/inline:_numerical_ordering_by_title.mdwn index 3f6c8b598..3d7424b3f 100644 --- a/doc/todo/inline:_numerical_ordering_by_title.mdwn +++ b/doc/todo/inline:_numerical_ordering_by_title.mdwn @@ -1,6 +1,8 @@ Could you please add numerical ordering by title to [[inline|plugins/inline]] plugin? Now I can do only alphabetical order by title, but sometime it's not enough. +> Implemented, see [[natural_sorting]] [[!tag done]] --[[Joey]] + BTW, it seems that ordering by title is rather ordering by filename of page. For me "title" means title of page I can set using `title` parameter of [[meta|plugins/meta]] plugin :) diff --git a/doc/todo/natural_sorting.mdwn b/doc/todo/natural_sorting.mdwn index 2215d533e..faa523043 100644 --- a/doc/todo/natural_sorting.mdwn +++ b/doc/todo/natural_sorting.mdwn @@ -15,8 +15,7 @@ the current patch uses `require Sort::Naturally`, so [libsort-naturally-perl](http://packages.debian.org/libsort-naturally-perl) does not become a dependency; it might be worth suggesting, though. -> Great, but all I get from the github link is a server error page, so I -> have not figured out how to merge the patch. --[[Joey]] -> > See also: [[inline:_numerical_ordering_by_title]] (I probably prefer your > approach..) --[[Joey]] + +> [[applied|done]] -- cgit v1.2.3 From a1c8520ce8798dcd2d6b16a59da93afbd4bbf86b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 19 Mar 2009 16:01:23 -0400 Subject: inline: Fix urls to feed when feedfile is used on an index page. It would be better to use urlto() here, but will_render has not yet been called on the feed files at this point, so it won't work. (And reorganizing so it can be is tricky.) --- IkiWiki/Plugin/inline.pm | 4 ++-- debian/changelog | 1 + doc/bugs/feedfile_does_the_wrong_thing_from_index.mdwn2.mdwn | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) (limited to 'debian/changelog') diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index 218fd7515..9d7d4b0fd 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -281,8 +281,8 @@ sub preprocess_inline (@) { } } - my $rssurl=basename($feedbase."rss".$feednum) if $feeds && $rss; - my $atomurl=basename($feedbase."atom".$feednum) if $feeds && $atom; + my $rssurl=abs2rel($feedbase."rss".$feednum, dirname(htmlpage($params{destpage}))) if $feeds && $rss; + my $atomurl=abs2rel($feedbase."atom".$feednum, dirname(htmlpage($params{destpage}))) if $feeds && $atom; my $ret=""; diff --git a/debian/changelog b/debian/changelog index 8266afa09..06707a83c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ ikiwiki (3.09) UNRELEASED; urgency=low * inline: Add title_natural sort order, using Sort::Naturally (chrysn) + * inline: Fix urls to feed when feedfile is used on an index page. -- Joey Hess Thu, 19 Mar 2009 15:32:49 -0400 diff --git a/doc/bugs/feedfile_does_the_wrong_thing_from_index.mdwn2.mdwn b/doc/bugs/feedfile_does_the_wrong_thing_from_index.mdwn2.mdwn index 1653e0b02..6b8781a8c 100644 --- a/doc/bugs/feedfile_does_the_wrong_thing_from_index.mdwn2.mdwn +++ b/doc/bugs/feedfile_does_the_wrong_thing_from_index.mdwn2.mdwn @@ -3,3 +3,5 @@ When I put the following !inline in my index.mdwn, it generate a file called index/graphics.rss. However, the link in the RSS button is to graphics.rss (i.e., not in the index/ directory). `\[[!inline pages="link(tags/graphics) and ./posts/* and !*/Discussion" show="10" feedfile=graphics feedonly=yes]]` + +[[done]] --[[Joey]] -- cgit v1.2.3 From 10a9c00151d43fd26ba523806928b833d6d2aa62 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 20 Mar 2009 16:36:51 -0400 Subject: git, mercurial: Fix --getctime to return file creation time, not last commit time. --- debian/changelog | 2 ++ doc/forum/ikiwiki__39__s_notion_of_time.mdwn | 11 +++++++++++ 2 files changed, 13 insertions(+) (limited to 'debian/changelog') diff --git a/debian/changelog b/debian/changelog index 06707a83c..a525df998 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,8 @@ ikiwiki (3.09) UNRELEASED; urgency=low * inline: Add title_natural sort order, using Sort::Naturally (chrysn) * inline: Fix urls to feed when feedfile is used on an index page. + * git, mercurial: Fix --getctime to return file creation time, + not last commit time. -- Joey Hess Thu, 19 Mar 2009 15:32:49 -0400 diff --git a/doc/forum/ikiwiki__39__s_notion_of_time.mdwn b/doc/forum/ikiwiki__39__s_notion_of_time.mdwn index f52989026..ee564fcc9 100644 --- a/doc/forum/ikiwiki__39__s_notion_of_time.mdwn +++ b/doc/forum/ikiwiki__39__s_notion_of_time.mdwn @@ -22,3 +22,14 @@ What is the rationale for ikiwiki's current behavior with respect to these time stamps? --[[tschwinge]] + +> Presumably it's the authors of the git and mercurial backends +> not understanding the documentation for `rcs_getctime`, +> which states: +> +>>This is used to get the page creation time for a file from the RCS, by +>>looking it up in the history. +> +> I've fixed both broken implementations to correctly look +> up the first, not the last, commit. Other VCS do not seem +> to have the problem. --[[Joey]] -- cgit v1.2.3 From 4538747649bea96d5db91fb3d9cbc4161bf3f795 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 24 Mar 2009 15:52:37 -0400 Subject: Updated French translation (Jean-Luc Coulon). Closes: #521072 --- debian/changelog | 1 + po/fr.po | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'debian/changelog') diff --git a/debian/changelog b/debian/changelog index a525df998..e54c08ba5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,7 @@ ikiwiki (3.09) UNRELEASED; urgency=low * inline: Fix urls to feed when feedfile is used on an index page. * git, mercurial: Fix --getctime to return file creation time, not last commit time. + * Updated French translation (Jean-Luc Coulon). Closes: #521072 -- Joey Hess Thu, 19 Mar 2009 15:32:49 -0400 diff --git a/po/fr.po b/po/fr.po index eb2623fab..51cb5c7de 100644 --- a/po/fr.po +++ b/po/fr.po @@ -9,8 +9,8 @@ msgid "" msgstr "" "Project-Id-Version: ikiwiki 3.04\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-03-08 19:02-0400\n" -"PO-Revision-Date: 2009-02-26 21:28+0100\n" +"POT-Creation-Date: 2009-03-01 15:03-0500\n" +"PO-Revision-Date: 2009-03-15 16:10+0100\n" "Last-Translator: Philippe Batailler \n" "Language-Team: French \n" "MIME-Version: 1.0\n" @@ -26,6 +26,8 @@ msgid "" "probable misconfiguration: sslcookie is set, but you are attepting to login " "via http, not https" msgstr "" +"Erreur de configuration probable : sslcookie est positionné mais vous tentez " +"de vous connecter avec http et non https" #: ../IkiWiki/CGI.pm:149 msgid "login failed, perhaps you need to turn on cookies?" -- cgit v1.2.3 From 9e4adba63a769f164c2a6818e58070680c3e0eed Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 25 Mar 2009 18:04:45 -0400 Subject: css: Add clear: both to inlinefooter. If an inlined page contains a floating element, this ensures that the footer appears beneath it, and prevents the floating element from possibly leaking down to the next inlined page. --- debian/changelog | 1 + doc/style.css | 3 +++ 2 files changed, 4 insertions(+) (limited to 'debian/changelog') diff --git a/debian/changelog b/debian/changelog index e54c08ba5..01404a2b4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,7 @@ ikiwiki (3.09) UNRELEASED; urgency=low * git, mercurial: Fix --getctime to return file creation time, not last commit time. * Updated French translation (Jean-Luc Coulon). Closes: #521072 + * css: Add clear: both to inlinefooter. -- Joey Hess Thu, 19 Mar 2009 15:32:49 -0400 diff --git a/doc/style.css b/doc/style.css index a6e6734e3..98a28f347 100644 --- a/doc/style.css +++ b/doc/style.css @@ -44,6 +44,9 @@ div.inlinecontent { .pagefooter { clear: both; } +.inlinefooter { + clear: both; +} .tags { } -- cgit v1.2.3 From 503d83ffbc358714ad84e46ce523b8702268edb6 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 26 Mar 2009 14:04:28 -0400 Subject: comments: Fix too loose test for comments pages that matched normal pages with "comment_" in their name. Closes: #521322 --- IkiWiki/Plugin/comments.pm | 2 +- debian/changelog | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'debian/changelog') diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index ee53dbc91..5782d9083 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -672,7 +672,7 @@ sub previewcomment ($$$) { sub commentsshown ($) { my $page=shift; - return ! pagespec_match($page, "*/$config{comments_pagename}*", + return ! pagespec_match($page, "internal(*/$config{comments_pagename}*)", location => $page) && pagespec_match($page, $config{comments_pagespec}, location => $page); diff --git a/debian/changelog b/debian/changelog index 01404a2b4..4ba32c8d6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,6 +7,8 @@ ikiwiki (3.09) UNRELEASED; urgency=low not last commit time. * Updated French translation (Jean-Luc Coulon). Closes: #521072 * css: Add clear: both to inlinefooter. + * comments: Fix too loose test for comments pages that matched + normal pages with "comment_" in their name. Closes: #521322 -- Joey Hess Thu, 19 Mar 2009 15:32:49 -0400 -- cgit v1.2.3 From 10822a22b3d8872afb31e1847ee7448af86c574d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 26 Mar 2009 16:45:53 -0400 Subject: comments: Fix anchor ids to be legal xhtml. Closes: #521339 Well, that was a PITA. Luckily, this doesn't break guids to comments in rss feeds, though it does change the links. I haven't put in a warning about needing to rebuild to get this fix. It's probably good enough for new comments to get the fix, without a lot of mass rebuilding. --- IkiWiki/Plugin/comments.pm | 24 ++++++++++++++++++++++-- debian/changelog | 1 + templates/comment.tmpl | 2 +- 3 files changed, 24 insertions(+), 3 deletions(-) (limited to 'debian/changelog') diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index 5782d9083..2ad422f5f 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -224,7 +224,7 @@ sub preprocess { if ($params{page} =~ m/\/(\Q$config{comments_pagename}\E\d+)$/) { $pagestate{$page}{meta}{permalink} = urlto(IkiWiki::dirname($params{page}), undef, 1). - "#".$params{page}; + "#".page_to_id($params{page}); } eval q{use Date::Parse}; @@ -490,7 +490,8 @@ sub editcomment ($$) { # Jump to the new comment on the page. # The trailing question mark tries to avoid broken # caches and get the most recent version of the page. - IkiWiki::redirect($cgi, urlto($page, undef, 1)."?updated#$location"); + IkiWiki::redirect($cgi, urlto($page, undef, 1). + "?updated#".page_to_id($location)); } else { @@ -759,6 +760,10 @@ sub pagetemplate (@) { if (!exists $commentstate{$page}) { return; } + + if ($template->query(name => 'commentid')) { + $template->param(commentid => page_to_id($page)); + } if ($template->query(name => 'commentuser')) { $template->param(commentuser => @@ -808,6 +813,21 @@ sub unique_comment_location ($) { return $location; } +sub page_to_id ($) { + # Converts a comment page name into a unique, legal html id + # addtibute value, that can be used as an anchor to link to the + # comment. + my $page=shift; + + # It needs to start with a letter. + $page="comment_".$page; + + # Encode any illegal characters. + $page=~s/([^A-Za-z0-9-_:.])/"__".ord($1)."__"/eg; + + return $page; +} + package IkiWiki::PageSpec; sub match_postcomment ($$;@) { diff --git a/debian/changelog b/debian/changelog index 4ba32c8d6..158db9a4d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,6 +9,7 @@ ikiwiki (3.09) UNRELEASED; urgency=low * css: Add clear: both to inlinefooter. * comments: Fix too loose test for comments pages that matched normal pages with "comment_" in their name. Closes: #521322 + * comments: Fix anchor ids to be legal xhtml. Closes: #521339 -- Joey Hess Thu, 19 Mar 2009 15:32:49 -0400 diff --git a/templates/comment.tmpl b/templates/comment.tmpl index 1b9064ea0..fb76ea004 100644 --- a/templates/comment.tmpl +++ b/templates/comment.tmpl @@ -1,4 +1,4 @@ -
+
-- cgit v1.2.3