--- loncom/xml/londefdef.pm 2005/11/28 21:58:24 1.296 +++ loncom/xml/londefdef.pm 2005/12/01 18:46:17 1.299 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Tags Default Definition Module # -# $Id: londefdef.pm,v 1.296 2005/11/28 21:58:24 albertel Exp $ +# $Id: londefdef.pm,v 1.299 2005/12/01 18:46:17 albertel Exp $ # # # Copyright Michigan State University Board of Trustees @@ -61,16 +61,16 @@ BEGIN { # Need this 'cause evidently when given an array, Data::Dumper only seems # to dump element 0. # -sub debug_dump_table { - my $lastrow = $#Apache::londefdef::table; - &Apache::lonnet::logthis("Dumping table: Last row index: $lastrow"); - my $row; - for ($row =0; $row <= $lastrow; $row++ ) { - my $text = Dumper($Apache::londefdef::table[$row]); - &Apache::lonnet::logthis("table [ $row ]".$text); - - } -} +#sub debug_dump_table { +# my $lastrow = $#Apache::londefdef::table; +# &Apache::lonnet::logthis("Dumping table: Last row index: $lastrow"); +# my $row; +# for ($row =0; $row <= $lastrow; $row++ ) { +# my $text = Dumper($Apache::londefdef::table[$row]); +# &Apache::lonnet::logthis("table [ $row ]".$text); +# +# } +#} sub initialize_londefdef { $Apache::londefdef::TD_redirection=0; @@ -145,10 +145,11 @@ sub end_m { } sub start_tthoption { - my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; + my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style) = @_; my $result; if ($target eq 'web') { - my $inside = &Apache::lonxml::get_all_text("/tthoption",$parser); + my $inside = &Apache::lonxml::get_all_text("/tthoption",$parser, + $style); $inside=~s/^\s*//; if ($env{'browser.mathml'}) { &tth::ttmoptions($inside); @@ -385,13 +386,13 @@ sub end_title { #-- tag (end tag forbidden) sub start_meta { - my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; + my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style) = @_; my $currentstring = ''; if ($target eq 'web') { my $args=''; if ( $#$parstack > -1 ) { $args=$$parstack[$#$parstack]; } if ($args eq '') { - &Apache::lonxml::get_all_text("/meta",$parser); + &Apache::lonxml::get_all_text("/meta",$parser,$style); } else { $currentstring = $token->[4]; } @@ -454,7 +455,7 @@ sub end_meta { # accessrule sub start_accessrule { - my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; + my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style) = @_; my $currentstring = ''; my $eff=&Apache::lonxml::get_param ('effect',$parstack,$safeeval,undef,1); @@ -473,7 +474,7 @@ sub start_accessrule { my $args=''; if ( $#$parstack > -1 ) { $args=$$parstack[$#$parstack]; } if ($args eq '') { - &Apache::lonxml::get_all_text("/accessrule",$parser); + &Apache::lonxml::get_all_text("/accessrule",$parser,$style); } else { $currentstring = $token->[4]; } @@ -2415,8 +2416,13 @@ sub end_td_tex { push @ {$Apache::londefdef::table[-1]{'minlen'}[$Apache::londefdef::table[-1]{'row_number'}] },$min_length; } } - for (my $in=0; $in<=$#{$Apache::londefdef::table[-1]{'include'}};$in++) { - $data=~s/\\keephidden\{NEW TABLE ENTRY\}/$Apache::londefdef::table[-1]{'include'}[$in] \&/; + for (my $in=0; $in<=$#{$Apache::londefdef::table[-1]{'include'}};$in++) { + my $nested = $Apache::londefdef::table[-1]{'include'}[$in]; + &Apache::lonnet::logthis("Nested: $nested"); + $nested =~ s/\\end\{tabular\}\\strut\\\\/\\end\{tabular\}/; + &Apache::lonnet::logthis("After sub: $nested"); + # $data=~s/\\keephidden\{NEW TABLE ENTRY\}/$Apache::londefdef::table[-1]{'include'}[$in]/; + $data =~ s/\\keephidden\{NEW TABLE ENTRY\}/$nested/; } push @ {$Apache::londefdef::table[-1]{'content'}[-1] },$data; return''; @@ -2575,11 +2581,11 @@ sub end_th { # (Note there seems to also be support for this as a % of page size) # sub start_img { - my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; + my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style) = @_; my $src = &Apache::lonxml::get_param('src',$parstack,$safeeval, undef,1); if (not $src and ($target eq 'web' or $target eq 'tex')) { - my $inside = &Apache::lonxml::get_all_text("/img",$parser); + my $inside = &Apache::lonxml::get_all_text("/img",$parser,$style); return ''; } &Apache::lonxml::extlink($src);