X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/c207086282b2f058f647b7fa810f3da54fe5fe4b..16fd84326915d235c1509e03606d91bd08e7f277:/IkiWiki/Plugin/inline.pm?ds=inline diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index 8f7cd826e..344620ebe 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); @@ -102,7 +103,7 @@ sub preprocess_inline (@) { #{{{ my %params=@_; if (! exists $params{pages}) { - return ""; + return "[[inline ".gettext("missing pages parameter")."]]"; } my $raw=yesno($params{raw}); my $archive=yesno($params{archive}); @@ -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 ""; @@ -389,18 +393,18 @@ sub absolute_urls ($$) { #{{{ my $url=$baseurl; $url=~s/[^\/]+$//; - # what is the non path part of the url? (need it for relative url's starting with / + # what is the non path part of the url? my $top_uri = URI->new($url); - $top_uri->path_query("/"); # reset the path + $top_uri->path_query(""); # reset the path my $urltop = $top_uri->as_string; - $urltop=~s/\/*$//; $content=~s/(param(content => $pcontent); } else { - my ($a, $b, $c, $d, $e, $f, $g, $size) = stat(srcfile($file)); + my $size=(srcfile_stat($file))[8]; my $mime="unknown"; eval q{use File::MimeInfo}; if (! $@) { @@ -505,7 +509,7 @@ sub pingurl (@) { #{{{ defined(my $pid = fork) or error("Can't fork: $!"); return if $pid; chdir '/'; - setsid() or error("Can't start a new session: $!"); + POSIX::setsid() or error("Can't start a new session: $!"); open STDIN, '/dev/null'; open STDOUT, '>/dev/null'; open STDERR, '>&STDOUT' or error("Can't dup stdout: $!");