[prev in list] [next in list] [prev in thread] [next in thread]
List: lon-capa-cvs
Subject: [LON-CAPA-cvs] cvs: loncom /xml londefdef.pm
From: damieng <damieng () source ! lon-capa ! org>
Date: 2016-01-14 19:40:26
Message-ID: cvsdamieng1452800426 () cvsserver
[Download RAW message or body]
damieng Thu Jan 14 19:40:26 2016 EDT
Modified files:
/loncom/xml londefdef.pm
Log:
added a warning for the use of <m> without math delimiters
Index: loncom/xml/londefdef.pm
diff -u loncom/xml/londefdef.pm:1.457 loncom/xml/londefdef.pm:1.458
--- loncom/xml/londefdef.pm:1.457 Wed Jan 6 16:44:37 2016
+++ loncom/xml/londefdef.pm Thu Jan 14 19:40:26 2016
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Tags Default Definition Module
#
-# $Id: londefdef.pm,v 1.457 2016/01/06 16:44:37 damieng Exp $
+# $Id: londefdef.pm,v 1.458 2016/01/14 19:40:26 damieng Exp $
#
#
# Copyright Michigan State University Board of Trustees
@@ -92,6 +92,14 @@
my $inside = &Apache::lonxml::get_all_text_unbalanced("/m",$parser);
if ($target eq 'web' || $target eq 'analyze') {
&Apache::lonxml::debug("M is starting with:$inside:");
+ if (!($inside =~ /^\s*\$.*\$\s*$/ || $inside =~ /^\s*\\[([].*\\[)\]]\s*$/)) {
+ # Non-math LaTeX will not be rendered correctly with MathJax
+ # and it should be avoided anyway.
+ # On top of that, MathJax will render math without $, but
+ # it will fail with tth. This is worth a warning.
+ # (even though some people might just use latex for printing)
+ &Apache::lonxml::warning(&mt("Missing \$ in <m>."));
+ }
my $eval=&Apache::lonxml::get_param('eval',$parstack,$safeeval);
if ($eval eq 'on') {
$inside=&Apache::run::evaluate($inside,$safeeval,$$parstack[-1]);
_______________________________________________
LON-CAPA-cvs mailing list
LON-CAPA-cvs@mail.lon-capa.org
http://mail.lon-capa.org/mailman/listinfo/lon-capa-cvs
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic