261 |
$WORDS_IN_PAGE |
$WORDS_IN_PAGE |
262 |
$ICONS |
$ICONS |
263 |
$UNNUMBERED_SYMBOL_IN_MENU |
$UNNUMBERED_SYMBOL_IN_MENU |
264 |
|
$SIMPLE_MENU |
265 |
$MENU_SYMBOL |
$MENU_SYMBOL |
266 |
$OPEN_QUOTE_SYMBOL |
$OPEN_QUOTE_SYMBOL |
267 |
$CLOSE_QUOTE_SYMBOL |
$CLOSE_QUOTE_SYMBOL |
7612 |
#print STDERR "END FORMAT $format\n"; |
#print STDERR "END FORMAT $format\n"; |
7613 |
#dump_stack($text, $stack, $state); |
#dump_stack($text, $stack, $state); |
7614 |
#sleep 1; |
#sleep 1; |
7615 |
close_menu($text, $stack, $state, $line_nr) if ($format_type{$format} eq 'menu'); |
if ($format_type{$format} eq 'menu') |
7616 |
|
{ |
7617 |
|
$state->{'menu'}--; |
7618 |
|
close_menu($text, $stack, $state, $line_nr); |
7619 |
|
} |
7620 |
if (($format_type{$format} eq 'list') or ($format_type{$format} eq 'table')) |
if (($format_type{$format} eq 'list') or ($format_type{$format} eq 'table')) |
7621 |
{ # those functions return if they detect an inapropriate context |
{ # those functions return if they detect an inapropriate context |
7622 |
add_item($text, $stack, $state, $line_nr, '', 1); # handle lists |
add_item($text, $stack, $state, $line_nr, '', 1); # handle lists |
7677 |
delete $state->{'float'}; |
delete $state->{'float'}; |
7678 |
} |
} |
7679 |
} |
} |
7680 |
elsif ($format_type{$format} eq 'menu') |
elsif (exists ($Texi2HTML::Config::complex_format_map->{$format})) |
|
{ |
|
|
if ($state->{'preformatted'}) |
|
|
{ |
|
|
# end the fake complex format |
|
|
$state->{'preformatted'}--; |
|
|
pop @{$state->{'preformatted_stack'}}; |
|
|
pop @$stack; |
|
|
} |
|
|
$state->{'menu'}--; |
|
|
add_prev($text, $stack, &$Texi2HTML::Config::menu($format_ref->{'text'})); |
|
|
} |
|
|
elsif ($format_type{$format} eq 'complex') |
|
7681 |
{ |
{ |
7682 |
$state->{'preformatted'}--; |
$state->{'preformatted'}--; |
7683 |
pop @{$state->{'preformatted_stack'}}; |
pop @{$state->{'preformatted_stack'}}; |
7711 |
add_prev($text, $stack, &$Texi2HTML::Config::table_list($format_ref->{'format'}, $format_ref->{'text'}, $format_ref->{'command'})); |
add_prev($text, $stack, &$Texi2HTML::Config::table_list($format_ref->{'format'}, $format_ref->{'text'}, $format_ref->{'command'})); |
7712 |
} |
} |
7713 |
} |
} |
7714 |
|
elsif ($format_type{$format} eq 'menu') |
7715 |
|
{ |
7716 |
|
# it should be short-circuited if $Texi2HTML::Config::SIMPLE_MENU |
7717 |
|
if ($state->{'preformatted'}) |
7718 |
|
{ |
7719 |
|
# end the fake complex format |
7720 |
|
$state->{'preformatted'}--; |
7721 |
|
pop @{$state->{'preformatted_stack'}}; |
7722 |
|
pop @$stack; |
7723 |
|
} |
7724 |
|
add_prev($text, $stack, &$Texi2HTML::Config::menu($format_ref->{'text'})); |
7725 |
|
} |
7726 |
elsif ($format eq 'quotation') |
elsif ($format eq 'quotation') |
7727 |
{ |
{ |
7728 |
my $quotation_args = pop @{$state->{'quotation_stack'}}; |
my $quotation_args = pop @{$state->{'quotation_stack'}}; |
7808 |
dump_stack($text, $stack, $state); |
dump_stack($text, $stack, $state); |
7809 |
} |
} |
7810 |
add_prev($text, $stack, &$Texi2HTML::Config::menu_comment($menu_comment->{'text'})); |
add_prev($text, $stack, &$Texi2HTML::Config::menu_comment($menu_comment->{'text'})); |
7811 |
pop @{$state->{'preformatted_stack'}}; |
unless ($Texi2HTML::Config::SIMPLE_MENU) |
7812 |
$state->{'preformatted'}--; |
{ |
7813 |
|
pop @{$state->{'preformatted_stack'}}; |
7814 |
|
$state->{'preformatted'}--; |
7815 |
|
} |
7816 |
$state->{'menu_comment'}--; |
$state->{'menu_comment'}--; |
7817 |
} |
} |
7818 |
if ($state->{'menu_entry'}) |
if ($state->{'menu_entry'}) |
9826 |
{ |
{ |
9827 |
$state->{'menu_comment'}++; |
$state->{'menu_comment'}++; |
9828 |
push @$stack, {'format' => 'menu_comment', 'text' => ''}; |
push @$stack, {'format' => 'menu_comment', 'text' => ''}; |
9829 |
push @{$state->{'preformatted_stack'}}, {'pre_style' => $Texi2HTML::Config::MENU_PRE_STYLE, 'class' => 'menu-comment' }; |
unless ($Texi2HTML::Config::SIMPLE_MENU) |
9830 |
$state->{'preformatted'}++; |
{ |
9831 |
begin_paragraph($stack, $state); |
push @{$state->{'preformatted_stack'}}, {'pre_style' => $Texi2HTML::Config::MENU_PRE_STYLE, 'class' => 'menu-comment' }; |
9832 |
|
$state->{'preformatted'}++; |
9833 |
|
begin_paragraph($stack, $state); |
9834 |
|
} |
9835 |
} |
} |
9836 |
#dump_stack ($text, $stack, $state); |
#dump_stack ($text, $stack, $state); |
9837 |
} |
} |
10032 |
{ |
{ |
10033 |
echo_error ("\@end $end_tag without corresponding opening element", $line_nr); |
echo_error ("\@end $end_tag without corresponding opening element", $line_nr); |
10034 |
add_prev($text, $stack, "\@end $end_tag"); |
add_prev($text, $stack, "\@end $end_tag"); |
10035 |
|
dump_stack ($text, $stack, $state) if ($T2H_DEBUG); |
10036 |
next; |
next; |
10037 |
} |
} |
10038 |
# Warn if the format on top of stack is not compatible with the |
# Warn if the format on top of stack is not compatible with the |
10546 |
{ |
{ |
10547 |
close_paragraph($text, $stack, $state, $line_nr); |
close_paragraph($text, $stack, $state, $line_nr); |
10548 |
} |
} |
10549 |
|
if ($format_type{$macro} eq 'menu') |
10550 |
|
{ |
10551 |
|
close_menu($text, $stack, $state, $line_nr); |
10552 |
|
$state->{'menu'}++; |
10553 |
|
} |
10554 |
#print STDERR "begin $macro\n"; |
#print STDERR "begin $macro\n"; |
10555 |
# A deff like macro |
# A deff like macro |
10556 |
if (defined($Texi2HTML::Config::def_map{$macro})) |
if (defined($Texi2HTML::Config::def_map{$macro})) |
10614 |
#add_prev ($text, $stack, &$Texi2HTML::Config::def_line($category, $name, $type, $arguments, $index_label)); |
#add_prev ($text, $stack, &$Texi2HTML::Config::def_line($category, $name, $type, $arguments, $index_label)); |
10615 |
#return; |
#return; |
10616 |
} |
} |
|
elsif ($format_type{$macro} eq 'menu') |
|
|
{ |
|
|
# if we are allready in a menu we must close it first |
|
|
# in order to close the menu comments and entries |
|
|
close_menu($text, $stack, $state, $line_nr); |
|
|
$state->{'menu'}++; |
|
|
push @$stack, { 'format' => $macro, 'text' => '' }; |
|
|
if ($state->{'preformatted'}) |
|
|
{ |
|
|
# Start a fake complex format in order to have a given pre style |
|
|
$state->{'preformatted'}++; |
|
|
push @$stack, { 'format' => 'menu_preformatted', 'text' => '', 'pre_style' => $Texi2HTML::Config::MENU_PRE_STYLE }; |
|
|
push @{$state->{'preformatted_stack'}}, {'pre_style' => $Texi2HTML::Config::MENU_PRE_STYLE, 'class' => 'menu-preformatted' }; |
|
|
} |
|
|
} |
|
10617 |
elsif (exists ($Texi2HTML::Config::complex_format_map->{$macro})) |
elsif (exists ($Texi2HTML::Config::complex_format_map->{$macro})) |
10618 |
{ |
{ |
10619 |
$state->{'preformatted'}++; |
$state->{'preformatted'}++; |
10620 |
my $format = { 'format' => $macro, 'text' => '', 'pre_style' => $Texi2HTML::Config::complex_format_map->{$macro}->{'pre_style'} }; |
my $complex_format = $Texi2HTML::Config::complex_format_map->{$macro}; |
10621 |
push @{$state->{'preformatted_stack'}}, {'pre_style' =>$Texi2HTML::Config::complex_format_map->{$macro}->{'pre_style'}, 'class' => $macro }; |
my $format = { 'format' => $macro, 'text' => '', 'pre_style' => $complex_format->{'pre_style'} }; |
10622 |
|
my $class = $macro; |
10623 |
|
$class = $complex_format->{'class'} if (defined($complex_format->{'class'})); |
10624 |
|
push @{$state->{'preformatted_stack'}}, {'pre_style' =>$complex_format->{'pre_style'}, 'class' => $class }; |
10625 |
push @$stack, $format; |
push @$stack, $format; |
10626 |
unless ($Texi2HTML::Config::format_in_paragraph{$macro}) |
unless ($Texi2HTML::Config::format_in_paragraph{$macro}) |
10627 |
{ |
{ |
10643 |
begin_paragraph($stack, $state); |
begin_paragraph($stack, $state); |
10644 |
} |
} |
10645 |
} |
} |
10646 |
|
elsif ($format_type{$macro} eq 'menu') |
10647 |
|
{ |
10648 |
|
# if we are allready in a menu we must close it first |
10649 |
|
# in order to close the menu comments and entries |
10650 |
|
# if $Texi2HTML::Config::SIMPLE_MENU it should be |
10651 |
|
# short-cicuited as it should be a complex format |
10652 |
|
push @$stack, { 'format' => $macro, 'text' => '' }; |
10653 |
|
if ($state->{'preformatted'}) |
10654 |
|
{ |
10655 |
|
# Start a fake complex format in order to have a given pre style |
10656 |
|
$state->{'preformatted'}++; |
10657 |
|
push @$stack, { 'format' => 'menu_preformatted', 'text' => '', 'pre_style' => $Texi2HTML::Config::MENU_PRE_STYLE }; |
10658 |
|
push @{$state->{'preformatted_stack'}}, {'pre_style' => $Texi2HTML::Config::MENU_PRE_STYLE, 'class' => 'menu-preformatted' }; |
10659 |
|
} |
10660 |
|
} |
10661 |
elsif (($format_type{$macro} eq 'list') or ($format_type{$macro} eq 'table')) |
elsif (($format_type{$macro} eq 'list') or ($format_type{$macro} eq 'table')) |
10662 |
{ |
{ |
10663 |
my $format; |
my $format; |