mhonarc-commits
[Top] [All Lists]

CVS: mhonarc/MHonArc/lib/MHonArc CharEnt.pm,1.13,1.14 CharMaps.pm,1.1,1.2 U...

2003-03-05 15:17:21
Update of /cvsroot/mhonarc/mhonarc/MHonArc/lib/MHonArc
In directory subversions:/tmp/cvs-serv20374

Modified Files:
	CharEnt.pm CharMaps.pm UTF8.pm 
Log Message:
* Removed escaping of '@' for similiar reasons as was done in ewhutil.pl.
  Should eventually consolidate HTMLSpecials so they are not defined
  in two different places.
* Defined $HTMLSpecials scalar for use in regexes.  Makes it easier
  to update specials without having to change source in multiple files.


Index: CharEnt.pm
===================================================================
RCS file: /cvsroot/mhonarc/mhonarc/MHonArc/lib/MHonArc/CharEnt.pm,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -r1.13 -r1.14
*** CharEnt.pm	26 Dec 2002 21:57:04 -0000	1.13
--- CharEnt.pm	5 Mar 2003 22:17:15 -0000	1.14
***************
*** 120,124 ****
      # If us-ascii, use simple s/// operation.
      if ($charset eq 'us-ascii') {
! 	$$data_r =~ s/([\x22\x26\x3C\x3E\x40\xA0])/$HTMLSpecials{$1}/g;
  	return $$data_r;
      }
--- 120,124 ----
      # If us-ascii, use simple s/// operation.
      if ($charset eq 'us-ascii') {
! 	$$data_r =~ s/([$HTMLSpecials])/$HTMLSpecials{$1}/go;
  	return $$data_r;
      }

Index: CharMaps.pm
===================================================================
RCS file: /cvsroot/mhonarc/mhonarc/MHonArc/lib/MHonArc/CharMaps.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** CharMaps.pm	18 Dec 2002 05:38:43 -0000	1.1
--- CharMaps.pm	5 Mar 2003 22:17:15 -0000	1.2
***************
*** 28,38 ****
  
  use strict;
! use vars qw( @ISA @EXPORT %HTMLSpecials );
  
  use Carp;
  use Exporter ();
  @ISA = qw( Exporter );
! @EXPORT = qw( %HTMLSpecials );
  
  %HTMLSpecials = (
      "\x22" =>	'"',   	# ISOnum : Quotation mark
--- 28,41 ----
  
  use strict;
! use vars qw( @ISA @EXPORT %HTMLSpecials $HTMLSpecials );
  
  use Carp;
  use Exporter ();
  @ISA = qw( Exporter );
! @EXPORT = qw( $HTMLSpecials %HTMLSpecials );
  
+ # The following two variables need to be in sync.  The hash version should
+ # have contain mappings for each character in the scalar version.
+ $HTMLSpecials = "\x22\x26\x3C\x3E";
  %HTMLSpecials = (
      "\x22" =>	'"',   	# ISOnum : Quotation mark
***************
*** 40,44 ****
      "\x3C" =>	'<',   	# ISOnum : Less-than sign
      "\x3E" =>	'>',   	# ISOnum : Greater-than sign
-     "\x40" =>	'@',   	#        : At sign (useful for mail addresses)
  );
  
--- 43,46 ----

Index: UTF8.pm
===================================================================
RCS file: /cvsroot/mhonarc/mhonarc/MHonArc/lib/MHonArc/UTF8.pm,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** UTF8.pm	20 Dec 2002 08:01:11 -0000	1.5
--- UTF8.pm	5 Mar 2003 22:17:15 -0000	1.6
***************
*** 66,70 ****
      my $text	= shift;
      my $text_r  = ref($text) ? $text : \$text;
!     $$text_r =~ s/([\x22\x26\x3C\x3E\x40])/$HTMLSpecials{$1}/g;
      $$text_r;
  }
--- 66,70 ----
      my $text	= shift;
      my $text_r  = ref($text) ? $text : \$text;
!     $$text_r =~ s/([$HTMLSpecials])/$HTMLSpecials{$1}/go;
      $$text_r;
  }

---------------------------------------------------------------------
To sign-off this list, send email to majordomo(_at_)mhonarc(_dot_)org with the
message text UNSUBSCRIBE MHONARC-DEV