[LON-CAPA-cvs] cvs: loncom /interface lonhtmlgateway.pm

faziophi faziophi@source.lon-capa.org
Tue, 27 Apr 2010 17:07:35 -0000


faziophi		Tue Apr 27 17:07:35 2010 EDT

  Modified files:              
    /loncom/interface	lonhtmlgateway.pm 
  Log:
  Fixes <algebra> tag not printing properly on templated pages.
  
  
  
Index: loncom/interface/lonhtmlgateway.pm
diff -u loncom/interface/lonhtmlgateway.pm:1.1 loncom/interface/lonhtmlgateway.pm:1.2
--- loncom/interface/lonhtmlgateway.pm:1.1	Mon Apr 26 20:45:28 2010
+++ loncom/interface/lonhtmlgateway.pm	Tue Apr 27 17:07:35 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # gateway for html input/output to be properly parsed and handled
 #
-# $Id: lonhtmlgateway.pm,v 1.1 2010/04/26 20:45:28 faziophi Exp $
+# $Id: lonhtmlgateway.pm,v 1.2 2010/04/27 17:07:35 faziophi Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -709,15 +709,17 @@
     # the <algebra> parser does NOT handle entities,
     # unlike the general <m> parser; thus we run
     # the content of this tag through HTML::Entities,
-    # decoding it first
+    # decoding it first. we also just get the tex, and
+    # feed it through as if it were an <mi> tag.
     $input = &HTML::Entities::decode($input);
-    return &Apache::lontexconvert::algebra($input,$self->{target});
+    my $algebra = &Apache::lontexconvert::algebra($input, 'tex');
+    return &parse_m_tag($self, $algebra);
 }
 
 sub parse_mi_tag {
     my $self = shift;
     my $input = shift;
-    return &parse_m_tag($self, '$'.$input.'$');
+    return &parse_m_tag($self, '\ensuremath{'.$input.'}');
 }
 
 sub parse_md_tag {
@@ -800,7 +802,7 @@
 
 =head1 VERSION
 
-$Id: lonhtmlgateway.pm,v 1.1 2010/04/26 20:45:28 faziophi Exp $
+$Id: lonhtmlgateway.pm,v 1.2 2010/04/27 17:07:35 faziophi Exp $
 
 =cut