### ----------------------------------------------------
### -- XML::Entity::HTML
### -- Licenses: Artistic-2.0
### -- Authors: 
### -- File: lib/XML/Entity/HTML.rakumod
### ----------------------------------------------------
### -- Chunk 3 of 3
 '∘', 'Σ', '↑', '→', '←', '↓', '𝔖', 'С', 'Ŝ', 'Ş', 
  'Š', '⪼', 'Ś', 'Ь', 'Ш', 'Щ', '⧴', '↱', 'ℛ', '⇛', '⥰', 'ℝ', '⇒', '⥓', 
  '⇀', '⥔', '↾', '⥜', '⥏', '⊵', '⧐', '⊳', '⥛', '↦', '⊢', '⌋', '⥕', '⇂', 
  '⥝', '⟧', '⌉', '⇄', '⇥', '→', '⟩', 'Ρ', 'ℜ', '⥯', '⇋', '∋', 'ℜ', 'Р', 
  'Ŗ', 'Ř', '⤖', '↠', '⟫', 'Ŕ', '®', '⤐', '𝒬', 'ℚ', '𝔔', q{"}, 'Ψ', '𝒫', 
  '∝', '∷', '∏', '″', '≾', '≼', '⪯', '≺', '⪻', 'ℙ', 'ℌ', '±', 'Π', 'Φ', 
  '𝔓', 'П', '∂', '⏜', '⎴', '⏞', '‾', 'Ö', '⨷', 'Õ', 'Ø', '𝒪', '⩔', '‘', 
  '“', '𝕆', 'Ο', 'Ω', 'Ō', 'Ò', '𝔒', 'Ő', 'О', 'Ô', 'Ó', 'Œ', 'Ν', 'Ñ', 
  '𝒩', '∤', '≉', '≇', '≄', '≁', '⊉', '⊃⃒', '≿̸', '⋡', '⪰̸', '⊁', '⊈', '⊂⃒', 
  '⋣', '⊐̸', '⋢', '⊏̸', '⋭', '⧐̸', '⋫', '∌', '⋠', '⪯̸', '⊀', '⪡̸', '⪢̸', '≴', 
  '⩽̸', '≪̸', '≸', '≰', '≮', '⋬', '⧏̸', '⋪', '≏̸', '≎̸', '≵', '⩾̸', '≹', '≫̸', 
  '≧̸', '≱', '≯', '∄', '≂̸', '≠', '∉', '∦', '≭', '≢', '⫬', 'ℕ', ' ', '⁠', 
  '𝔑', '
', '≪', '≫', '​', '​', '​', '​', 'Н', 'Ņ', 'Ň', 'Ń', 'Њ', 'Μ', 
  'ℳ', '𝕄', '∓', '𝔐', 'ℳ', ' ', 'М', '⤅', '≪', 'Ł', '↰', 'ℒ', '↘', '↙', 
  '𝕃', '⟹', '⟺', '⟸', '⟶', '⟷', '⟵', 'Ŀ', '⇚', '⋘', '𝔏', '≲', '⩽', '⪡', 
  '≶', '≦', '⋚', '⇔', '⇐', '⥒', '↼', '⥘', '↿', '⥠', '⥑', '⊴', '⧏', '⊲', 
  '⥚', '↤', '⊣', '⥎', '↔', '⌊', '⥙', '⇃', '⥡', '⟦', '⌈', '⇆', '⇤', '←', 
  '⟨', 'Л', 'Ļ', 'Ľ', '↞', 'ℒ', '⟪', 'Λ', 'Ĺ', '<', 'Љ', '𝒦', '𝕂', '𝔎', 
  'К', 'Ķ', 'Κ', 'Ќ', 'Х', 'Є', 'Ј', '𝒥', '𝕁', '𝔍', 'Й', 'Ĵ', 'Ï', 'І', 
  'Ĩ', 'ℐ', 'Ι', '𝕀', 'Į', '⁢', '⁣', '⋂', '∫', '∬', '⇒', 'ⅈ', 'Ī', 'ℑ', 
  'Ì', 'ℑ', 'İ', 'И', 'Î', 'Í', 'Ё', 'Ĳ', 'Е', '≏', '≎', 'Ħ', 'ℋ', '─', 
  'ℍ', 'ℋ', 'ℌ', 'Ĥ', '^', 'ˇ', 'Ъ', '≫', '𝒢', '≳', '⩾', '≷', '⪢', '≧', 
  '⋛', '≥', '𝔾', '⋙', '𝔊', 'Ġ', 'Г', 'Ĝ', 'Ģ', 'Ğ', 'Ϝ', 'Γ', '>', 'Ѓ', 
  'ℱ', 'ℱ', '∀', '𝔽', '▪', '◼', '𝔉', 'Ф', 'ⅇ', '∃', 'Ë', 'Η', '⩳', 'ℰ', 
  '⇌', '≂', '⩵', 'Ε', '𝔼', 'Ę', '▫', '◻', 'Ē', '∈', 'È', '𝔈', 'Ė', 'Э', 
  'Ê', 'Ě', 'É', 'Ð', 'Ŋ', 'Đ', '𝒟', '⇓', '↧', '⊤', '⥗', '⇁', '⥟', '⥖', 
  '↽', '⥞', '⥐', '⇵', '⤓', '↓', '∥', '⇕', '⇑', '⊨', '⇒', '⟹', '⟺', '⟸', 
  '⫤', '⇔', '⇐', '⇓', '¨', '∯', '≐', '¨', '𝔻', 'ⅆ', '⋄', '˜', '`', '˝', 
  '˙', '´', '𝔇', 'Δ', '∇', 'Д', 'Ď', '⫤', '↡', '‡', 'Џ', 'Ѕ', 'Ђ', '⤑', 
  'ⅅ', '≍', '⋓', '𝒞', '⨯', '∳', '∐', 'ℂ', '∮', '∯', '≡', '⩴', '∷', '’', 
  '”', '∲', '⊗', '⊕', '⊖', '⊙', 'Χ', 'ℭ', '·', '¸', 'Ċ', '∰', 'Ĉ', 'Ç', 
  'Č', 'ℭ', 'ⅅ', '⋒', 'Ć', '©', 'Ч', '≎', 'ℬ', '˘', '𝔹', '𝔅', 'Β', 'ℬ', 
  '∵', 'Б', '⌆', '⫧', '∖', 'Ä', 'Ã', '≔', '𝒜', 'Å', '⁡', '𝔸', 'Ą', '⩓', 
  'Ā', 'Α', 'À', '𝔄', 'А', 'Â', 'Ă', 'Á', '&', 'Æ';

#- PLEASE DON'T CHANGE ANYTHING ABOVE THIS LINE
#- end of generated part of entities -------------------------------------------

class XML::Entity::HTML is XML::Entity {
    method entityNames()  { @entityNames  }
    method entityValues() { @entityValues }
}

my constant $xeh = XML::Entity::HTML.new;

sub decode-html-entities(
  Str:D   $in,
  Bool:D :$numeric = True,
--> Str:D) is export {
    $xeh.decode($in, :$numeric)
}

sub encode-html-entities(
  Str:D   $in,
          *@numeric,
  Bool:D :$hex = False,
--> Str:D) is export {
    $xeh.encode($in, :$hex, |@numeric);
}

=begin pod

=head1 NAME

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

=head1 SYNOPSIS

=begin code :lang<raku>

use XML::Entity::HTML;

my $xeh = XML::Entity::HTML.new;
say $xeh.decode: 'Text with &lt;entities&gt; &amp; &laquo;more&raquo;';
# 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;

=end code

=head1 DESCRIPTION

It's simply an extension class of XML::Entity, but with a lot more
entities taken from the
L<official JSON list|https://www.w3.org/TR/html5/entities.json>.

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

=head1 METHODS

=head2 decode

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

=head2 encode

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

=head1 EXPORTED SUBROUTINES

=head2 decode-html-entities

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

=head2 encode-html-entities

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

=head1 AUTHOR

Timothy Totten

=head1 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.

=end pod

# vim: expandtab shiftwidth=4


