]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/format.pm
describe unexpected situation where a logged-in user can delete other comments
[git.ikiwiki.info.git] / IkiWiki / Plugin / format.pm
index d54e7113198093a2a939315077f7f99d34c529a8..b596bc0a10343b91cf7287f5b5fa06a81084b055 100644 (file)
@@ -29,22 +29,24 @@ sub preprocess (@) {
        if (! defined $format || ! defined $text) {
                error(gettext("must specify format and text"));
        }
        if (! defined $format || ! defined $text) {
                error(gettext("must specify format and text"));
        }
+               
+       # Other plugins can register htmlizeformat hooks to add support
+       # for page types not suitable for htmlize, or that need special
+       # processing when included via format. Try them until one succeeds.
+       my $ret;
+       IkiWiki::run_hooks(htmlizeformat => sub {
+               $ret=shift->($format, $text)
+                       unless defined $ret;
+       });
+
+       if (defined $ret) {
+               return $ret;
+       }
        elsif (exists $IkiWiki::hooks{htmlize}{$format}) {
                return IkiWiki::htmlize($params{page}, $params{destpage},
                                        $format, $text);
        }
        else {
        elsif (exists $IkiWiki::hooks{htmlize}{$format}) {
                return IkiWiki::htmlize($params{page}, $params{destpage},
                                        $format, $text);
        }
        else {
-               # Other plugins can register htmlizefallback
-               # hooks to add support for page types
-               # not suitable for htmlize. Try them until
-               # one succeeds.
-               my $ret;
-               IkiWiki::run_hooks(htmlizefallback => sub {
-                       $ret=shift->($format, $text)
-                               unless defined $ret;
-               });
-               return $ret if defined $ret;
-
                error(sprintf(gettext("unsupported page format %s"), $format));
        }
 }
                error(sprintf(gettext("unsupported page format %s"), $format));
        }
 }