/[suikacvs]/markup/html/whatpm/Whatpm/ContentChecker.pm
Suika

Diff of /markup/html/whatpm/Whatpm/ContentChecker.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.46 by wakaba, Fri Aug 17 11:53:52 2007 UTC revision 1.47 by wakaba, Sun Sep 9 07:57:32 2007 UTC
# Line 33  our $AttrChecker = { Line 33  our $AttrChecker = {
33      },      },
34      lang => sub {      lang => sub {
35        my ($self, $attr) = @_;        my ($self, $attr) = @_;
36          my $value = $attr->value;
37          if ($value eq '') {
38            #
39          } else {
40            require Whatpm::LangTag;
41            Whatpm::LangTag->check_rfc3066_language_tag ($value, sub {
42              my %opt = @_;
43              my $type = 'LangTag:'.$opt{type};
44              $type .= ':' . $opt{subtag} if defined $opt{subtag};
45              $self->{onerror}->(node => $attr, type => $type,
46                                 value => $opt{value}, level => $opt{level});
47            });
48          }
49    
50        ## NOTE: "The values of the attribute are language identifiers        ## NOTE: "The values of the attribute are language identifiers
51        ## as defined by [IETF RFC 3066], Tags for the Identification        ## as defined by [IETF RFC 3066], Tags for the Identification
52        ## of Languages, or its successor; in addition, the empty string        ## of Languages, or its successor; in addition, the empty string
53        ## may be specified." ("may" in lower case)        ## may be specified." ("may" in lower case)
54        $self->{onerror}->(node => $attr, level => 'unsupported',        ## NOTE: Is an RFC 3066-valid (but RFC 4647-invalid) language tag
55                           type => 'language tag');        ## allowed today?
56    
57          ## TODO: test data
58    
59        if ($attr->owner_document->manakai_is_html) { # MUST NOT        if ($attr->owner_document->manakai_is_html) { # MUST NOT
60          $self->{onerror}->(node => $attr, type => 'in HTML:xml:lang');          $self->{onerror}->(node => $attr, type => 'in HTML:xml:lang');
61  ## TODO: Test data...  ## TODO: Test data...

Legend:
Removed from v.1.46  
changed lines
  Added in v.1.47

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24