From ad303e878e65c72bf31eb676ced866be56bbee91 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 13 Nov 2009 15:10:58 -0500 Subject: inline: Allow direct inclusion of non-page files in raw mode. --- IkiWiki/Plugin/inline.pm | 6 +++++- debian/changelog | 1 + doc/bugs/inline_raw_broken_on_unknown_pagetype.mdwn | 8 ++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index 001d2ed1a..8e7fa9958 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -337,7 +337,7 @@ sub preprocess_inline (@) { foreach my $page (@list) { my $file = $pagesources{$page}; my $type = pagetype($file); - if (! $raw || ($raw && ! defined $type)) { + if (! $raw) { if ($needcontent) { # Get the content before populating the # template, since getting the content uses @@ -391,6 +391,10 @@ sub preprocess_inline (@) { filter($page, $params{destpage}, readfile(srcfile($file))))); } + else { + $ret.="\n". + readfile(srcfile($file)); + } } } } diff --git a/debian/changelog b/debian/changelog index 5a2d94e23..b25651f42 100644 --- a/debian/changelog +++ b/debian/changelog @@ -14,6 +14,7 @@ ikiwiki (3.20091032) UNRELEASED; urgency=low only when ikiwiki needs authentication, rather than for any access to the cgi/wiki. * inline: Do not generated feeds for nested inlines. + * inline: Allow direct inclusion of non-page files in raw mode. -- Joey Hess Fri, 06 Nov 2009 12:04:29 -0500 diff --git a/doc/bugs/inline_raw_broken_on_unknown_pagetype.mdwn b/doc/bugs/inline_raw_broken_on_unknown_pagetype.mdwn index 814074e08..e43540c65 100644 --- a/doc/bugs/inline_raw_broken_on_unknown_pagetype.mdwn +++ b/doc/bugs/inline_raw_broken_on_unknown_pagetype.mdwn @@ -17,3 +17,11 @@ this situation. If we explicitely don't want to allow raw inlining of unknown page types, ikiwiki should output a better error message. + +> I have made it just do a direct include if the page type is not known, in +> raw mode. That seems useful if you want to include some other file right +> into a page. You could probably even wrap it in a format directive. +> +> It does allow including binary files right into a page, but nothing is +> stopping you pasting binary data right into the edit form either, so +> while annoying I don't think that will be a security problem. --[[Joey]] -- cgit v1.2.3