254 |
} |
} |
255 |
} |
} |
256 |
return shift @nt; |
return shift @nt; |
257 |
} elsif ($s =~ s/^(\*+)\s*//) { |
} elsif ($s =~ s/^(\*+)[\x09\x20]*//) { |
258 |
push @nt, {type => HEADING_START_TOKEN, depth => length $1, |
push @nt, {type => HEADING_START_TOKEN, depth => length $1, |
259 |
line => $line, column => $column}; |
line => $line, column => $column}; |
260 |
$column += $+[0] - $-[0]; |
$column += $+[0] - $-[0]; |
263 |
line => $line, column => $column}; |
line => $line, column => $column}; |
264 |
undef $continuous_line; |
undef $continuous_line; |
265 |
return shift @nt; |
return shift @nt; |
266 |
} elsif ($s =~ s/^([-=]+)\s*//) { |
} elsif ($s =~ s/^([-=]+)[\x09\x20]*//) { |
267 |
push @nt, {type => LIST_START_TOKEN, depth => $1, |
push @nt, {type => LIST_START_TOKEN, depth => $1, |
268 |
line => $line, column => $column}; |
line => $line, column => $column}; |
269 |
$column += $+[0] - $-[0]; |
$column += $+[0] - $-[0]; |
428 |
$continuous_line = 1; |
$continuous_line = 1; |
429 |
return shift @nt; |
return shift @nt; |
430 |
} |
} |
431 |
}; # $get_next_token_body |
}; # $get_next_token |
432 |
|
|
433 |
## NOTE: The "initial" mode. |
## NOTE: The "initial" mode. |
434 |
if (@s and $s[0] =~ /^#\?/) { |
if (@s and $s[0] =~ /^#\?/) { |
444 |
if defined $version; |
if defined $version; |
445 |
} |
} |
446 |
|
|
447 |
my $head = $doc->first_child; |
my $head = $doc->first_child->first_child; |
448 |
while (length $s) { |
while (length $s) { |
449 |
$column += $+[0] - $-[0] if $s =~ s/^[\x09\x20]+//; |
$column += $+[0] - $-[0] if $s =~ s/^[\x09\x20]+//; |
450 |
my $name = ''; |
my $name = ''; |
492 |
}; |
}; |
493 |
|
|
494 |
my $im = IN_SECTION_IM; |
my $im = IN_SECTION_IM; |
495 |
$get_next_token->(); |
$token = $get_next_token->(); |
496 |
|
|
497 |
A: { |
A: { |
498 |
if ($im == IN_PARAGRAPH_IM) { |
if ($im == IN_PARAGRAPH_IM) { |
499 |
if ($token->{type} == CHARACTER_TOKEN) { |
if ($token->{type} == CHARACTER_TOKEN) { |
500 |
$oe->[-1]->{node}->manakai_append_text ($token->{data}); |
$oe->[-1]->{node}->manakai_append_text ($token->{data}); |
501 |
$get_next_token->(); |
$token = $get_next_token->(); |
502 |
redo A; |
redo A; |
503 |
} elsif ($token->{type} == INLINE_START_TAG_TOKEN) { |
} elsif ($token->{type} == INLINE_START_TAG_TOKEN) { |
504 |
if (not defined $token->{tag_name}) { |
if (not defined $token->{tag_name}) { |
508 |
$el->set_user_data (manakai_source_line => $token->{line}); |
$el->set_user_data (manakai_source_line => $token->{line}); |
509 |
$el->set_user_data (manakai_source_column => $token->{column}); |
$el->set_user_data (manakai_source_column => $token->{column}); |
510 |
|
|
511 |
$get_next_token->(); |
$token = $get_next_token->(); |
512 |
redo A; |
redo A; |
513 |
} else { |
} else { |
514 |
my $type = { |
my $type = { |
546 |
$el->set_attribute_ns (XML_NS, 'xml:lang' => $token->{language}) |
$el->set_attribute_ns (XML_NS, 'xml:lang' => $token->{language}) |
547 |
if defined $token->{language}; |
if defined $token->{language}; |
548 |
|
|
549 |
$get_next_token->(); |
$token = $get_next_token->(); |
550 |
redo A; |
redo A; |
551 |
} |
} |
552 |
} elsif ($token->{type} == INLINE_MIDDLE_TAG_TOKEN) { |
} elsif ($token->{type} == INLINE_MIDDLE_TAG_TOKEN) { |
553 |
my ($ns, $ln, $pop) = @{{ |
my ($ns, $ln, $pop) = @{{ |
554 |
rt => [SW10_NS, 'attrvalue', 1], |
rt => [HTML_NS, 'rt', 1], |
555 |
title => [SW10_NS, 'attrvalue', 1], |
title => [SW10_NS, 'attrvalue', 1], |
556 |
nsuri => [SW10_NS, 'attrvalue', 1], |
nsuri => [SW10_NS, 'attrvalue', 1], |
557 |
qn => [SW10_NS, 'nsuri'], |
qn => [SW10_NS, 'nsuri'], |
569 |
$el->set_attribute_ns (XML_NS, 'xml:lang' => $token->{language}) |
$el->set_attribute_ns (XML_NS, 'xml:lang' => $token->{language}) |
570 |
if defined $token->{language}; |
if defined $token->{language}; |
571 |
|
|
572 |
$get_next_token->(); |
$token = $get_next_token->(); |
573 |
redo A; |
redo A; |
574 |
} elsif ($token->{type} == INLINE_END_TAG_TOKEN) { |
} elsif ($token->{type} == INLINE_END_TAG_TOKEN) { |
575 |
pop @$oe if { |
pop @$oe if { |
601 |
|
|
602 |
pop @$oe; |
pop @$oe; |
603 |
|
|
604 |
$get_next_token->(); |
$token = $get_next_token->(); |
605 |
redo A; |
redo A; |
606 |
} elsif ($token->{type} == STRONG_TOKEN) { |
} elsif ($token->{type} == STRONG_TOKEN) { |
607 |
my $el = $doc->create_element_ns (HTML_NS, 'strong'); |
my $el = $doc->create_element_ns (HTML_NS, 'strong'); |
610 |
$el->set_user_data (manakai_source_line => $token->{line}); |
$el->set_user_data (manakai_source_line => $token->{line}); |
611 |
$el->set_user_data (manakai_source_column => $token->{column}); |
$el->set_user_data (manakai_source_column => $token->{column}); |
612 |
|
|
613 |
$get_next_token->(); |
$token = $get_next_token->(); |
614 |
redo A; |
redo A; |
615 |
} elsif ($token->{type} == EMPHASIS_TOKEN) { |
} elsif ($token->{type} == EMPHASIS_TOKEN) { |
616 |
my $el = $doc->create_element_ns (HTML_NS, 'em'); |
my $el = $doc->create_element_ns (HTML_NS, 'em'); |
619 |
$el->set_user_data (manakai_source_line => $token->{line}); |
$el->set_user_data (manakai_source_line => $token->{line}); |
620 |
$el->set_user_data (manakai_source_column => $token->{column}); |
$el->set_user_data (manakai_source_column => $token->{column}); |
621 |
|
|
622 |
$get_next_token->(); |
$token = $get_next_token->(); |
623 |
redo A; |
redo A; |
624 |
} elsif ($token->{type} == FORM_TOKEN) { |
} elsif ($token->{type} == FORM_TOKEN) { |
625 |
## There is an exact code clone. |
## There is an exact code clone. |
640 |
$el->set_attribute (parameter => join ':', @{$token->{parameters}}) |
$el->set_attribute (parameter => join ':', @{$token->{parameters}}) |
641 |
if @{$token->{parameter}}; |
if @{$token->{parameter}}; |
642 |
|
|
643 |
$get_next_token->(); |
$token = $get_next_token->(); |
644 |
redo A; |
redo A; |
645 |
} else { |
} else { |
646 |
my $el = $doc->create_element_ns (SW09_NS, 'form'); |
my $el = $doc->create_element_ns (SW09_NS, 'form'); |
654 |
$el->set_attribute (parameter => join ':', @{$token->{parameters}}) |
$el->set_attribute (parameter => join ':', @{$token->{parameters}}) |
655 |
if @{$token->{parameter}}; |
if @{$token->{parameter}}; |
656 |
|
|
657 |
$get_next_token->(); |
$token = $get_next_token->(); |
658 |
redo A; |
redo A; |
659 |
} |
} |
660 |
} elsif ($token->{type} == ELEMENT_TOKEN) { |
} elsif ($token->{type} == ELEMENT_TOKEN) { |
676 |
if defined $token->{res_parameter}; |
if defined $token->{res_parameter}; |
677 |
$el->text_content ($token->{content}) if defined $token->{content}; |
$el->text_content ($token->{content}) if defined $token->{content}; |
678 |
|
|
679 |
$get_next_token->(); |
$token = $get_next_token->(); |
680 |
redo A; |
redo A; |
681 |
} elsif ($token->{type} == LABELED_LIST_MIDDLE_TOKEN) { |
} elsif ($token->{type} == LABELED_LIST_MIDDLE_TOKEN) { |
682 |
pop @$oe while not $structural_elements |
pop @$oe while not $structural_elements |
689 |
$el->set_user_data (manakai_source_line => $token->{line}); |
$el->set_user_data (manakai_source_line => $token->{line}); |
690 |
$el->set_user_data (manakai_source_column => $token->{column}); |
$el->set_user_data (manakai_source_column => $token->{column}); |
691 |
|
|
692 |
$get_next_token->(); |
$token = $get_next_token->(); |
693 |
redo A; |
redo A; |
694 |
} elsif ($token->{type} == HEADING_END_TOKEN) { |
} elsif ($token->{type} == HEADING_END_TOKEN) { |
695 |
pop @$oe while not $structural_elements |
pop @$oe while not $structural_elements |
697 |
pop @$oe if $oe->[-1]->{node}->manakai_local_name eq 'h1'; |
pop @$oe if $oe->[-1]->{node}->manakai_local_name eq 'h1'; |
698 |
|
|
699 |
$im = IN_SECTION_IM; |
$im = IN_SECTION_IM; |
700 |
$get_next_token->(); |
$token = $get_next_token->(); |
701 |
redo A; |
redo A; |
702 |
} elsif ($token->{type} == TABLE_CELL_END_TOKEN) { |
} elsif ($token->{type} == TABLE_CELL_END_TOKEN) { |
703 |
pop @$oe while not $structural_elements |
pop @$oe while not $structural_elements |
705 |
pop @$oe if $oe->[-1]->{node}->manakai_local_name eq 'td'; |
pop @$oe if $oe->[-1]->{node}->manakai_local_name eq 'td'; |
706 |
|
|
707 |
$im = IN_TABLE_ROW_IM; |
$im = IN_TABLE_ROW_IM; |
708 |
$get_next_token->(); |
$token = $get_next_token->(); |
709 |
redo A; |
redo A; |
710 |
} elsif (($token->{type} == BLOCK_END_TAG_TOKEN and |
} elsif (($token->{type} == BLOCK_END_TAG_TOKEN and |
711 |
$token->{tag_name} eq 'PRE') or |
$token->{tag_name} eq 'PRE') or |
715 |
pop @$oe if $oe->[-1]->{node}->manakai_local_name eq 'pre'; |
pop @$oe if $oe->[-1]->{node}->manakai_local_name eq 'pre'; |
716 |
|
|
717 |
$im = IN_SECTION_IM; |
$im = IN_SECTION_IM; |
718 |
$get_next_token->(); |
$token = $get_next_token->(); |
719 |
redo A; |
redo A; |
720 |
} else { |
} else { |
721 |
pop @$oe while not $structural_elements |
pop @$oe while not $structural_elements |
722 |
->{$oe->[-1]->{node}->manakai_local_name}; |
->{$oe->[-1]->{node}->manakai_local_name}; |
723 |
|
|
724 |
$im = IN_SECTION_IM; |
$im = IN_SECTION_IM; |
725 |
$get_next_token->(); |
## Reconsume. |
726 |
redo A; |
redo A; |
727 |
} |
} |
728 |
} elsif ($im == IN_SECTION_IM) { |
} elsif ($im == IN_SECTION_IM) { |
729 |
if ($token->{type} == HEADING_START_TOKEN) { |
if ($token->{type} == HEADING_START_TOKEN) { |
730 |
B: { |
B: { |
731 |
pop @$oe and redo B |
pop @$oe and redo B |
732 |
if {body => 1, section => 1, insert => 1, delete => 1} |
if not {body => 1, section => 1, insert => 1, delete => 1} |
733 |
->{$oe->[-1]->{node}->manakai_local_name} or |
->{$oe->[-1]->{node}->manakai_local_name} or |
734 |
$token->{depth} <= $oe->[-1]->{section_depth}; |
$token->{depth} <= $oe->[-1]->{section_depth}; |
735 |
if ($token->{depth} > $oe->[-1]->{section_depth} + 1) { |
if ($token->{depth} > $oe->[-1]->{section_depth} + 1) { |
753 |
push @$oe, {%{$oe->[-1]}, node => $el2}; |
push @$oe, {%{$oe->[-1]}, node => $el2}; |
754 |
|
|
755 |
$im = IN_PARAGRAPH_IM; |
$im = IN_PARAGRAPH_IM; |
756 |
$get_next_token->(); |
$token = $get_next_token->(); |
757 |
redo A; |
redo A; |
758 |
} elsif ($token->{type} == BLOCK_START_TAG_TOKEN and |
} elsif ($token->{type} == BLOCK_START_TAG_TOKEN and |
759 |
($token->{tag_name} eq 'INS' or |
($token->{tag_name} eq 'INS' or |
765 |
quotation_depth => 0, list_depth => 0}; |
quotation_depth => 0, list_depth => 0}; |
766 |
$el->set_attribute (class => $token->{classes}) |
$el->set_attribute (class => $token->{classes}) |
767 |
if defined $token->{classes}; |
if defined $token->{classes}; |
768 |
$get_next_token->(); |
$token = $get_next_token->(); |
769 |
redo A; |
redo A; |
770 |
} elsif ($token->{type} == QUOTATION_START_TOKEN) { |
} elsif ($token->{type} == QUOTATION_START_TOKEN) { |
771 |
B: { |
B: { |
772 |
pop @$oe and redo B |
pop @$oe and redo B |
773 |
if {body => 1, section => 1, insert => 1, delete => 1, |
if not {body => 1, section => 1, insert => 1, delete => 1, |
774 |
blockquote => 1} |
blockquote => 1} |
775 |
->{$oe->[-1]->{node}->manakai_local_name} or |
->{$oe->[-1]->{node}->manakai_local_name} or |
776 |
$token->{depth} <= $oe->[-1]->{quotation_depth}; |
$token->{depth} <= $oe->[-1]->{quotation_depth}; |
790 |
quotation_depth => $oe->[-1]->{quotation_depth} + 1, |
quotation_depth => $oe->[-1]->{quotation_depth} + 1, |
791 |
list_depth => 0}; |
list_depth => 0}; |
792 |
|
|
793 |
$get_next_token->(); |
$token = $get_next_token->(); |
794 |
redo A; |
redo A; |
795 |
} elsif ($token->{type} == LIST_START_TOKEN) { |
} elsif ($token->{type} == LIST_START_TOKEN) { |
796 |
my $depth = length $token->{depth}; |
my $depth = length $token->{depth}; |
797 |
|
my $list_type = substr ($token->{depth}, -1, 1) eq '-' ? 'ul' : 'ol'; |
798 |
B: { |
B: { |
799 |
pop @$oe and redo B if $oe->[-1]->{list_depth} > $depth; |
pop @$oe and redo B if $oe->[-1]->{list_depth} > $depth; |
800 |
|
pop @$oe and redo B if $oe->[-1]->{list_depth} == $depth and |
801 |
|
$list_type ne $oe->[-1]->{node}->manakai_local_name; |
802 |
if ($oe->[-1]->{list_depth} < $depth) { |
if ($oe->[-1]->{list_depth} < $depth) { |
803 |
my $type = substr $token->{depth}, $oe->[-1]->{list_depth}; |
my $type = substr $token->{depth}, $oe->[-1]->{list_depth}, 1; |
804 |
my $el = $doc->create_element_ns |
my $el = $doc->create_element_ns |
805 |
(HTML_NS, $type eq '-' ? 'ul' : 'ol'); |
(HTML_NS, $type eq '-' ? 'ul' : 'ol'); |
806 |
$oe->[-1]->{node}->append_child ($el); |
$oe->[-1]->{node}->append_child ($el); |
814 |
redo B; |
redo B; |
815 |
} |
} |
816 |
} # B |
} # B |
|
|
|
|
pop @$oe if $oe->[-1]->{list_depth} == $depth and |
|
|
not {ul => 1, ol => 1}->{$oe->[-1]->{node}->manakai_local_name}; |
|
817 |
|
|
818 |
my $el = $doc->create_element_ns (HTML_NS, 'li'); |
my $el = $doc->create_element_ns (HTML_NS, 'li'); |
819 |
$oe->[-1]->{node}->append_child ($el); |
$oe->[-1]->{node}->append_child ($el); |
820 |
push @$oe, {%{$oe->[-1]}, node => $el}; |
push @$oe, {%{$oe->[-1]}, node => $el}; |
821 |
|
|
822 |
$im = IN_PARAGRAPH_IM; |
$im = IN_PARAGRAPH_IM; |
823 |
$get_next_token->(); |
$token = $get_next_token->(); |
824 |
redo A; |
redo A; |
825 |
} elsif ($token->{type} == LABELED_LIST_START_TOKEN) { |
} elsif ($token->{type} == LABELED_LIST_START_TOKEN) { |
826 |
pop @$oe if $oe->[-1]->{node}->manakai_local_name eq 'dd'; |
pop @$oe if $oe->[-1]->{node}->manakai_local_name eq 'dd'; |
835 |
push @$oe, {%{$oe->[-1]}, node => $el}; |
push @$oe, {%{$oe->[-1]}, node => $el}; |
836 |
|
|
837 |
$im = IN_PARAGRAPH_IM; |
$im = IN_PARAGRAPH_IM; |
838 |
$get_next_token->(); |
$token = $get_next_token->(); |
839 |
redo A; |
redo A; |
840 |
} elsif ($token->{type} == TABLE_ROW_START_TOKEN) { |
} elsif ($token->{type} == TABLE_ROW_START_TOKEN) { |
841 |
my $el = $doc->create_element_ns (HTML_NS, 'table'); |
my $el = $doc->create_element_ns (HTML_NS, 'table'); |
851 |
push @$oe, {%{$oe->[-1]}, node => $el}; |
push @$oe, {%{$oe->[-1]}, node => $el}; |
852 |
|
|
853 |
$im = IN_TABLE_ROW_IM; |
$im = IN_TABLE_ROW_IM; |
854 |
$get_next_token->(); |
$token = $get_next_token->(); |
855 |
redo A; |
redo A; |
856 |
} elsif (($token->{type} == BLOCK_START_TAG_TOKEN and |
} elsif (($token->{type} == BLOCK_START_TAG_TOKEN and |
857 |
$token->{tag_name} eq 'PRE') or |
$token->{tag_name} eq 'PRE') or |
864 |
if defined $token->{classes}; |
if defined $token->{classes}; |
865 |
|
|
866 |
$im = IN_PARAGRAPH_IM; |
$im = IN_PARAGRAPH_IM; |
867 |
$get_next_token->(); |
$token = $get_next_token->(); |
868 |
redo A; |
redo A; |
869 |
} elsif ($token->{type} == COMMENT_PARAGRAPH_START_TOKEN) { |
} elsif ($token->{type} == COMMENT_PARAGRAPH_START_TOKEN) { |
870 |
my $el = $doc->create_element_ns (SW10_NS, 'comment-p'); |
my $el = $doc->create_element_ns (SW10_NS, 'comment-p'); |
872 |
push @$oe, {%{$oe->[-1]}, node => $el}; |
push @$oe, {%{$oe->[-1]}, node => $el}; |
873 |
|
|
874 |
$im = IN_PARAGRAPH_IM; |
$im = IN_PARAGRAPH_IM; |
875 |
$get_next_token->(); |
$token = $get_next_token->(); |
876 |
redo A; |
redo A; |
877 |
} elsif ($token->{type} == EDITORIAL_NOTE_START_TOKEN) { |
} elsif ($token->{type} == EDITORIAL_NOTE_START_TOKEN) { |
878 |
my $el = $doc->create_element_ns (SW10_NS, 'ed'); |
my $el = $doc->create_element_ns (SW10_NS, 'ed'); |
880 |
push @$oe, {%{$oe->[-1]}, node => $el}; |
push @$oe, {%{$oe->[-1]}, node => $el}; |
881 |
|
|
882 |
$im = IN_PARAGRAPH_IM; |
$im = IN_PARAGRAPH_IM; |
883 |
$get_next_token->(); |
$token = $get_next_token->(); |
884 |
redo A; |
redo A; |
885 |
} elsif ($token->{type} == EMPTY_LINE_TOKEN) { |
} elsif ($token->{type} == EMPTY_LINE_TOKEN) { |
886 |
pop @$oe while {body => 1, section => 1, insert => 1, delete => 1} |
pop @$oe while not {body => 1, section => 1, insert => 1, delete => 1} |
887 |
->{$oe->[-1]->{node}->manakai_local_name}; |
->{$oe->[-1]->{node}->manakai_local_name}; |
888 |
$get_next_token->(); |
$token = $get_next_token->(); |
889 |
redo A; |
redo A; |
890 |
} elsif ($token->{type} == BLOCK_END_TAG_TOKEN) { |
} elsif ($token->{type} == BLOCK_END_TAG_TOKEN) { |
891 |
if ($token->{type} eq 'INS') { |
if ($token->{tag_name} eq 'INS') { |
892 |
for (reverse 1..$#$oe) { |
for (reverse 1..$#$oe) { |
893 |
if ($oe->[$_]->{node}->manakai_local_name eq 'insert') { |
if ($oe->[$_]->{node}->manakai_local_name eq 'insert') { |
894 |
splice @$oe, $_; |
splice @$oe, $_; |
895 |
last; |
last; |
896 |
} |
} |
897 |
} |
} |
898 |
} elsif ($token->{type} eq 'DEL') { |
} elsif ($token->{tag_name} eq 'DEL') { |
899 |
for (reverse 1..$#$oe) { |
for (reverse 1..$#$oe) { |
900 |
if ($oe->[$_]->{node}->manakai_local_name eq 'delete') { |
if ($oe->[$_]->{node}->manakai_local_name eq 'delete') { |
901 |
splice @$oe, $_; |
splice @$oe, $_; |
905 |
} else { |
} else { |
906 |
## NOTE: Ignore the token. |
## NOTE: Ignore the token. |
907 |
} |
} |
908 |
|
$token = $get_next_token->(); |
909 |
|
redo A; |
910 |
} elsif ($token->{type} == FORM_TOKEN) { |
} elsif ($token->{type} == FORM_TOKEN) { |
911 |
## There is an exact code clone. |
## There is an exact code clone. |
912 |
if ($token->{name} eq 'form') { |
if ($token->{name} eq 'form') { |
926 |
$el->set_attribute (parameter => join ':', @{$token->{parameters}}) |
$el->set_attribute (parameter => join ':', @{$token->{parameters}}) |
927 |
if @{$token->{parameter}}; |
if @{$token->{parameter}}; |
928 |
|
|
929 |
$get_next_token->(); |
$token = $get_next_token->(); |
930 |
redo A; |
redo A; |
931 |
} else { |
} else { |
932 |
my $el = $doc->create_element_ns (SW09_NS, 'form'); |
my $el = $doc->create_element_ns (SW09_NS, 'form'); |
940 |
$el->set_attribute (parameter => join ':', @{$token->{parameters}}) |
$el->set_attribute (parameter => join ':', @{$token->{parameters}}) |
941 |
if @{$token->{parameter}}; |
if @{$token->{parameter}}; |
942 |
|
|
943 |
$get_next_token->(); |
$token = $get_next_token->(); |
944 |
redo A; |
redo A; |
945 |
} |
} |
946 |
} elsif ($token->{type} == ELEMENT_TOKEN and |
} elsif ($token->{type} == ELEMENT_TOKEN and |
963 |
if defined $token->{res_parameter}; |
if defined $token->{res_parameter}; |
964 |
$el->text_content ($token->{content}) if defined $token->{content}; |
$el->text_content ($token->{content}) if defined $token->{content}; |
965 |
|
|
966 |
$get_next_token->(); |
$token = $get_next_token->(); |
967 |
redo A; |
redo A; |
968 |
} elsif ($token->{type} == END_OF_FILE_TOKEN) { |
} elsif ($token->{type} == END_OF_FILE_TOKEN) { |
969 |
return; |
return; |
993 |
$el->set_user_data (manakai_source_column => $token->{column}); |
$el->set_user_data (manakai_source_column => $token->{column}); |
994 |
|
|
995 |
$im = IN_PARAGRAPH_IM; |
$im = IN_PARAGRAPH_IM; |
996 |
$get_next_token->(); |
$token = $get_next_token->(); |
997 |
redo A; |
redo A; |
998 |
} elsif ($token->{type} == TABLE_COLSPAN_CELL_TOKEN) { |
} elsif ($token->{type} == TABLE_COLSPAN_CELL_TOKEN) { |
999 |
my $lc = $oe->[-1]->{node}->last_child; |
my $lc = $oe->[-1]->{node}->last_child; |
1007 |
$el->set_user_data (manakai_source_column => $token->{column}); |
$el->set_user_data (manakai_source_column => $token->{column}); |
1008 |
} |
} |
1009 |
|
|
1010 |
$get_next_token->(); |
$token = $get_next_token->(); |
1011 |
redo A; |
redo A; |
1012 |
} elsif ($token->{type} == TABLE_ROW_END_TOKEN) { |
} elsif ($token->{type} == TABLE_ROW_END_TOKEN) { |
1013 |
pop @$oe if $oe->[-1]->{node}->manakai_local_name eq 'tr'; |
pop @$oe if $oe->[-1]->{node}->manakai_local_name eq 'tr'; |
1014 |
$get_next_token->(); |
$token = $get_next_token->(); |
1015 |
redo A; |
redo A; |
1016 |
} elsif ($token->{type} == TABLE_ROW_START_TOKEN) { |
} elsif ($token->{type} == TABLE_ROW_START_TOKEN) { |
1017 |
my $el = $doc->create_element_ns (HTML_NS, 'tr'); |
my $el = $doc->create_element_ns (HTML_NS, 'tr'); |
1020 |
$el->set_user_data (manakai_source_line => $token->{line}); |
$el->set_user_data (manakai_source_line => $token->{line}); |
1021 |
$el->set_user_data (manakai_source_column => $token->{column}); |
$el->set_user_data (manakai_source_column => $token->{column}); |
1022 |
|
|
1023 |
$get_next_token->(); |
$token = $get_next_token->(); |
1024 |
redo A; |
redo A; |
1025 |
} else { |
} else { |
1026 |
$im = IN_SECTION_IM; |
$im = IN_SECTION_IM; |