]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/po.pm
po plugin: htmlize translated content as if it was the same type as the master page
[git.ikiwiki.info.git] / IkiWiki / Plugin / po.pm
index 62632e1dfeea0fbf466856933b8289a940c47d1d..dbeb0b481ac2cd0d4114d397bfedc39a002becfa 100644 (file)
@@ -92,9 +92,13 @@ sub filter (@) { #{{{
 
 sub htmlize (@) { #{{{
        my %params=@_;
+       my $page = $params{page};
        my $content = $params{content};
-       # FIXME: run master page's type htmlize hook
-       return $content;
+       my ($masterpage, $lang) = ($page =~ /(.*)[.]([a-z]{2})$/);
+       my $masterfile = srcfile($pagesources{$masterpage});
+
+       # force content to be htmlize'd as if it was the same type as the master page
+       return IkiWiki::htmlize($page, $page, pagetype($masterfile), $content);
 } #}}}
 
 package IkiWiki::PageSpec;