150 |
die "atom:TextConstruct type error: $element_state->{type}"; |
die "atom:TextConstruct type error: $element_state->{type}"; |
151 |
} |
} |
152 |
}, |
}, |
|
## type=html |
|
|
## TODO: SHOULD be suitable for handling as HTML [HTML4] |
|
|
## TODO: HTML SHOULD be valid as if within <div> |
|
153 |
check_end => sub { |
check_end => sub { |
154 |
my ($self, $item, $element_state) = @_; |
my ($self, $item, $element_state) = @_; |
155 |
if ($element_state->{type} eq 'xhtml' and |
if ($element_state->{type} eq 'xhtml') { |
156 |
not $element_state->{has_div}) { |
unless ($element_state->{has_div}) { |
157 |
$self->{onerror}->(node => $item->{node}, |
$self->{onerror}->(node => $item->{node}, |
158 |
type => 'element missing:div', |
type => 'element missing:div', |
159 |
level => $self->{must_level}); |
level => $self->{must_level}); |
160 |
|
} |
161 |
|
} elsif ($element_state->{type} eq 'html') { |
162 |
|
## TODO: SHOULD be suitable for handling as HTML [HTML4] |
163 |
|
# markup MUST be escaped |
164 |
|
$self->{onsubdoc}->({s => $element_state->{value}, |
165 |
|
container_node => $item->{node}, |
166 |
|
media_type => 'text/html', |
167 |
|
inner_html_element => 'div', |
168 |
|
is_char_string => 1}); |
169 |
} |
} |
170 |
|
|
171 |
$AtomChecker{check_end}->(@_); |
$AtomChecker{check_end}->(@_); |
632 |
check_start => sub { |
check_start => sub { |
633 |
my ($self, $item, $element_state) = @_; |
my ($self, $item, $element_state) = @_; |
634 |
$element_state->{type} = 'text'; |
$element_state->{type} = 'text'; |
635 |
$element_state->{text} = ''; |
$element_state->{value} = ''; |
636 |
}, |
}, |
637 |
check_attrs => $GetAtomAttrsChecker->({ |
check_attrs => $GetAtomAttrsChecker->({ |
638 |
src => sub { |
src => sub { |
762 |
} |
} |
763 |
} |
} |
764 |
|
|
765 |
$element_state->{text} .= $child_node->data; |
$element_state->{value} .= $child_node->data; |
766 |
|
|
767 |
## NOTE: type=text/* has no further restriction (i.e. the content don't |
## NOTE: type=text/* has no further restriction (i.e. the content don't |
768 |
## have to conform to the definition of the type). |
## have to conform to the definition of the type). |
794 |
} elsif ($element_state->{type} eq 'html') { |
} elsif ($element_state->{type} eq 'html') { |
795 |
## TODO: SHOULD be suitable for handling as HTML [HTML4] |
## TODO: SHOULD be suitable for handling as HTML [HTML4] |
796 |
# markup MUST be escaped |
# markup MUST be escaped |
797 |
$self->{onsubdoc}->({s => $element_state->{text}, |
$self->{onsubdoc}->({s => $element_state->{value}, |
798 |
container_node => $item->{node}, |
container_node => $item->{node}, |
799 |
media_type => 'text/html', |
media_type => 'text/html', |
800 |
inner_html_element => 'div', |
inner_html_element => 'div', |