[LON-CAPA-cvs] cvs: loncom /xml londefdef.pm

droeschl droeschl at source.lon-capa.org
Thu Mar 1 16:13:36 EST 2012


droeschl		Thu Mar  1 21:13:36 2012 EDT

  Modified files:              
    /loncom/xml	londefdef.pm 
  Log:
  Bug 6563. Printing: Stylesheets in PDF
  This attempts to fix the issue by extending the parser to handle <style> tags. 
  The new behaviour will not output anything within those tags if the target
  is set to tex. Other targets are left unchanged. 
  
  
Index: loncom/xml/londefdef.pm
diff -u loncom/xml/londefdef.pm:1.437 loncom/xml/londefdef.pm:1.438
--- loncom/xml/londefdef.pm:1.437	Sun Feb  5 22:53:42 2012
+++ loncom/xml/londefdef.pm	Thu Mar  1 21:13:36 2012
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Tags Default Definition Module 
 #
-# $Id: londefdef.pm,v 1.437 2012/02/05 22:53:42 raeburn Exp $
+# $Id: londefdef.pm,v 1.438 2012/03/01 21:13:36 droeschl Exp $
 # 
 #
 # Copyright Michigan State University Board of Trustees
@@ -55,7 +55,7 @@
 
 BEGIN {
 
-    &Apache::lonxml::register('Apache::londefdef',('a','abbr','acronym','accessrule','address','allow','applet','area','b','base','basefont','bgo','bgsound','big','blink','blockquote','blankspace','body','br','button','caption','center','cite','code','col','colgroup','dd','del','dfn','dir','div','dl','dt','em','embed','externallink','fieldset','font','form','frame','frameset','h1','h2','h3','h4','h5','h6','head','hr','html','i','iframe','img','input','ins','insert','isindex','kbd','keygen','label','layer','legend','li','link','m','map','marquee','menu','meta','multicol','nobr','noembed','noframes','nolayer','noscript','object','ol','optgroup','option','output','p','param','pre','q','s','samp','select','server','small','spacer','span','strike','strong','sub','sup','table','tbody','td','textarea','tfoot','th','thead','title','tr','tt','tthoption','u','ul','var','wbr','hideweboutput'));
+    &Apache::lonxml::register('Apache::londefdef',('a','abbr','acronym','accessrule','address','allow','applet','area','b','base','basefont','bgo','bgsound','big','blink','blockquote','blankspace','body','br','button','caption','center','cite','code','col','colgroup','dd','del','dfn','dir','div','dl','dt','em','embed','externallink','fieldset','font','form','frame','frameset','h1','h2','h3','h4','h5','h6','head','hr','html','i','iframe','img','input','ins','insert','isindex','kbd','keygen','label','layer','legend','li','link','m','map','marquee','menu','meta','multicol','nobr','noembed','noframes','nolayer','noscript','object','ol','optgroup','option','output','p','param','pre','q','s','samp','select','server','small','spacer','span','strike','strong','style','sub','sup','table','tbody','td','textarea','tfoot','th','thead','title','tr','tt','tthoption','u','ul','var','wbr','hideweboutput'));
 
 }
 
@@ -458,6 +458,32 @@
     <meta />';
 }
 
+#-- <start> tag
+sub start_style {
+	my ($target, $token, $tagstack, $parstack, $parser, $safeeval, $style) = @_;
+	my $currentstring = '';
+
+	if ($target eq 'tex') {
+		Apache::lonxml::startredirection();
+	} else {
+		$currentstring = $token->[4];
+	}
+	
+	return $currentstring;
+}
+
+sub end_style {
+	my ($target, $token, $tagstack, $parstack, $parser, $safeeval) = @_;
+	my $currentstring = '';
+
+	if ($target eq 'tex') {
+		Apache::lonxml::endredirection();
+	} else {
+		$currentstring = $token->[2];
+	}
+	return $currentstring;
+}
+
 # accessrule
 sub start_accessrule {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style) = @_;




More information about the LON-CAPA-cvs mailing list