From: jj v. a. <we...@ma...> - 2005-06-15 22:02:50
|
Log Message: ----------- Changed whitespace removal of TeX strings to safer version. Modified Files: -------------- pg/lib/WeBWorK: EquationCache.pm Revision Data ------------- Index: EquationCache.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/WeBWorK/EquationCache.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -Llib/WeBWorK/EquationCache.pm -Llib/WeBWorK/EquationCache.pm -u -r1.2 -r1.3 --- lib/WeBWorK/EquationCache.pm +++ lib/WeBWorK/EquationCache.pm @@ -75,7 +75,17 @@ sub lookup { my ($self, $tex) = @_; - $tex =~ s/\s+//g; + # There are several ways to normalize TeX strings. Use only + # one of them. + + # Option 1 (default): remove leading and trailing whitespace, and + # compress all other whitespace to single spaces. + $tex =~ s/^\s+//g; + $tex =~ s/\s+$//g; + $tex =~ s/\s+/ /g; + # Option 2 (the old default): remove all whitespace + # $tex =~ s/\s+//g; + my $md5 = md5_hex($tex); my $db = $self->{cacheDB}; |