Releases: k3a/html2text
Releases · k3a/html2text
Support for optional attributes on all tags.
Changes:
- Fix: Support for optional attributes on tags.
- The API remains fully backward-compatible.
Note: Caution if your HTML source is using tags with attributes.
Details:
Previously, tags other than <a> that contained attributes were not converted correctly. For example, <li class="menu-item"> was treated as inline text rather than a list item on a new line. Similarly, other tags with attributes (such as <h[1-6]> or <p>) were converted as inline text instead of being followed by a newline.
Option WithKeepSpaces to keep spaces as they are
Changes:
- another fully-backward-compatible update
- a new WithKeepSpaces option added to preserve spaces as they are (prevents the default behavior where multiple consecutive space characters are collapsed into a single standard space character)
Improved <a> tag handling & optional <li> list formatting
Changes:
- another fully-backward-compatible update
- tag is now case-insensitive and follows official specs, see #16
- added optional WithListSupport and WithListSupportPrefix to make
<li></li>lines formatted with a prefix like " - "
v1.1.0
- same as v1.0.9, just signaling the fact that the new functionality has been added
- fully-backward-compatible update (with any past version)
- functional options (line breaks style and tag inner text preservation)
HTML2TextWithOptions(`click <a href="http://bit.ly/2n4wXRs">news</a>`, WithLinksInnerText()) // produces: click news <http://bit.ly/2n4wXRs>
v1.0.9
v1.0.7
v1.0.6
1.0.5
1.0.4
Configurable line break style (backward-compatible CrLf is default) and numerical html entities, both contributed by @merlincox.