X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/8a888a8fedd63622154865f0b67b3558879ae613..9c6444bf681ec48e3832282906d1d2cfad586cb5:/IkiWiki/Plugin/inline.pm diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index 1fbd8b69c..9a63ea1c9 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -11,6 +11,7 @@ use URI; my %knownfeeds; my %page_numfeeds; my @inline; +my $nested=0; sub import { #{{{ hook(type => "getopt", id => "inline", call => \&getopt); @@ -69,12 +70,12 @@ sub sessioncgi () { #{{{ my $session=shift; if ($q->param('do') eq 'blog') { - my $page=decode_utf8($q->param('title')); - $page=~s/\///g; # no slashes in blog posts + my $page=IkiWiki::titlepage(decode_utf8($q->param('title'))); + $page=~s/(\/)/"__".ord($1)."__"/eg; # don't create subdirs # if the page already exists, munge it to be unique my $from=$q->param('from'); my $add=""; - while (exists $IkiWiki::pagecase{lc($from."/".IkiWiki::titlepage($page).$add)}) { + while (exists $IkiWiki::pagecase{lc($from."/".$page.$add)}) { $add=1 unless length $add; $add++; } @@ -277,7 +278,7 @@ sub preprocess_inline (@) { #{{{ } if (length $config{cgiurl} && defined $type) { $template->param(have_actions => 1); - $template->param(editurl => cgiurl(do => "edit", page => pagetitle($page, 1))); + $template->param(editurl => cgiurl(do => "edit", page => $page)); } } @@ -329,7 +330,7 @@ sub preprocess_inline (@) { #{{{ } } - return $ret if $raw; + return $ret if $raw || $nested; push @inline, $ret; return "
\n\n"; } #}}} @@ -350,11 +351,14 @@ sub get_inline_content ($$) { #{{{ my $file=$pagesources{$page}; my $type=pagetype($file); if (defined $type) { - return htmlize($page, $type, + $nested++; + my $ret=htmlize($page, $destpage, $type, linkify($page, $destpage, preprocess($page, $destpage, filter($page, $destpage, readfile(srcfile($file)))))); + $nested--; + return $ret; } else { return ""; @@ -438,6 +442,13 @@ sub genfeed ($$$$@) { #{{{ mdate_3339 => date_3339($pagemtime{$p}), ); + if (exists $pagestate{$p} && + exists $pagestate{$p}{meta}{uuid}) { + my $atom_id = $pagestate{$p}{meta}{uuid}; + + $itemtemplate->param(uuid => $atom_id); + } + if ($itemtemplate->query(name => "enclosure")) { my $file=$pagesources{$p}; my $type=pagetype($file);