logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

HTML::Escape - Extremely fast HTML escaping

Author

       Goro Fuji

       Tokuhiro Matsuno <tokuhirom AAJKLFJEF@ GMAIL COM>

Benchmark

                            Rate HTML::Entities   HTML::Escape
           HTML::Entities 14.0/s             --           -91%
           HTML::Escape    150/s           975%             --

Description

       This modules provides a function which escapes HTML's special characters. It performs a similar function
       to PHP's htmlspecialchars.  It escapes the following characters:

           " & ' < > ` { }

       This module uses XS for better performance, but it also provides a pure perl version.

Faq

       Is there also an unescape_html?
           No.  Unescaping  HTML  requires a lot of code, and we don't want to do it.  Please use HTML::Entities
           for it.

License

       Copyright (C) Tokuhiro Matsuno

       This library is free software; you can redistribute it and/or modify it under  the  same  terms  as  Perl
       itself.

perl v5.40.0                                       2024-10-20                                  HTML::Escape(3pm)

Name

       HTML::Escape - Extremely fast HTML escaping

See Also

       Text::Xslate, HTML::Entities

Synopsis

           use HTML::Escape qw/escape_html/;

           my $escaped = escape_html("<^o^>");

See Also