File Coverage

blib/lib/HTML/Lint/Pluggable/RDFa.pm
Criterion Covered Total %
statement 15 15 100.0
branch n/a
condition 1 2 50.0
subroutine 6 6 100.0
pod 0 1 0.0
total 22 24 91.6


line stmt bran cond sub pod time code
1             package HTML::Lint::Pluggable::RDFa;
2              
3 1     1   457 use 5.008_001;
  1         3  
4 1     1   5 use strict;
  1         1  
  1         18  
5 1     1   4 use warnings;
  1         2  
  1         28  
6              
7 1     1   4 use parent qw/ HTML::Lint::Pluggable::WhiteList /;
  1         2  
  1         5  
8              
9             my %rdfa_attrs = map { $_ => 1 } qw/
10             about content datatype inlist prefix property rel resource rev
11             typeof vocab /;
12              
13             sub init {
14 2     2 0 4 my ( $class, $lint ) = @_;
15             $class->SUPER::init(
16             $lint => +{
17             rule => +{
18             'attr-unknown' => sub {
19 4     4   5 my $param = shift;
20 4   50     17 return exists $rdfa_attrs{ $param->{attr} } || 0;
21             },
22             }
23             }
24 2         14 );
25             }
26              
27             1;
28              
29             __END__