[libhtml-entities-numbered-perl] 01/03: [svn-inject] Installing original source of libhtml-entities-numbered-perl

dom at earth.li dom at earth.li
Sun May 8 22:10:18 UTC 2016


This is an automated email from the git hooks/post-receive script.

dom pushed a commit to branch master
in repository libhtml-entities-numbered-perl.

commit c817e81c063dc682fa6c6c26b25c9be9d571e23c
Author: Dominic Hargreaves <dom at earth.li>
Date:   Thu Mar 6 20:54:03 2008 +0000

    [svn-inject] Installing original source of libhtml-entities-numbered-perl
---
 Changes                             |  12 ++
 MANIFEST                            |  18 +++
 META.yml                            |  11 ++
 Makefile.PL                         |   8 +
 README                              | 123 ++++++++++++++++
 lib/HTML/Entities/Numbered.pm       | 212 ++++++++++++++++++++++++++
 lib/HTML/Entities/Numbered/Table.pm | 286 ++++++++++++++++++++++++++++++++++++
 t/00_compile.t                      |   4 +
 t/01_name2decimal.t                 |  11 ++
 t/02_name2hex.t                     |  11 ++
 t/03_decimal2name.t                 |  11 ++
 t/04_hex2name.t                     |  11 ++
 t/05_hex2name_lc.t                  |  11 ++
 t/06_invalid.t                      |  19 +++
 t/07_cross.t                        |  14 ++
 t/08_name2decimal_xml.t             |  16 ++
 t/09_name2hex_xml.t                 |  16 ++
 t/entities.txt                      | 252 +++++++++++++++++++++++++++++++
 18 files changed, 1046 insertions(+)

