]> sipb.mit.edu Git - ikiwiki.git/commitdiff
po plugin: htmlize translated content as if it was the same type as the master page
authorintrigeri <intrigeri@boum.org>
Sun, 5 Oct 2008 17:56:53 +0000 (19:56 +0200)
committerintrigeri <intrigeri@boum.org>
Sat, 18 Oct 2008 13:49:07 +0000 (15:49 +0200)
Signed-off-by: intrigeri <intrigeri@boum.org>
IkiWiki/Plugin/po.pm

index 62632e1dfeea0fbf466856933b8289a940c47d1d..dbeb0b481ac2cd0d4114d397bfedc39a002becfa 100644 (file)
@@ -92,9 +92,13 @@ sub filter (@) { #{{{
 
 sub htmlize (@) { #{{{
        my %params=@_;
 
 sub htmlize (@) { #{{{
        my %params=@_;
+       my $page = $params{page};
        my $content = $params{content};
        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;
 } #}}}
 
 package IkiWiki::PageSpec;