diff options
author | Joey Hess <joey@kodama.kitenet.net> | 2008-11-05 15:09:54 -0500 |
---|---|---|
committer | Joey Hess <joey@kodama.kitenet.net> | 2008-11-05 15:09:54 -0500 |
commit | ae37bca0e2593f18ed7f6ecb129e2d5bb3c113cc (patch) | |
tree | 868806cee3f4577e799f5fc19f8496382d24f57e /IkiWiki/Plugin | |
parent | 9b16e7f148c36c61e511bcc787d3192b7bb1c3c5 (diff) |
backup refs to injected subs later
In case two plugins both inject replacements for these subs,
backup the ref just before injecting to make sure the most
recent version is seen.
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r-- | IkiWiki/Plugin/po.pm | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index 4bac37656..466ffd0b8 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -27,9 +27,6 @@ memoize("percenttranslated"); # backup references to subs that will be overriden my %origsubs; -$origsubs{'bestlink'}=\&IkiWiki::bestlink; -$origsubs{'beautify_urlpath'}=\&IkiWiki::beautify_urlpath; -$origsubs{'targetpage'}=\&IkiWiki::targetpage; sub import { #{{{ hook(type => "getsetup", id => "po", call => \&getsetup); @@ -38,8 +35,12 @@ sub import { #{{{ hook(type => "filter", id => "po", call => \&filter); hook(type => "htmlize", id => "po", call => \&htmlize); hook(type => "pagetemplate", id => "po", call => \&pagetemplate); + + $origsubs{'bestlink'}=\&IkiWiki::bestlink; inject(name => "IkiWiki::bestlink", call => \&mybestlink); + $origsubs{'beautify_urlpath'}=\&IkiWiki::beautify_urlpath; inject(name => "IkiWiki::beautify_urlpath", call => \&mybeautify_urlpath); + $origsubs{'targetpage'}=\&IkiWiki::targetpage; inject(name => "IkiWiki::targetpage", call => \&mytargetpage); } #}}} |