return;
}
elsif ($form->submitted eq "Preview") {
+ my $new=not exists $pagesources{$page};
+ if ($new) {
+ # temporarily record its type
+ $pagesources{$page}=$page.".".$type;
+ }
+
my $content=$form->field('editcontent');
run_hooks(editcontent => sub {
$content=shift->(
linkify($page, $page,
preprocess($page, $page,
filter($page, $page, $content), 0, 1))));
+
+ if ($new) {
+ delete $pagesources{$page};
+ }
# previewing may have created files on disk
saveindex();
}
* Correct bug in encoding of %pagestate keys, fixes edittemplate.
* Detect invalid pagespecs and do not merge them in add_depends,
as that can result in a broken merged pagespec that matches nothing.
+ * Record new pages in %pagesources temporarily when previewing so that
+ things that need to know the page source or type can query it from there.
+ Fixes previewing of tables when creating a new page.
-- martin f. krafft <madduck@debian.org> Sun, 02 Mar 2008 17:46:38 +0100