version 1.315, 2004/03/31 05:24:00
|
version 1.316, 2004/04/12 22:55:59
|
Line 36
|
Line 36
|
# The C source of the Code may not be distributed by the Licensee |
# The C source of the Code may not be distributed by the Licensee |
# to any other parties under any circumstances. |
# to any other parties under any circumstances. |
# |
# |
# last modified 06/26/00 by Alexander Sakharuk |
|
# 11/6 Gerd Kortemeyer |
|
# 6/1/1 Gerd Kortemeyer |
|
# 2/21,3/13 Guy |
|
# 3/29,5/4 Gerd Kortemeyer |
|
# 5/26 Gerd Kortemeyer |
|
# 5/27 H. K. Ng |
|
# 6/2,6/3,6/8,6/9 Gerd Kortemeyer |
|
# 6/12,6/13 H. K. Ng |
|
# 6/16 Gerd Kortemeyer |
|
# 7/27 H. K. Ng |
|
# 8/7,8/9,8/10,8/11,8/15,8/16,8/17,8/18,8/20,8/23,8/24 Gerd Kortemeyer |
|
# Guy Albertelli |
|
# 9/26 Gerd Kortemeyer |
|
# Dec Guy Albertelli |
|
# YEAR=2002 |
|
# 1/1 Gerd Kortemeyer |
|
# 1/2 Matthew Hall |
|
# 1/3 Gerd Kortemeyer |
|
# |
|
|
|
package Apache::lonxml; |
package Apache::lonxml; |
use vars |
use vars |
Line 864 sub get_all_text_unbalanced {
|
Line 845 sub get_all_text_unbalanced {
|
} elsif ($token->[0] eq 'E') { |
} elsif ($token->[0] eq 'E') { |
$result.=$token->[2]; |
$result.=$token->[2]; |
} |
} |
if ($result =~ /(.*)\Q$tag\E(.*)/s) { |
if ($result =~ /(.*)\Q$tag\E(.*)/is) { |
&Apache::lonxml::debug('Got a winner with leftovers ::'.$2); |
&Apache::lonxml::debug('Got a winner with leftovers ::'.$2); |
&Apache::lonxml::debug('Result is :'.$1); |
&Apache::lonxml::debug('Result is :'.$1); |
$result=$1; |
$result=$1; |
Line 926 sub get_all_text {
|
Line 907 sub get_all_text {
|
} elsif ($token->[0] eq 'PI') { |
} elsif ($token->[0] eq 'PI') { |
$result.=$token->[2]; |
$result.=$token->[2]; |
} elsif ($token->[0] eq 'S') { |
} elsif ($token->[0] eq 'S') { |
if ($token->[1] =~ /^$tag$/i) { $depth++; } |
if ($token->[1] =~ /^\Q$tag\E$/i) { $depth++; } |
if ($token->[1] =~ /^LONCAPA_INTERNAL_TURN_STYLE_ON$/i) { $Apache::lonxml::usestyle=1; } |
if ($token->[1] =~ /^LONCAPA_INTERNAL_TURN_STYLE_ON$/) { $Apache::lonxml::usestyle=1; } |
if ($token->[1] =~ /^LONCAPA_INTERNAL_TURN_STYLE_OFF$/i) { $Apache::lonxml::usestyle=0; } |
if ($token->[1] =~ /^LONCAPA_INTERNAL_TURN_STYLE_OFF$/) { $Apache::lonxml::usestyle=0; } |
$result.=$token->[4]; |
$result.=$token->[4]; |
} elsif ($token->[0] eq 'E') { |
} elsif ($token->[0] eq 'E') { |
if ( $token->[1] =~ /^$tag$/i) { $depth--; } |
if ( $token->[1] =~ /^\Q$tag\E$/i) { $depth--; } |
#skip sending back the last end tag |
#skip sending back the last end tag |
if ($depth == 0 && exists($$style{'/'.$token->[1]}) && $Apache::lonxml::usestyle) { |
if ($depth == 0 && exists($$style{'/'.$token->[1]}) && $Apache::lonxml::usestyle) { |
my $string= |
my $string= |
Line 978 sub get_all_text {
|
Line 959 sub get_all_text {
|
} elsif ($token->[0] eq 'PI') { |
} elsif ($token->[0] eq 'PI') { |
$result.=$token->[2]; |
$result.=$token->[2]; |
} elsif ($token->[0] eq 'S') { |
} elsif ($token->[0] eq 'S') { |
if ( $token->[1] =~ /^$tag$/i) { |
if ( $token->[1] =~ /^\Q$tag\E$/i) { |
$$pars[-1]->unget_token($token); last; |
$$pars[-1]->unget_token($token); last; |
} else { |
} else { |
$result.=$token->[4]; |
$result.=$token->[4]; |
} |
} |
if ($token->[1] =~ /^LONCAPA_INTERNAL_TURN_STYLE_ON$/i) { $Apache::lonxml::usestyle=1; } |
if ($token->[1] =~ /^LONCAPA_INTERNAL_TURN_STYLE_ON$/) { $Apache::lonxml::usestyle=1; } |
if ($token->[1] =~ /^LONCAPA_INTERNAL_TURN_STYLE_OFF$/i) { $Apache::lonxml::usestyle=0; } |
if ($token->[1] =~ /^LONCAPA_INTERNAL_TURN_STYLE_OFF$/) { $Apache::lonxml::usestyle=0; } |
} elsif ($token->[0] eq 'E') { |
} elsif ($token->[0] eq 'E') { |
$result.=$token->[2]; |
$result.=$token->[2]; |
} |
} |