diff --git a/Changes b/Changes
new file mode 100644
index 0000000..127c805
--- /dev/null
+++ b/Changes
@@ -0,0 +1,12 @@
+Revision history for Perl extension HTML::Entities::Numbered
+
+0.04  Thu Sep  2 23:38:13 2004
+	- The following are suggested by Tatsuhiko Miyagawa.
+	o create HTML entities table in it's way.
+	o removed HTML::Entities from prerequisite pm to build this
+	  distribution.
+	o added "_xml" suffixed two functions (name2decimal_xml() and
+	  name2hex_xml()) for addapted to create valid XML.
+
+0.03  Tue Aug 11 22:00:26 2004
+	- original version
diff --git a/MANIFEST b/MANIFEST
new file mode 100644
index 0000000..483516c
--- /dev/null
+++ b/MANIFEST
@@ -0,0 +1,18 @@
+Changes
+lib/HTML/Entities/Numbered.pm
+lib/HTML/Entities/Numbered/Table.pm
+Makefile.PL
+MANIFEST			This list of files
+README
+t/00_compile.t
+t/01_name2decimal.t
+t/02_name2hex.t
+t/03_decimal2name.t
+t/04_hex2name.t
+t/05_hex2name_lc.t
+t/06_invalid.t
+t/07_cross.t
+t/08_name2decimal_xml.t
+t/09_name2hex_xml.t
+t/entities.txt
+META.yml                                 Module meta-data (added by MakeMaker)
diff --git a/META.yml b/META.yml
new file mode 100644
index 0000000..66f9280
--- /dev/null
+++ b/META.yml
@@ -0,0 +1,11 @@
+# http://module-build.sourceforge.net/META-spec.html
+#XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
+name:         HTML-Entities-Numbered
+version:      0.04
+version_from: lib/HTML/Entities/Numbered.pm
+installdirs:  site
+requires:
+    Test::More:                    0.32
+
+distribution_type: module
+generated_by: ExtUtils::MakeMaker version 6.21
diff --git a/Makefile.PL b/Makefile.PL
new file mode 100644
index 0000000..257fd8e
--- /dev/null
+++ b/Makefile.PL
@@ -0,0 +1,8 @@
+use ExtUtils::MakeMaker;
+WriteMakefile(
+    NAME         => 'HTML::Entities::Numbered',
+    VERSION_FROM => 'lib/HTML/Entities/Numbered.pm', # finds $VERSION
+    PREREQ_PM    => {
+	'Test::More'     => 0.32,
+    },
+);
diff --git a/README b/README
new file mode 100644
index 0000000..b464e7d
--- /dev/null
+++ b/README
@@ -0,0 +1,123 @@
+HTML::Entities::Numbered version 0.04
+=====================================
+
+NAME
+    HTML::Entities::Numbered - Conversion of numbered HTML entities
+
+SYNOPSIS
+     use HTML::Entities::Numbered;
+ 
+     $html    = 'Hi Honey<b>♥</b>';
+ 
+     # convert named HTML entities to numbered (decimal)
+     $decimal = name2decimal($html);    # Hi Honey<b>♥</b>
+ 
+     # to numbered (hexadecimal)
+     $hex     = name2hex($html);        # Hi Honey<b>&#x2665;</b>
+ 
+     $content = 'Copyright © Larry Wall';
+ 
+     # convert numbered HTML entities (decimal) to named
+     $name1   = decimal2name($content); # Copyright © Larry Wall
+ 
+     $content = 'Copyright &#xA9; Larry Wall';
+     # convert numbered HTML entitites (hexadecimal) to named
+     $name2   = hex2name($content);     # Copyright © Larry Wall
+ 
+     $xml     = '"Give me ¥10,000" > cherie♠';
+ 
+     # convert named HTML entities to numbered
+     # except valid XML entities (decimal)
+     $decimal = name2decimal_xml($xml); # "Give me ¥10,000"
+                                        # > cherie♠
+ 
+     # to numbered except valid XML entities (hexdecimal)
+     $hex     = name2hex_xml($xml);     # "Give me &#xA5;10,000"
+                                        # > cherie&#x2660;
+
+DESCRIPTION
+    HTML::Entities::Numbered is a content conversion filter for named HTML
+    entities (symbols, mathmetical symbols, Greek letters, Latin letters,
+    etc.). When an argument of "name2decimal()" or "name2hex()" contains
+    some nameable HTML entities, they will be replaced to numbered HTML
+    entities. And when an argument of "name2decimal_xml()" or
+    "name2hex_xml()" contains some nameable numbered HTML entities, they
+    will be replaced to numbered HTML entities except valid XML entities
+    (the excepted "valid XML entities" are the following five entities:
+    "<", ">", "&", """, "'"). By the same token, when an
+    argument of "decimal2name()" or "hex2name()" contains some nameable
+    numbered HTML entities, they will be replaced to named HTML entities.
+
+    (the exception "valid XML entities" means the following five entities:
+    "<", ">", "&", """, "'")
+
+    On version 0.03, the entities hash table is imported from HTML::Entities
+    (with obsolete class "HTML::Entities::Numbered::Extra" for older
+    releases of Perl). At the moment, 0.04 (or later) is included
+    HTML::Entities::Numbered::Table to import HTML entities table, and
+    thereby we do not need to have HTML::Entities (included in HTML::Parser
+    distribution).
+
+    This may be also useful for making valid XML (corrects the undefined
+    entity references, and enhanced by addition of functions conform to the
+    XML).
+
+FUNCTIONS
+    Following all functions are exported by default.
+
+    * name2decimal
+        Some included named HTML entities in argument of "name2decimal()"
+        will be replaced to decimal numbered HTML entities.
+
+    * name2hex
+        Some included named HTML entities in argument of "name2hex()" will
+        be replaced to hexadecimal numbered HTML entities.
+
+    * decimal2name
+        Some include decimal numbered HTML entities in argument of
+        "decimal2name()" will be replaced to named HTML entities (If they're
+        nameable).
+
+    * hex2name
+        Some include hexadecimal numbered HTML entities in argument of
+        "hex2name()" will be replaced to named HTML entities (If they're
+        nameable).
+
+    * name2decimal_xml
+        Some included named HTML entities in argument of
+        "name2decimal_xml()" will be replaced to decimal numbered HTML
+        entities except valid XML entities.
+
+    * name2hex_xml
+        Some included named HTML entities in argument of "name2hex_xml()"
+        will be replaced to hexadecimal numbered HTML entities except valid
+        XML entities.
+
+    If you'd prefer not to import them functions into the caller's
+    namespace, you can call them as below:
+
+     use HTML::Entities::Numbered ();
+ 
+     $decimal = HTML::Entities::Numbered::name2decimal($str);
+     $hex     = HTML::Entities::Numbered::name2hex($str);
+     $named1  = HTML::Entities::Numbered::decimal2name($str);
+     $named2  = HTML::Entities::Numbered::hex2name($str);
+     $decimal = HTML::Entities::Numbered::name2decimal_xml($str);
+     $hex     = HTML::Entities::Numbered::name2hex_xml($str);
+
+AUTHOR
+    Koichi Taniguchi <taniguchi at livedoor.jp>
+
+    Develop triggered by IKEBE Tomohiro <ikebe at cpan.org>
+
+    Many thanks to Tatsuhiko Miyagawa <miyagawa at cpan.org>
+
+COPYRIGHT
+    Copyright (c) 2004 Koichi Taniguchi. Japan. All rights reserved.
+
+    This library is free software; you can redistribute it and/or modify it
+    under the same terms as Perl itself.
+
+SEE ALSO
+    HTML::Entities, <http://www.w3.org/TR/REC-html40/sgml/entities.html>
+
diff --git a/lib/HTML/Entities/Numbered.pm b/lib/HTML/Entities/Numbered.pm
new file mode 100644
index 0000000..f6df3d7
--- /dev/null
+++ b/lib/HTML/Entities/Numbered.pm
@@ -0,0 +1,212 @@
+package HTML::Entities::Numbered;
+
+use strict;
+use HTML::Entities::Numbered::Table;
+use base qw(Exporter);
+use vars qw($VERSION @EXPORT %DECIMALS %ENTITIES);
+ at EXPORT = qw(
+    name2decimal name2hex name2decimal_xml name2hex_xml decimal2name hex2name
+);
+
+$VERSION = '0.04';
+
+BEGIN { %ENTITIES = reverse %DECIMALS }
+
+sub name2decimal {
+    my $content = shift;
+    $content =~ s/(&[a-z0-9]+;)/_convert2num($1, '&#%d;')/ieg;
+    return $content;
+}
+
+sub name2hex {
+    my $content = shift;
+    $content =~ s/(&[a-z0-9]+;)/_convert2num($1, '&#x%X;')/ieg;
+    return $content;
+}
+
+sub name2decimal_xml {
+    my $content = shift;
+    $content =~ s{(&(?:(lt|gt|amp|quot|apos)|[a-z0-9]+);)}
+	{ $2 ? $1 : _convert2num($1, '&#%d;') }ieg;
+    return $content;
+}
+
+sub name2hex_xml {
+    my $content = shift;
+    $content =~ s{(&(?:(lt|gt|amp|quot|apos)|[a-z0-9]+);)}
+	{ $2 ? $1 : _convert2num($1, '&#x%X;') }ieg;
+    return $content;
+}
+
+sub decimal2name {
+    my $content = shift;
+    $content =~ s/(&#\d+;)/_convert2name($1)/ieg;
+    return $content;
+}
+
+sub hex2name {
+    my $content = shift;
+    $content =~ s/(&#x[a-f0-9]+;)/_convert2name($1)/ieg;
+    return $content;
+}
+
+sub _convert2num {
+    my($reference, $format) = @_;
+    my($name) = $reference =~ /^&([a-z0-9]+);$/i;
+    return exists $DECIMALS{$name} ?
+	sprintf($format, $DECIMALS{$name}) : $reference;
+}
+
+sub _convert2name {
+    my $reference = shift;
+    my($is_hex, $decimal) = $reference =~ /^&#(x?)([a-f0-9]+);$/i;
+    $decimal = sprintf('%d', ($is_hex ? hex($decimal) : $decimal));
+    return exists $ENTITIES{$decimal} ?
+	sprintf('&%s;', $ENTITIES{$decimal}) : $reference;
+}
+
+1;
+__END__
+
+=head1 NAME
+
+HTML::Entities::Numbered - Conversion of numbered HTML entities
+
+=head1 SYNOPSIS
+
+ use HTML::Entities::Numbered;
+ 
+ $html    = 'Hi Honey<b>♥</b>';
+ 
+ # convert named HTML entities to numbered (decimal)
+ $decimal = name2decimal($html);    # Hi Honey<b>♥</b>
+ 
+ # to numbered (hexadecimal)
+ $hex     = name2hex($html);        # Hi Honey<b>&#x2665;</b>
+ 
+ $content = 'Copyright © Larry Wall';
+ 
+ # convert numbered HTML entities (decimal) to named
+ $name1   = decimal2name($content); # Copyright © Larry Wall
+ 
+ $content = 'Copyright &#xA9; Larry Wall';
+ # convert numbered HTML entitites (hexadecimal) to named
+ $name2   = hex2name($content);     # Copyright © Larry Wall
+ 
+ $xml     = '"Give me ¥10,000" > cherie♠';
+ 
+ # convert named HTML entities to numbered
+ # except valid XML entities (decimal)
+ $decimal = name2decimal_xml($xml); # "Give me ¥10,000"
+                                    # > cherie♠
+ 
+ # to numbered except valid XML entities (hexdecimal)
+ $hex     = name2hex_xml($xml);     # "Give me &#xA5;10,000"
+                                    # > cherie&#x2660;
+
+=head1 DESCRIPTION
+
+HTML::Entities::Numbered is a content conversion filter for named HTML
+entities (symbols, mathmetical symbols, Greek letters, Latin letters,
+etc.).
+When an argument of C<name2decimal()> or C<name2hex()> contains some
+B<nameable> HTML entities, they will be replaced to numbered HTML
+entities. And when an argument of C<name2decimal_xml()> or
+C<name2hex_xml()> contains some B<nameable> numbered HTML entities,
+they will be replaced to numbered HTML entities B<except valid XML
+entities> (the excepted "valid XML entities" are the following five
+entities: C<<>, C<>>, C<&>, C<">, C<'>).
+By the same token, when an argument of C<decimal2name()> or
+C<hex2name()> contains some B<nameable> numbered HTML entities, they
+will be replaced to named HTML entities.
+
+(the exception "valid XML entities" means the following five entities:
+C<<>, C<>>, C<&>, C<">, C<'>)
+
+On version 0.03, the entities hash table is imported from
+L<HTML::Entities> (with obsolete class
+C<HTML::Entities::Numbered::Extra> for older releases of Perl).
+At the moment, 0.04 (or later) is included
+L<HTML::Entities::Numbered::Table> to import HTML entities table, and
+thereby we do not need to have L<HTML::Entities> (included in
+L<HTML::Parser> distribution).
+
+This may be also useful for making valid XML (corrects the undefined
+entity references, and enhanced by addition of functions conform to
+the XML).
+
+=head1 FUNCTIONS
+
+Following all functions are exported by default.
+
+=over 4
+
+=item * name2decimal
+
+Some included named HTML entities in argument of C<name2decimal()>
+will be replaced to decimal numbered HTML entities.
+
+=item * name2hex
+
+Some included named HTML entities in argument of C<name2hex()>
+will be replaced to hexadecimal numbered HTML entities.
+
+=item * decimal2name
+
+Some include decimal numbered HTML entities in argument of
+C<decimal2name()> will be replaced to named HTML entities
+(If they're nameable).
+
+=item * hex2name
+
+Some include hexadecimal numbered HTML entities in argument of
+C<hex2name()> will be replaced to named HTML entities
+(If they're nameable).
+
+=item * name2decimal_xml
+
+Some included named HTML entities in argument of C<name2decimal_xml()>
+will be replaced to decimal numbered HTML entities B<except valid XML
+entities>.
+
+=item * name2hex_xml
+
+Some included named HTML entities in argument of C<name2hex_xml()>
+will be replaced to hexadecimal numbered HTML entities B<except valid
+XML entities>.
+
+=back
+
+If you'd prefer not to import them functions into the caller's
+namespace, you can call them as below:
+
+ use HTML::Entities::Numbered ();
+ 
+ $decimal = HTML::Entities::Numbered::name2decimal($str);
+ $hex     = HTML::Entities::Numbered::name2hex($str);
+ $named1  = HTML::Entities::Numbered::decimal2name($str);
+ $named2  = HTML::Entities::Numbered::hex2name($str);
+ $decimal = HTML::Entities::Numbered::name2decimal_xml($str);
+ $hex     = HTML::Entities::Numbered::name2hex_xml($str);
+
+=head1 AUTHOR
+
+Koichi Taniguchi E<lt>taniguchi at livedoor.jpE<gt>
+
+Develop triggered by IKEBE Tomohiro E<lt>ikebe at cpan.orgE<gt>
+
+Many thanks to Tatsuhiko Miyagawa E<lt>miyagawa at cpan.orgE<gt>
+
+=head1 COPYRIGHT
+
+Copyright (c) 2004 Koichi Taniguchi. Japan. All rights reserved.
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=head1 SEE ALSO
+
+L<HTML::Entities>,
+L<http://www.w3.org/TR/REC-html40/sgml/entities.html>
+
+=cut
diff --git a/lib/HTML/Entities/Numbered/Table.pm b/lib/HTML/Entities/Numbered/Table.pm
new file mode 100644
index 0000000..ff775fa
--- /dev/null
+++ b/lib/HTML/Entities/Numbered/Table.pm
@@ -0,0 +1,286 @@
+package HTML::Entities::Numbered::Table;
+
+use strict;
+use vars qw($VERSION %DECIMALS @EXPORT);
+use base qw(Exporter);
+ at EXPORT = qw(%DECIMALS);
+
+$VERSION = '0.01';
+
+%DECIMALS = (
+    quot     =>   34,
+    amp      =>   38,
+    apos     =>   39,
+    lt	     =>   60,
+    gt	     =>   62,
+    nbsp     =>  160,
+    iexcl    =>  161,
+    cent     =>  162,
+    pound    =>  163,
+    curren   =>  164,
+    yen      =>  165,
+    brvbar   =>  166,
+    sect     =>  167,
+    uml      =>  168,
+    copy     =>  169,
+    ordf     =>  170,
+    laquo    =>  171,
+    not      =>  172,
+    shy      =>  173,
+    reg      =>  174,
+    macr     =>  175,
+    deg      =>  176,
+    plusmn   =>  177,
+    sup2     =>  178,
+    sup3     =>  179,
+    acute    =>  180,
+    micro    =>  181,
+    para     =>  182,
+    middot   =>  183,
+    cedil    =>  184,
+    sup1     =>  185,
+    ordm     =>  186,
+    raquo    =>  187,
+    frac14   =>  188,
+    frac12   =>  189,
+    frac34   =>  190,
+    iquest   =>  191,
+    Agrave   =>  192,
+    Aacute   =>  193,
+    Acirc    =>  194,
+    Atilde   =>  195,
+    Auml     =>  196,
+    Aring    =>  197,
+    AElig    =>  198,
+    Ccedil   =>  199,
+    Egrave   =>  200,
+    Eacute   =>  201,
+    Ecirc    =>  202,
+    Euml     =>  203,
+    Igrave   =>  204,
+    Iacute   =>  205,
+    Icirc    =>  206,
+    Iuml     =>  207,
+    ETH      =>  208,
+    Ntilde   =>  209,
+    Ograve   =>  210,
+    Oacute   =>  211,
+    Ocirc    =>  212,
+    Otilde   =>  213,
+    Ouml     =>  214,
+    times    =>  215,
+    Oslash   =>  216,
+    Ugrave   =>  217,
+    Uacute   =>  218,
+    Ucirc    =>  219,
+    Uuml     =>  220,
+    Yacute   =>  221,
+    THORN    =>  222,
+    szlig    =>  223,
+    agrave   =>  224,
+    aacute   =>  225,
+    acirc    =>  226,
+    atilde   =>  227,
+    auml     =>  228,
+    aring    =>  229,
+    aelig    =>  230,
+    ccedil   =>  231,
+    egrave   =>  232,
+    eacute   =>  233,
+    ecirc    =>  234,
+    euml     =>  235,
+    igrave   =>  236,
+    iacute   =>  237,
+    icirc    =>  238,
+    iuml     =>  239,
+    eth      =>  240,
+    ntilde   =>  241,
+    ograve   =>  242,
+    oacute   =>  243,
+    ocirc    =>  244,
+    otilde   =>  245,
+    ouml     =>  246,
+    divide   =>  247,
+    oslash   =>  248,
+    ugrave   =>  249,
+    uacute   =>  250,
+    ucirc    =>  251,
+    uuml     =>  252,
+    yacute   =>  253,
+    thorn    =>  254,
+    yuml     =>  255,
+    OElig    =>  338,
+    oelig    =>  339,
+    Scaron   =>  352,
+    scaron   =>  353,
+    Yuml     =>  376,
+    fnof     =>  402,
+    circ     =>  710,
+    tilde    =>  732,
+    Alpha    =>  913,
+    Beta     =>  914,
+    Gamma    =>  915,
+    Delta    =>  916,
+    Epsilon  =>  917,
+    Zeta     =>  918,
+    Eta      =>  919,
+    Theta    =>  920,
+    Iota     =>  921,
+    Kappa    =>  922,
+    Lambda   =>  923,
+    Mu	     =>  924,
+    Nu	     =>  925,
+    Xi	     =>  926,
+    Omicron  =>  927,
+    Pi	     =>  928,
+    Rho      =>  929,
+    Sigma    =>  931,
+    Tau      =>  932,
+    Upsilon  =>  933,
+    Phi      =>  934,
+    Chi      =>  935,
+    Psi      =>  936,
+    Omega    =>  937,
+    alpha    =>  945,
+    beta     =>  946,
+    gamma    =>  947,
+    delta    =>  948,
+    epsilon  =>  949,
+    zeta     =>  950,
+    eta      =>  951,
+    theta    =>  952,
+    iota     =>  953,
+    kappa    =>  954,
+    lambda   =>  955,
+    mu	     =>  956,
+    nu	     =>  957,
+    xi	     =>  958,
+    omicron  =>  959,
+    pi	     =>  960,
+    rho      =>  961,
+    sigmaf   =>  962,
+    sigma    =>  963,
+    tau      =>  964,
+    upsilon  =>  965,
+    phi      =>  966,
+    chi      =>  967,
+    psi      =>  968,
+    omega    =>  969,
+    thetasym =>  977,
+    upsih    =>  978,
+    piv      =>  982,
+    ensp     => 8194,
+    emsp     => 8195,
+    thinsp   => 8201,
+    zwnj     => 8204,
+    zwj      => 8205,
+    lrm      => 8206,
+    rlm      => 8207,
+    ndash    => 8211,
+    mdash    => 8212,
+    lsquo    => 8216,
+    rsquo    => 8217,
+    sbquo    => 8218,
+    ldquo    => 8220,
+    rdquo    => 8221,
+    bdquo    => 8222,
+    dagger   => 8224,
+    Dagger   => 8225,
+    bull     => 8226,
+    hellip   => 8230,
+    permil   => 8240,
+    prime    => 8242,
+    Prime    => 8243,
+    lsaquo   => 8249,
+    rsaquo   => 8250,
+    oline    => 8254,
+    frasl    => 8260,
+    euro     => 8364,
+    image    => 8465,
+    weierp   => 8472,
+    real     => 8476,
+    trade    => 8482,
+    alefsym  => 8501,
+    larr     => 8592,
+    uarr     => 8593,
+    rarr     => 8594,
+    darr     => 8595,
+    harr     => 8596,
+    crarr    => 8629,
+    lArr     => 8656,
+    uArr     => 8657,
+    rArr     => 8658,
+    dArr     => 8659,
+    hArr     => 8660,
+    forall   => 8704,
+    part     => 8706,
+    exist    => 8707,
+    empty    => 8709,
+    nabla    => 8711,
+    isin     => 8712,
+    notin    => 8713,
+    ni	     => 8715,
+    prod     => 8719,
+    sum      => 8721,
+    minus    => 8722,
+    lowast   => 8727,
+    radic    => 8730,
+    prop     => 8733,
+    infin    => 8734,
+    ang      => 8736,
+    and      => 8743,
+    or	     => 8744,
+    cap      => 8745,
+    cup      => 8746,
+    int      => 8747,
+    there4   => 8756,
+    sim      => 8764,
+    cong     => 8773,
+    asymp    => 8776,
+    ne	     => 8800,
+    equiv    => 8801,
+    le	     => 8804,
+    ge	     => 8805,
+    sub      => 8834,
+    sup      => 8835,
+    nsub     => 8836,
+    sube     => 8838,
+    supe     => 8839,
+    oplus    => 8853,
+    otimes   => 8855,
+    perp     => 8869,
+    sdot     => 8901,
+    lceil    => 8968,
+    rceil    => 8969,
+    lfloor   => 8970,
+    rfloor   => 8971,
+    lang     => 9001,
+    rang     => 9002,
+    loz      => 9674,
+    spades   => 9824,
+    clubs    => 9827,
+    hearts   => 9829,
+    diams    => 9830,
+);
+
+1;
+__END__
+
+=head1 NAME
+
+HTML::Entities::Numbered::Table - HTML entities table
+
+=head1 SYNOPSIS
+
+B<DO NOT USE THIS MODULE DIRECTLY>
+
+=head1 DESCRIPTION
+
+HTML::Entities::Numbered::Table is HTML entities table. The table is
+including every named entity and decimal pairs.
+
+=head1 AUTHOR
+
+Koichi Taniguchi E<lt>taniguchi at livedoor.jpE<gt>
+
+=cut
diff --git a/t/00_compile.t b/t/00_compile.t
new file mode 100644
index 0000000..6335ca7
--- /dev/null
+++ b/t/00_compile.t
@@ -0,0 +1,4 @@
+use strict;
+use Test::More tests => 1;
+
+BEGIN { use_ok 'HTML::Entities::Numbered' }
diff --git a/t/01_name2decimal.t b/t/01_name2decimal.t
new file mode 100644
index 0000000..fff593a
--- /dev/null
+++ b/t/01_name2decimal.t
@@ -0,0 +1,11 @@
+use strict;
+use Test::More tests => 252;
+use HTML::Entities::Numbered;
+
+open(ENT, 't/entities.txt') || die $!;
+while (<ENT>) {
+    chomp;
+    my @entity = split /\t+/, $_;
+    ok(name2decimal($entity[0]) eq $entity[1]);
+}
+close ENT;
diff --git a/t/02_name2hex.t b/t/02_name2hex.t
new file mode 100644
index 0000000..4fb7a09
--- /dev/null
+++ b/t/02_name2hex.t
@@ -0,0 +1,11 @@
+use strict;
+use Test::More tests => 252;
+use HTML::Entities::Numbered;
+
+open(ENT, 't/entities.txt') || die $!;
+while (<ENT>) {
+    chomp;
+    my @entity = split /\t+/, $_;
+    ok(name2hex($entity[0]) eq $entity[2]);
+}
+close ENT;
diff --git a/t/03_decimal2name.t b/t/03_decimal2name.t
new file mode 100644
index 0000000..c2d2db1
--- /dev/null
+++ b/t/03_decimal2name.t
@@ -0,0 +1,11 @@
+use strict;
+use Test::More tests => 252;
+use HTML::Entities::Numbered;
+
+open(ENT, 't/entities.txt') || die $!;
+while (<ENT>) {
+    chomp;
+    my @entity = split /\t+/, $_;
+    ok(decimal2name($entity[1]) eq $entity[0]);
+}
+close ENT;
diff --git a/t/04_hex2name.t b/t/04_hex2name.t
new file mode 100644
index 0000000..3e3b2b9
--- /dev/null
+++ b/t/04_hex2name.t
@@ -0,0 +1,11 @@
+use strict;
+use Test::More tests => 252;
+use HTML::Entities::Numbered;
+
+open(ENT, 't/entities.txt') || die $!;
+while (<ENT>) {
+    chomp;
+    my @entity = split /\t+/, $_;
+    ok(hex2name($entity[2]) eq $entity[0]);
+}
+close ENT;
diff --git a/t/05_hex2name_lc.t b/t/05_hex2name_lc.t
new file mode 100644
index 0000000..ca1d18f
--- /dev/null
+++ b/t/05_hex2name_lc.t
@@ -0,0 +1,11 @@
+use strict;
+use Test::More tests => 252;
+use HTML::Entities::Numbered;
+
+open(ENT, 't/entities.txt') || die $!;
+while (<ENT>) {
+    chomp;
+    my @entity = split /\t+/, $_;
+    ok(hex2name(lc($entity[2])) eq $entity[0]);
+}
+close ENT;
diff --git a/t/06_invalid.t b/t/06_invalid.t
new file mode 100644
index 0000000..e3dce1e
--- /dev/null
+++ b/t/06_invalid.t
@@ -0,0 +1,19 @@
+use strict;
+use Test::More tests => 504;
+use HTML::Entities::Numbered;
+
+open(ENT, 't/entities.txt') || die $!;
+while (<ENT>) {
+    chomp;
+    my @entity = split /\t+/, $_;
+    my $changed = $entity[0];
+    $changed =~ tr/A-Za-z/a-zA-Z/;
+    ok(name2decimal($changed) ne $entity[1]);
+    unless ($changed =~ /^&(?:thorn|eth);$/i) {
+	ok(name2decimal($changed) eq $changed);
+    }
+    else {
+	ok(name2decimal($changed) ne $changed);
+    }
+}
+close ENT;
diff --git a/t/07_cross.t b/t/07_cross.t
new file mode 100644
index 0000000..f6ead0e
--- /dev/null
+++ b/t/07_cross.t
@@ -0,0 +1,14 @@
+use strict;
+use Test::More tests => 1008;
+use HTML::Entities::Numbered;
+
+open(ENT, 't/entities.txt') || die $!;
+while (<ENT>) {
+    chomp;
+    my @entity = split /\t+/, $_;
+    ok(decimal2name(name2decimal($entity[0])) eq $entity[0]);
+    ok(name2decimal(decimal2name($entity[1])) eq $entity[1]);
+    ok(name2hex(hex2name($entity[2])) eq $entity[2]);
+    ok(hex2name(name2hex(decimal2name(name2decimal($entity[0])))) eq $entity[0]);
+}
+close ENT;
diff --git a/t/08_name2decimal_xml.t b/t/08_name2decimal_xml.t
new file mode 100644
index 0000000..4358a52
--- /dev/null
+++ b/t/08_name2decimal_xml.t
@@ -0,0 +1,16 @@
+use strict;
+use Test::More tests => 252;
+use HTML::Entities::Numbered;
+
+open(ENT, 't/entities.txt') || die $!;
+while (<ENT>) {
+    chomp;
+    my @entity = split /\t+/, $_;
+    unless ($entity[0] =~ /^&(?:lt|gt|amp|quot|apos);/) {
+	ok(name2decimal_xml($entity[0]) eq $entity[1]);
+    }
+    else {
+	ok(name2decimal_xml($entity[0]) eq $entity[0]);
+    }
+}
+close ENT;
diff --git a/t/09_name2hex_xml.t b/t/09_name2hex_xml.t
new file mode 100644
index 0000000..b6297a2
--- /dev/null
+++ b/t/09_name2hex_xml.t
@@ -0,0 +1,16 @@
+use strict;
+use Test::More tests => 252;
+use HTML::Entities::Numbered;
+
+open(ENT, 't/entities.txt') || die $!;
+while (<ENT>) {
+    chomp;
+    my @entity = split /\t+/, $_;
+    unless ($entity[0] =~ /^&(?:lt|gt|amp|quot|apos);/) {
+        ok(name2hex_xml($entity[0]) eq $entity[2]);
+    }
+    else {
+        ok(name2hex_xml($entity[0]) eq $entity[0]);
+    }
+}
+close ENT;
diff --git a/t/entities.txt b/t/entities.txt
new file mode 100644
index 0000000..ebd85a2
--- /dev/null
+++ b/t/entities.txt
@@ -0,0 +1,252 @@
+ 	 	&#xA0;
+¡	¡	&#xA1;
+¢	¢	&#xA2;
+£	£	&#xA3;
+¤	¤	&#xA4;
+¥	¥	&#xA5;
+¦	¦	&#xA6;
+§	§	&#xA7;
+¨	¨	&#xA8;
+©	©	&#xA9;
+ª	ª	&#xAA;
+«	«	&#xAB;
+¬	¬	&#xAC;
+­	­	&#xAD;
+®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033;
+‾	‾	&#x203E;
+⁄	⁄	&#x2044;
+℘	℘	&#x2118;
+ℑ	ℑ	&#x2111;
+ℜ	ℜ	&#x211C;
+™	™	&#x2122;
+ℵ	ℵ	&#x2135;
+←	←	&#x2190;
+↑	↑	&#x2191;
+→	→	&#x2192;
+↓	↓	&#x2193;
+↔	↔	&#x2194;
+↵	↵	&#x21B5;
+⇐	⇐	&#x21D0;
+⇑	⇑	&#x21D1;
+⇒	⇒	&#x21D2;
+⇓	⇓	&#x21D3;
+⇔	⇔	&#x21D4;
+∀	∀	&#x2200;
+∂	∂	&#x2202;
+∃	∃	&#x2203;
+∅	∅	&#x2205;
+∇	∇	&#x2207;
+∈	∈	&#x2208;
+∉	∉	&#x2209;
+∋	∋	&#x220B;
+∏	∏	&#x220F;
+∑	∑	&#x2211;
+−	−	&#x2212;
+∗	∗	&#x2217;
+√	√	&#x221A;
+∝	∝	&#x221D;
+∞	∞	&#x221E;
+∠	∠	&#x2220;
+∧	∧	&#x2227;
+∨	∨	&#x2228;
+∩	∩	&#x2229;
+∪	∪	&#x222A;
+∫	∫	&#x222B;
+&there4;	∴	&#x2234;
+∼	∼	&#x223C;
+≅	≅	&#x2245;
+≈	≈	&#x2248;
+≠	≠	&#x2260;
+≡	≡	&#x2261;
+≤	≤	&#x2264;
+≥	≥	&#x2265;
+⊂	⊂	&#x2282;
+⊃	⊃	&#x2283;
+⊄	⊄	&#x2284;
+⊆	⊆	&#x2286;
+⊇	⊇	&#x2287;
+⊕	⊕	&#x2295;
+⊗	⊗	&#x2297;
+⊥	⊥	&#x22A5;
+⋅	⋅	&#x22C5;
+⌈	⌈	&#x2308;
+⌉	⌉	&#x2309;
+⌊	⌊	&#x230A;
+⌋	⌋	&#x230B;
+⟨	〈	&#x2329;
+⟩	〉	&#x232A;
+◊	◊	&#x25CA;
+♠	♠	&#x2660;
+♣	♣	&#x2663;
+♥	♥	&#x2665;
+♦	♦	&#x2666;
+"	"	&#x22;
+&	&	&#x26;
+<	<	&#x3C;
+>	>	&#x3E;
+Œ	Œ	&#x152;
+œ	œ	&#x153;
+Š	Š	&#x160;
+š	š	&#x161;
+Ÿ	Ÿ	&#x178;
+ˆ	ˆ	&#x2C6;
+˜	˜	&#x2DC;
+ 	 	&#x2002;
+ 	 	&#x2003;
+ 	 	&#x2009;
+‌	‌	&#x200C;
+‍	‍	&#x200D;
+‎	‎	&#x200E;
+‏	‏	&#x200F;
+–	–	&#x2013;
+—	—	&#x2014;
+‘	‘	&#x2018;
+’	’	&#x2019;
+‚	‚	&#x201A;
+“	“	&#x201C;
+”	”	&#x201D;
+„	„	&#x201E;
+†	†	&#x2020;
+‡	‡	&#x2021;
+‰	‰	&#x2030;
+‹	‹	&#x2039;
+›	›	&#x203A;
+€	€	&#x20AC;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libhtml-entities-numbered-perl.git



More information about the Pkg-perl-cvs-commits mailing list