| 42 | | # If we support extended (square bracket) links, update those |
| 43 | | if($self->{_extended_links}) { |
| 44 | | $content =~ s/\[$from\]/\[$to\]/g; |
| 45 | | $content =~ s/\[$from(\s*|.*?)\]/\[$to$1\]/g; |
| 46 | | } |
| | 42 | # If we support extended (square bracket) links, update those |
| | 43 | if($self->{_extended_links}) { |
| | 44 | $content =~ s/\[$from\]/\[$to\]/g; |
| | 45 | $content =~ s/\[$from(\s*|.*?)\]/\[$to$1\]/g; |
| | 46 | } |
| 48 | | # If we support implicit (camelcase) links, update those |
| 49 | | if($self->{_implicit_links}) { |
| 50 | | $content =~ s/\b$from\b/$to/g; |
| 51 | | $content =~ s/^$from\b/$to/gm; |
| 52 | | $content =~ s/\b$from$/$to/gm; |
| 53 | | } |
| | 48 | # If we support implicit (camelcase) links, update those |
| | 49 | if($self->{_implicit_links}) { |
| | 50 | $content =~ s/\b$from\b/$to/g; |
| | 51 | $content =~ s/^$from\b/$to/gm; |
| | 52 | $content =~ s/\b$from$/$to/gm; |
| | 53 | } |
| 74 | | { link => sub { |
| 75 | | my ($link, $opts) = @_; |
| 76 | | $opts ||= {}; |
| 77 | | my $title; |
| 78 | | ($link, $title) = split(/\|/, $link, 2) |
| 79 | | if $opts->{extended}; |
| 80 | | push @Wiki::Toolkit::Formatter::WikiLinkFormatterParent::_links_found, |
| 81 | | $link; |
| 82 | | return ""; # don't care about output |
| 83 | | } |
| 84 | | }, |
| 85 | | { |
| 86 | | extended => $self->{_extended_links}, |
| 87 | | prefix => $self->{_node_prefix}, |
| 88 | | implicit_links => $self->{_implicit_links} |
| 89 | | } |
| 90 | | ); |
| | 74 | { link => sub { |
| | 75 | my ($link, $opts) = @_; |
| | 76 | $opts ||= {}; |
| | 77 | my $title; |
| | 78 | ($link, $title) = split(/\|/, $link, 2) |
| | 79 | if $opts->{extended}; |
| | 80 | push @Wiki::Toolkit::Formatter::WikiLinkFormatterParent::_links_found, |
| | 81 | $link; |
| | 82 | return ""; # don't care about output |
| | 83 | } |
| | 84 | }, |
| | 85 | { |
| | 86 | extended => $self->{_extended_links}, |
| | 87 | prefix => $self->{_node_prefix}, |
| | 88 | implicit_links => $self->{_implicit_links} |
| | 89 | } |
| | 90 | ); |