1 package SCSite::Filter;
5 requires '_filter_stream';
7 sub new_from_site { shift->new }
10 my ($self, @args) = @_;
13 my $config = $self->_parse_config($stream->peek);
14 $self->_filter_stream($stream, $config, @args)
19 my ($self, $evt) = @_;
20 my %config = ( # adapted from CSS::Tiny, extracts -scs- prefix.
21 map { # converts -scs-foo-bar: to foo_bar
22 /^\s*-scs-([\w._-]+)\s*:\s*(.*?)\s*$/;
23 (join('_', split '-', $1), $2);
25 grep { /\S/ } split /\;/, ($evt->{attrs}{style}||'')
27 s/^'(.*)'$/$1/ for values %config;