diff options
author | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2006-12-21 21:52:06 +0000 |
---|---|---|
committer | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2006-12-21 21:52:06 +0000 |
commit | 31d0021e9cc1c69b094c13096df0ec925e50654c (patch) | |
tree | 996f1dbe4ad85c510a707d9d7c145af0dbc4690a | |
parent | a00bc110b11fefd7cce28d909f00e7fc34926ef6 (diff) |
* Add support for links of the form [[../foo]], this links to the page
* Fix code to make absolute urls for rss feeds, was missing some urls.
* Fix double-escaping of html entities in titles etc in rss feeds
that occured if escaped characters were present in the page filename.
-rw-r--r-- | IkiWiki.pm | 12 | ||||
-rw-r--r-- | IkiWiki/Plugin/inline.pm | 13 | ||||
-rw-r--r-- | debian/changelog | 7 |
3 files changed, 21 insertions, 11 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm index 499d3a71f..54bb1826c 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -327,10 +327,18 @@ sub isinlinableimage ($) { #{{{ $file=~/\.(png|gif|jpg|jpeg)$/i; } #}}} -sub pagetitle ($) { #{{{ +sub pagetitle ($;$) { #{{{ my $page=shift; - $page=~s/__(\d+)__/&#$1;/g; + my $unescaped=shift; + + if ($unescaped) { + $page=~s/__(\d+)__/chr($1)/eg; + } + else { + $page=~s/__(\d+)__/&#$1;/g; + } $page=~y/_/ /; + return $page; } #}}} diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index 78a8813a3..70b353ec5 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -37,7 +37,6 @@ sub checkconfig () { #{{{ error("Must specify url to wiki with --url when using --rss or --atom"); } if ($config{rss}) { - print STDERR "!!\n"; push @{$config{wiki_file_prune_regexps}}, qr/\.rss$/; } if ($config{atom}) { @@ -265,8 +264,8 @@ sub absolute_urls ($$) { #{{{ $url=~s/[^\/]+$//; $content=~s/(<a(?:\s+(?:class|id)="?\w+"?)?)\s+href="(#[^"]+)"/$1 href="$baseurl$2"/ig; - $content=~s/(<a(?:\s+(?:class|id)="?\w+"?)?)\s+href="(?![^:]+:\/\/)([^"]+)"/$1 href="$url$2"/ig; - $content=~s/(<img(?:\s+(?:class|id)="?\w+"?)?)\s+src="(?![^:]+:\/\/)([^"]+)"/$1 src="$url$2"/ig; + $content=~s/(<a(?:\s+(?:class|id)="?\w+"?)?)\s+href="(?!\w+:\/\/)([^"]+)"/$1 href="$url$2"/ig; + $content=~s/(<img(?:\s+(?:class|id)="?\w+"?)?)\s+src="(?!\w+:\/\/)([^"]+)"/$1 src="$url$2"/ig; return $content; } #}}} @@ -300,7 +299,7 @@ sub genfeed ($$$$@) { #{{{ my $pcontent = absolute_urls(get_inline_content($p, $page), $url); $itemtemplate->param( - title => pagetitle(basename($p)), + title => pagetitle(basename($p), 1), url => $u, permalink => $u, date_822 => date_822($pagectime{$p}), @@ -344,7 +343,7 @@ sub genfeed ($$$$@) { #{{{ my $template=template($feedtype."page.tmpl", blind_cache => 1); $template->param( - title => $page ne "index" ? pagetitle($page) : $config{wikiname}, + title => $page ne "index" ? pagetitle($page, 1) : $config{wikiname}, wikiname => $config{wikiname}, pageurl => $url, content => $content, @@ -384,14 +383,14 @@ sub pingurl (@) { #{{{ IkiWiki::unlockwiki(); foreach my $page (keys %toping) { - my $title=pagetitle(basename($page)); + my $title=pagetitle(basename($page), 0); my $url="$config{url}/".htmlpage($page); foreach my $pingurl (@{$config{pingurl}}) { debug("Pinging $pingurl for $page"); eval { my $client = RPC::XML::Client->new($pingurl); my $req = RPC::XML::request->new('weblogUpdates.ping', - $title, $url); + $title, $url); my $res = $client->send_request($req); if (! ref $res) { debug("Did not receive response to ping"); diff --git a/debian/changelog b/debian/changelog index 17c88df07..5c64cd84c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -18,11 +18,14 @@ ikiwiki (1.36) UNRELEASED; urgency=low like, if you want. * Patch from Emanuele Aina to fix modification time code in mercurual backend. - * Add support for links of the form [[../foo]], this links to the page + * Add support for links of the form [[../foo]], this links to the page foo a level higher in the directory hierarchy than the one it would link to by default. + * Fix code to make absolute urls for rss feeds, was missing some urls. + * Fix double-escaping of html entities in titles etc in rss feeds + that occured if escaped characters were present in the page filename. - -- Joey Hess <joeyh@debian.org> Thu, 21 Dec 2006 15:10:03 -0500 + -- Joey Hess <joeyh@debian.org> Thu, 21 Dec 2006 16:28:54 -0500 ikiwiki (1.35) unstable; urgency=low |