Skip to content

Commit

Permalink
Merge pull request #8 from tsibley/filter-regexp-multiple-entries
Browse files Browse the repository at this point in the history
Filter::Regexp now works on each entry as intended
  • Loading branch information
miyagawa committed Oct 8, 2014
2 parents 2279039 + 845e966 commit b28528d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/Plagger/Plugin/Filter/Regexp.pm
Expand Up @@ -17,7 +17,7 @@ sub filter {
my($self, $body) = @_;

local $_ = $body;
my $regexp = decode_utf8($self->conf->{regexp}, Encode::FB_CROAK);
my $regexp = decode_utf8($self->conf->{regexp}, Encode::FB_CROAK | Encode::LEAVE_SRC);
my $count = eval $regexp;

if ($@) {
Expand Down
5 changes: 4 additions & 1 deletion t/plugins/Filter-Regexp/base.t
Expand Up @@ -15,9 +15,12 @@ plugins:
entry:
- title: bar
body: Plagger
- title: baz
body: Plagger, she said.
- module: Filter::Regexp
config:
regexp: s/Plagger/Plagger is a pluggable aggregator/g
text_only: 1
--- expected
is $context->update->feeds->[0]->entries->[0]->body, "Plagger is a pluggable aggregator"
is $context->update->feeds->[0]->entries->[0]->body, "Plagger is a pluggable aggregator";
is $context->update->feeds->[0]->entries->[1]->body, "Plagger is a pluggable aggregator, she said.";

0 comments on commit b28528d

Please sign in to comment.