3 package IkiWiki::Plugin::camelcase;
9 # This regexp is based on the one in Text::WikiFormat.
11 (?<![^A-Za-z0-9\s]) # try to avoid expanding non-links with a
12 # zero width negative lookbehind for
13 # characters that suggest it's not a link
17 [A-Z] # Uppercase start
18 [a-z0-9] # followed by lowercase
19 \w* # and rest of word
26 hook(type => "getsetup", id => "camelcase", call => \&getsetup);
27 hook(type => "linkify", id => "camelcase", call => \&linkify);
28 hook(type => "scan", id => "camelcase", call => \&scan);
40 description => "list of words to not turn into links",
42 rebuild => undef, # might change links
48 my $page=$params{page};
49 my $destpage=$params{destpage};
51 $params{content}=~s{$link_regexp}{
52 ignored($1) ? $1 : htmllink($page, $destpage, linkpage($1))
55 return $params{content};
60 my $page=$params{page};
61 my $content=$params{content};
63 while ($content =~ /$link_regexp/g) {
64 push @{$links{$page}}, linkpage($1) unless ignored($1)
70 grep { $word eq lc $_ } @{$config{'camelcase_ignore'}}