Releases: fuelen/html2text
Releases · fuelen/html2text
v0.3.0
What's new
convert_rich/2 — annotated rich text output
Returns structured {text, [annotation]} tuples instead of plain text, enabling custom renderers (ANSI terminal, Slack, Discord, etc.).
HTML2Text.convert_rich("<p>Hello <strong>world</strong></p>")
#=> {:ok, [[{"Hello ", []}, {"world", [:strong]}]]}Annotations: :strong, :emphasis, :strikeout, :code, {:link, url}, {:image, src}, {:preformat, bool}, {:colour, {r, g, b}}, {:bg_colour, {r, g, b}}.
CSS colour extraction supported via use_doc_css: true and css: "..." options.
HTML2Text.HTML — inspectable HTML container
A struct that renders HTML as formatted text with ANSI styles when inspected in IEx. Bold, italic, clickable links (OSC 8), CSS true color, and more — directly in your terminal.
%{body: HTML2Text.HTML.new("<p>Hello <strong>world</strong></p>")}
# In IEx: %{body: #HTML2Text.HTML<Hello **world**>}empty_img_mode option
Controls how images without alt text are rendered: :ignore (default), {:replace, text}, or :filename.
Other changes
- Update
html2textRust crate from 0.15.1 to 0.16.7 (rowspan support,<noscript>fix,<b>tag support, various bug fixes) - Add
HTML2Text.Errorcustom exception for bang functions - Enable
cssfeature for colour extraction
v0.2.0
Breaking: add options, bump version to `v0.2.0`
v0.1.1
Add DirtyCpu flag, closes #1
v0.1.0
Specify targets and nif versions