Diff for /loncom/xml/lontexconvert.pm between versions 1.110 and 1.112.2.3

version 1.110, 2012/02/28 10:38:14 version 1.112.2.3, 2013/09/22 02:04:31
Line 56  use IO::Socket::INET; Line 56  use IO::Socket::INET;
 #  #
 my %unicode_translations = (  my %unicode_translations = (
     '\rightleftharpoons'  => 0x21cc,      '\rightleftharpoons'  => 0x21cc,
     ''             => 0x23a1,  
     ''             => 0x23a2,  # Brackets - unicode is commented out with pure 8-bit ascii ugliness while we need it.
     ''             => 0x23a3,  
     ''             => 0x23a4,  #    ''             => 0x23a1,
     ''             => 0x23a5,  #    ''             => 0x23a2,
     ''             => 0x23a6     #    ''             => 0x23a3,   # when unicode catches up with browsers
   #    ''             => 0x23a4,   # use these instead of the cheesey brackets below
   #    ''             => 0x23a5,
   #    ''             => 0x23a6   
       ''              => 0x5b,
       ''              => 0x5b,    # '['
       ''              => 0x5b,
       ''              => 0x5d,    # ']'
       ''              => 0x5d,
       ''              => 0x5d,
   
   #  Parens..again the unicode is commented out with the 8-bit ascii ugliness
   #  turned on until browsers catch up with the unicode world.
   
   #    ''              => 0x239b,
   #    ''              => 0x239c,
   #    ''              => 0x239d,
   #    ''              => 0x239e,
   #    ''              => 0x239f,
   #    ''              => 0x23a0
   
       ''              => 0x28,
       ''              => 0x28,      # '('
       ''              => 0x28,
   
       ''              => 0x29,
       ''              => 0x29,      # '('
       ''              => 0x29
   
   
 );  );
   
 ##  ##
Line 126  sub convert_real { Line 155  sub convert_real {
     };      };
     &Apache::lonxml::start_alarm();      &Apache::lonxml::start_alarm();
     if ($env{'browser.mathml'}) {      if ($env{'browser.mathml'}) {
  &Apache::lonnet::logthis("mathml");  
  $xmlstring=&tth::ttm($$texstring);   $xmlstring=&tth::ttm($$texstring);
  $xmlstring=~s/\<math\>/\<math xmlns=\"\&mathns\;\"\>/g;   $xmlstring=~s/\<math\>/\<math xmlns=\"\&mathns\;\"\>/g;
  $xmlstring=~s/\<br\>/\<br\/\>/g;   $xmlstring=~s/\<br\>/\<br\/\>/g;
  $xmlstring=~s/\<p\>/\<p\>\<\/p\>/g;   $xmlstring=~s/\<p\>/\<p\>\<\/p\>/g;
  $errorstring.=&tth::ttmerror();   $errorstring.=&tth::ttmerror();
     } else {      } else {
  &Apache::lonnet::logthis("tth");  
  $xmlstring=&tth::tth($$texstring);   $xmlstring=&tth::tth($$texstring);
  $errorstring.=&tth::ttherror();   $errorstring.=&tth::ttherror();
  $xmlstring=~s-</font(\s*)>-</font>-g;   $xmlstring=~s-</font(\s*)>-</font>-g;
Line 242  sub MathJax_converted { Line 269  sub MathJax_converted {
         return          return
           '<script type="text/javascript" src="/adm/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>'."\n";            '<script type="text/javascript" src="/adm/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>'."\n";
     }      }
     #sub MathJax_process {  
     #    my $state = pop(@MathJax_sent_header);  
     #    return '' if !$state;  
     #    return "\n".  
     #        '<script type="text/javascript">MathJax.Process()</script>'."\n";  
     #}  
     #sub MathJax_state {  
     #    my ($level) = @_;  
     #    return $MathJax_sent_header[$level];  
     #}  
 }  }
   
   
 sub jsMath_converted {  sub jsMath_converted {
     my $texstring=shift;      my $texstring=shift;
     my $tag='span';      my $tag='span';
Line 388  sub converted { Line 404  sub converted {
     } elsif ($mode =~ /jsmath/i) {      } elsif ($mode =~ /jsmath/i) {
  return &jsMath_converted($string);   return &jsMath_converted($string);
     } elsif ($mode =~ /mathjax/i) {      } elsif ($mode =~ /mathjax/i) {
  return &MathJax_converted($string);          return &MathJax_converted($string);
     } elsif ($mode =~ /mimetex/i) {      } elsif ($mode =~ /mimetex/i) {
  return &mimetex_converted($string);   return &mimetex_converted($string);
     } elsif ($mode =~ /raw/i) {      } elsif ($mode =~ /raw/i) {
Line 468  sub msgtexconverted { Line 484  sub msgtexconverted {
     foreach my $fragment (split(/(?:\&lt\;|\<)\/*algebra\s*(?:\&gt\;|\>)/i,      foreach my $fragment (split(/(?:\&lt\;|\<)\/*algebra\s*(?:\&gt\;|\>)/i,
  $message)) {   $message)) {
  if ($tex) {   if ($tex) {
         my $algebra = &algebra($fragment, 'web', undef, undef, undef, undef, 'tth');          my $algebra = &algebra($fragment, 'web', undef, undef, undef, 'tth');
     if ($email) {      if ($email) {
  $outmessage.='</pre><tt>'.$algebra.'</tt><pre>';   $outmessage.='</pre><tt>'.$algebra.'</tt><pre>';
  $tex=0;   $tex=0;
Line 598  Header Line 614  Header
 =item jsMath_converted()  =item jsMath_converted()
   
 =item MathJax_converted()  =item MathJax_converted()
  - Mimics the jsMath functionality          - Mimics the jsMath functionality
   
 =item tex_engine()  =item tex_engine()
   

Removed from v.1.110  
changed lines
  Added in v.1.112.2.3


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>