HTML::EntityReference

A minimal, abstract, and reusable list of HTML entities
Download

HTML::EntityReference Ranking & Summary

Advertisement

  • Rating:
  • License:
  • GPL
  • Publisher Name:
  • John M. Dlugosz
  • Publisher web site:
  • http://search.cpan.org/~dlugosz/

HTML::EntityReference Tags


HTML::EntityReference Description

A minimal, abstract, and reusable list of HTML entities HTML::EntityReference is a minimal, abstract, and reusable list of HTML entities.Developer commentsThis is a listing of HTML character entities. It is intended to be the last time such a list is compiled into a module, being meant to be exposed and usable in any situation. I found several modules that dealt with Entities, but did not do what I needed, or were for internal use.The essential characteristic of this data is that "entities exist".The entity is nothing more than a name for a Unicode character. Everything else having to do with it is attached to the character, and should be something I can find in the Unicode database and related Unicode Perl stuff. The most fundamental thing is a map of names to code point numbers. I mean the number itself (an integer), not some string representation of the number in hex or decimal or decorated with some other escape system. From the code point value, it is a single step to get the actual character, or the formatted numeric entity, or whatever.You can use the supplied hash directly. Or, this module provides some simple functions that abstract the way the data is actually stored and return the common cases.The function calls also provide for an easy way to check multiple tables in one go. So non-standard entities recognised by some browsers or historically are documented here also. use HTML::EntityReference; my $codepoint= HTML::EntityReference::ordinal('ldquo'); # the integer 8220 say "Character is known formally as ", charnames::viacode($codepoint), '.'; my $char= HTML::EntityReference::character('amp'); # the string '&' # can look up the other way too my $entity= HTML::EntityReference::from_ordinal(0x2026); say "You can use &$entity; on a web page." # "hellip" # use non-standard definitions $codepoint= HTML::EntityReference::ordinal($whatsit, ':all'); Requirements: · Perl


HTML::EntityReference Related Software