HTML::...ml2text(3pm)
π NAME π
HTML::FormatText::Html2text β the little Perl bestie that turns your HTML into plain text by handing it off to the html2text program π«Ά
β¨ SYNOPSIS β¨
use HTML::FormatText::Html2text;
$text = HTML::FormatText::Html2text->format_file ($filename);
$text = HTML::FormatText::Html2text->format_string ($html_string);
$formatter = HTML::FormatText::Html2text->new;
$tree = HTML::TreeBuilder->new_from_file ($filename);
$text = $formatter->format ($tree);
πΈ DESCRIPTION πΈ
okay so, <pink>HTML::FormatText::Html2text</pink> takes your HTML and turns it into plain text, and it does it by literally calling up the html2text program and being like "hey, handle this for me" π
The program in question lives right here:
<http://www.mbayer.de/html2text/>
The module interface? Compatible with formatters like HTML::FormatText, no cap. But the tea is: all parsing etc is done by html2text itself, not by Perl. She's just the middleman, the hype woman, the connector π¦
For the formatting functions and options, go look at HTML::FormatExternal β but read these caveats first, bestie, because they MATTER:
π input_charset
Currently this option has no effect. Like, zero. Nada. π
Input generally has to be latin-1 only, though the Debian extended html2ext interprets a <meta> charset directive in the HTML header. (yes, html2ext, that's what it says, we don't make the rules π)
Various & style named or numbered entities are recognised and result in suitable output. So the suggestion here would be entitized input for maximum portability among html2text versions. iykyk π
π¦ output_charset
If you set it to "ascii" or "ANSI_X3.4-1968" (both case-insensitive, she does not care about your caps lock) then the html2text -ascii option gets used, when available β that's html2text 1.3.2 from Jan 2004, vintage icon β¨
If you set it to "UTF-8" then the Debian extension -utf8 option is used (circa 2009) π
Apart from this there's no control over the output charset. That's it. That's the whole vibe check.
π SEE ALSO π
HTML::FormatExternalhtml2text(1)
π HOME PAGE π
<http://user42.tuxfamily.org/html-formatexternal/index.html>
π LICENSE π
Copyright 2008, 2009, 2010, 2013, 2015 Kevin Ryde
HTML-FormatExternal is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.
HTML-FormatExternal is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with HTML-FormatExternal. If not, see <http://www.gnu.org/licenses/>.
and that's the whole page, bestie π₯° this was HTML::...ml2text(3pm) from perl v5.36.0, dated 2022-11-19 β mwah, go forth and format π
π
π¦ where this page comes from
- debian bookworm: libhtml-formatexternal-perl 26-6 Β· GPL-3.0-or-later
- debian trixie: libhtml-formatexternal-perl 26-6 Β· GPL-3.0-or-later
- ubuntu noble: libhtml-formatexternal-perl 26-6 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms