call format hooks when generating page previews
[ikiwiki.git] / IkiWiki / CGI.pm
index 8a294e887554bbf0f145cfedc239dd062ba4bfc9..015c9ae01fbde4f3be3a85bf28f4a429fba54881 100644 (file)
@@ -396,11 +396,17 @@ sub cgi_editpage ($$) { #{{{
                                session => $session,
                        );
                });
-               $form->tmpl_param("page_preview",
-                       htmlize($page, $page, $type,
+               my $preview=htmlize($page, $page, $type,
                        linkify($page, $page,
                        preprocess($page, $page,
-                       filter($page, $page, $content), 0, 1))));
+                       filter($page, $page, $content), 0, 1)));
+               run_hooks(format => sub {
+                       $preview=shift->(
+                               page => $page,
+                               content => $preview,
+                       );
+               });
+               $form->tmpl_param("page_preview", $preview);
        
                if ($new) {
                        delete $pagesources{$page};