version 1.311, 2004/03/19 22:01:13
|
version 1.314, 2004/03/30 07:16:24
|
Line 408 sub latex_special_symbols {
|
Line 408 sub latex_special_symbols {
|
$string=~s/([^\\])\&/$1\\\&/g; |
$string=~s/([^\\])\&/$1\\\&/g; |
$string=~s/([^\\])\#/$1\\\#/g; |
$string=~s/([^\\])\#/$1\\\#/g; |
} else { |
} else { |
$string=~s/([^\\])\%/$1\\\%/g; |
$string=~s/\\/\\ensuremath{\\backslash}/g; |
$string=~s/([^\\])(\$|_)/$1\\$2/g; |
$string=~s/([^\\]|^)\%/$1\\\%/g; |
|
$string=~s/([^\\]|^)(\$|_)/$1\\$2/g; |
$string=~s/\$\$/\$\\\$/g; |
$string=~s/\$\$/\$\\\$/g; |
$string=~s/\#\#/\#\\\#/g; |
$string=~s/\#\#/\#\\\#/g; |
$string=~s/([^\\])(\~|\^)/$1\\$2\\strut /g; |
$string=~s/([^\\]|^)(\~|\^)/$1\\$2\\strut /g; |
$string=~s/(>|<)/\\ensuremath\{$1\}/g; #more or less |
$string=~s/(>|<)/\\ensuremath\{$1\}/g; #more or less |
$string=&Apache::lonprintout::character_chart($string); |
$string=&Apache::lonprintout::character_chart($string); |
# any & or # leftover should be safe to just escape |
# any & or # leftover should be safe to just escape |
$string=~s/([^\\])\&/$1\\\&/g; |
$string=~s/([^\\]|^)\&/$1\\\&/g; |
$string=~s/([^\\])\#/$1\\\#/g; |
$string=~s/([^\\]|^)\#/$1\\\#/g; |
#single { or } How to escape? |
#single { or } How to escape? |
} |
} |
return $string; |
return $string; |
Line 966 sub get_all_text {
|
Line 967 sub get_all_text {
|
#never found the end tag ran out of text, throw error send back blank |
#never found the end tag ran out of text, throw error send back blank |
&error('Never found end tag for <'.$tag. |
&error('Never found end tag for <'.$tag. |
'> current string <pre>'. |
'> current string <pre>'. |
&HTML::Entities::encode($result). |
&HTML::Entities::encode($result,'<>&"'). |
'</pre>'); |
'</pre>'); |
if ($gotfullstack) { |
if ($gotfullstack) { |
my $newstring='</'.$tag.'>'.$result; |
my $newstring='</'.$tag.'>'.$result; |
Line 1143 SIMPLECONTENT
|
Line 1144 SIMPLECONTENT
|
|
|
sub inserteditinfo { |
sub inserteditinfo { |
my ($result,$filecontents,$filetype)=@_; |
my ($result,$filecontents,$filetype)=@_; |
$filecontents = &HTML::Entities::encode($filecontents); |
$filecontents = &HTML::Entities::encode($filecontents,'<>&"'); |
# my $editheader='<a href="#editsection">Edit below</a><hr />'; |
# my $editheader='<a href="#editsection">Edit below</a><hr />'; |
my $xml_help = ''; |
my $xml_help = ''; |
if ($filetype eq 'html') { |
if ($filetype eq 'html') { |
Line 1328 sub debug {
|
Line 1329 sub debug {
|
$|=1; |
$|=1; |
my $request=$Apache::lonxml::request; |
my $request=$Apache::lonxml::request; |
if (!$request) { $request=Apache->request; } |
if (!$request) { $request=Apache->request; } |
$request->print('<font size="-2"><pre>DEBUG:'.&HTML::Entities::encode($_[0])."</pre></font>\n"); |
$request->print('<font size="-2"><pre>DEBUG:'.&HTML::Entities::encode($_[0],'<>&"')."</pre></font>\n"); |
} |
} |
} |
} |
|
|