Changeset 281

Show
Ignore:
Timestamp:
03/05/06 02:31:49
Author:
miyagawa
Message:

Filter::Regexp: fixed text_only to handle HTML entities (Thanks to tokuhirom)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/plagger/lib/Plagger/Plugin/Filter/Regexp.pm

    r245 r281  
    22use strict; 
    33use base qw( Plagger::Plugin ); 
     4 
     5use HTML::Entities; 
    46 
    57sub register { 
     
    5860    $p->handler( default => sub { $output .= $_[0] }, "text" ); 
    5961    $p->handler( text => sub { 
    60         my($c, $body) = $self->rewrite($_[0], $regexp); 
     62        my($c, $body) = $self->rewrite( decode_entities($_[0]), $regexp ); 
    6163        $count  += $c; 
    62         $output .= $body
     64        $output .= encode_entities($body, q("<>&))
    6365    }, "text"); 
    6466