XML::Entity::HTML

Extension of XML::Entity for (X)HTML 5 entities.

NAME

XML::Entity::HTML - Extension of XML::Entity for (X)HTML 5 entities.

SYNOPSIS

use XML::Entity::HTML;

my $xeh = XML::Entity::HTML.new;
say $xeh.decode: 'Text with <entities> & «more»';
# Text with <entities> & Ā«moreĀ»

say $xeh.encode: 'Text with <entities> & Ā«moreĀ»';
# Text with &lt;entities&gt; &amp; &laquo;more&raquo;

say decode-html-entities 'Text with &lt;entities&gt; &amp; &laquo;more&raquo;';
# Text with <entities> & Ā«moreĀ»

say encode-html-entities 'Text with <entities> & Ā«moreĀ»';
# Text with &lt;entities&gt; &amp; &laquo;more&raquo;

DESCRIPTION

It's simply an extension class of XML::Entity, but with a lot more entities taken from the official JSON list.

Any entities that wouldn't compile properly have been blacklisted and aren't supported. See the build.raku script in the build directory on how this module is built.

METHODS

decode

Overrides the XML::Entity.decode method. Expects a string and an optional named argument :numeric.

encode

Overrides the XML::Entity.encode method. Expects a string and an optional named argument :hex.

EXPORTED SUBROUTINES

decode-html-entities

Provides procedural access to the decode method on a singleton XML::Entity::HTML object. Takes the same parameters.

encode-html-entities

Provides procedural access to the encode method on a singleton XML::Entity::HTML object. Takes the same parameters.

AUTHOR

Timothy Totten

COPYRIGHT AND LICENSE

Copyright 2019 Timothy Totten

Copyright 2020 - 2022 Raku Community

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.

XML::Entity::HTML v0.1.2

Extension of XML::Entity for (X)HTML 5 entities.

Authors

    License

    Artistic-2.0

    Dependencies

    XML

    Test Dependencies

    Provides

    • XML::Entity::HTML

    Documentation

    The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.