| 1 | package HTML::Lint::Pluggable::Microdata; | ||
| 2 | |||
| 3 | use 5.008_001; | ||
| 4 | use strict; | ||
| 5 | use warnings; | ||
| 6 | |||
| 7 | use parent qw/ HTML::Lint::Pluggable::WhiteList /; | ||
| 8 | |||
| 9 | my %md_attrs = map { $_ => 1 } qw/ | ||
| 10 | itemid itemprop itemref itemscope itemtype /; | ||
| 11 | |||
| 12 | sub init { | ||
| 13 | my ( $class, $lint ) = @_; | ||
| 14 | $class->SUPER::init( | ||
| 15 | $lint => +{ | ||
| 16 | rule => +{ | ||
| 17 | 'attr-unknown' => sub { | ||
| 18 | my $param = shift; | ||
| 19 | return exists $md_attrs{ $param->{attr} } || 0; | ||
| 20 | }, | ||
| 21 | } | ||
| 22 | } | ||
| 23 | ); | ||
| 24 | } | ||
| 25 | |||
| 26 | 1; | ||
| 27 | |||
| 28 | __END__ |