]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blob - IkiWiki/Plugin/camelcase.pm
fix
[git.ikiwiki.info.git] / IkiWiki / Plugin / camelcase.pm
1 #!/usr/bin/perl
2 # CamelCase links
3 package IkiWiki::Plugin::camelcase;
5 use warnings;
6 use strict;
8 sub import { #{{{
9         IkiWiki::hook(type => "filter", id => "camelcase", call => \&filter);
10 } # }}}
12 sub filter (@) { #{{{
13         my %params=@_;
15         # Make CamelCase links work by promoting them to fullfledged
16         # WikiLinks. This regexp is based on the one in Text::WikiFormat.
17         $params{content}=~s#(?<![[|"/>=])\b((?:[A-Z][a-z0-9]\w*){2,})#[[$1]]#g;
19         return $params{content};
20 } #}}}
22 1