aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/Render.pm
diff options
context:
space:
mode:
Diffstat (limited to 'IkiWiki/Render.pm')
-rw-r--r--IkiWiki/Render.pm25
1 files changed, 17 insertions, 8 deletions
diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm
index 6d5ea9ee5..e5a1679f8 100644
--- a/IkiWiki/Render.pm
+++ b/IkiWiki/Render.pm
@@ -250,6 +250,22 @@ sub findlinks ($$) { #{{{
}
} #}}}
+sub filter ($$) {
+ my $page=shift;
+ my $content=shift;
+
+ if (exists $hooks{filter}) {
+ foreach my $id (keys %{$hooks{filter}}) {
+ $content=$hooks{filter}{$id}{call}->(
+ page => $page,
+ content => $content
+ );
+ }
+ }
+
+ return $content;
+}
+
sub render ($) { #{{{
my $file=shift;
@@ -260,14 +276,7 @@ sub render ($) { #{{{
my $page=pagename($file);
delete $depends{$page};
- if (exists $hooks{filter}) {
- foreach my $id (keys %{$hooks{filter}}) {
- $content=$hooks{filter}{$id}{call}->(
- page => $page,
- content => $content
- );
- }
- }
+ $content=filter($page, $content);
$links{$page}=[findlinks($page, $content)];