version 1.286, 2005/09/19 10:59:08
|
version 1.289, 2005/10/18 21:30:49
|
Line 55 BEGIN {
|
Line 55 BEGIN {
|
|
|
} |
} |
|
|
|
|
sub initialize_londefdef { |
sub initialize_londefdef { |
$Apache::londefdef::TD_redirection=0; |
$Apache::londefdef::TD_redirection=0; |
@Apache::londefdef::table = (); |
@Apache::londefdef::table = (); |
Line 1206 sub start_br {
|
Line 1207 sub start_br {
|
} elsif ($target eq 'tex') { |
} elsif ($target eq 'tex') { |
my @tempo=@$tagstack; |
my @tempo=@$tagstack; |
my $signal=0; |
my $signal=0; |
|
# Not going to factor this to is_inside_of since that would require |
|
# multiple stack traversals. |
|
# |
for (my $i=$#tempo;$i>=0;$i--) { |
for (my $i=$#tempo;$i>=0;$i--) { |
if (($tempo[$i] eq 'b') || ($tempo[$i] eq 'strong') || |
if (($tempo[$i] eq 'b') || ($tempo[$i] eq 'strong') || |
($tempo[$i] eq 'ol') || ($tempo[$i] eq 'ul') || |
($tempo[$i] eq 'ol') || ($tempo[$i] eq 'ul') || |
Line 2527 sub start_img {
|
Line 2531 sub start_img {
|
my $inside = &Apache::lonxml::get_all_text("/img",$parser); |
my $inside = &Apache::lonxml::get_all_text("/img",$parser); |
return ''; |
return ''; |
} |
} |
$Apache::lonxml::extlinks[$#Apache::lonxml::extlinks+1]=$src; |
push(@Apache::lonxml::extlinks, |
|
&Apache::lonnet::clutter(&Apache::lonnet::hreflocation($Apache::lonxml::pwd[-1],$src))); |
my $currentstring = ''; |
my $currentstring = ''; |
my $scaling = .3; |
my $scaling = .3; |
|
|
Line 2560 sub start_img {
|
Line 2565 sub start_img {
|
$safeeval, |
$safeeval, |
undef,1)); |
undef,1)); |
if(!$align) { |
if(!$align) { |
$align = "bottom"; # This is html's default so it's ours too. |
if (&is_inside_of($tagstack, "table")) { |
|
$align = "right"; # Force wraptext use. |
|
} else { |
|
$align = "bottom"; # This is html's default so it's ours too. |
|
} |
} |
} |
# |
# |
&Apache::lonxml::debug("Alignemnt = $align"); |
&Apache::lonxml::debug("Alignemnt = $align"); |
Line 2577 sub start_img {
|
Line 2586 sub start_img {
|
undef,0); |
undef,0); |
&Apache::lonxml::debug("LaTeX rendering = $latex_rendering"); |
&Apache::lonxml::debug("LaTeX rendering = $latex_rendering"); |
if(!$latex_rendering) { |
if(!$latex_rendering) { |
$latex_rendering = "parbox"; |
$latex_rendering = "texwrap"; |
} |
} |
&Apache::lonxml::debug("LaTeX rendering = $latex_rendering image file: $src"); |
&Apache::lonxml::debug("LaTeX rendering = $latex_rendering image file: $src"); |
|
|
Line 4091 sub LATEX_length {
|
Line 4100 sub LATEX_length {
|
} |
} |
|
|
|
|
|
# is_inside_of $tagstack $tag |
|
# This sub returns true if the current state of Xml processing |
|
# is inside of the tag. |
|
# Parameters: |
|
# tagstack - The tagstack from the parser. |
|
# tag - The tag (without the <>'s.). |
|
# Sample usage: |
|
# if (is_inside_of($tagstack "table")) { |
|
# # I'm in a table.... |
|
# } |
|
sub is_inside_of { |
|
my ($tagstack, $tag) = @_; |
|
my @stack = @$tagstack; |
|
for (my $i = ($#stack - 1); $i >= 0; $i--) { |
|
if ($stack[$i] eq $tag) { |
|
return 1; |
|
} |
|
} |
|
return 0; |
|
} |
|
|
|
|
1; |
1; |