Skip to content

Commit

Permalink
Merge pull request #151 from jugglerchris/css_parser
Browse files Browse the repository at this point in the history
Replace the CSS parser and update for an alpha release.
  • Loading branch information
jugglerchris authored May 26, 2024
2 parents 993ef16 + 380a178 commit 7211564
Show file tree
Hide file tree
Showing 7 changed files with 1,225 additions and 355 deletions.
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,31 @@ Possible log types:
- `[fixed]` for any bug fixes.
- `[security]` to invite users to upgrade in case of vulnerabilities.

### 0.13.0-alpha.0

- [changed] Replaced LightningCSS with a smaller CSS parser. There is a chance
that some CSS edge cases which no longer work; if so this would be a bug.
- [removed] Some previously `pub` items and methods which are either internal
implementation details or considered redundant have been removed or made
private (thanks sftse). Please open an issue for anything removed that was
being used.

Of note, `RenderTree::render_plain()` and `RenderTree::render_rich()` have
been removed. Replace code like:

```rust
let text = html2text::parse(html)?
.render_plain(80)?
.into_string()?;
```
with:
```rust
let text = html2text::config::plain()
.render_to_string(html2text::parse(html)?)?
```

- [changed] Updated some dependencies

### 0.12.5

- [changed] Updated some dependencies
Expand Down
8 changes: 3 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "html2text"
version = "0.12.5"
version = "0.13.0-alpha.0"
authors = ["Chris Emerson <[email protected]>"]
description = "Render HTML as plain text."
repository = "https://github.com/jugglerchris/rust-html2text/"
Expand All @@ -20,16 +20,14 @@ tendril = "0.4"
unicode-width = "0.1.5"
backtrace = { version = "0.3", optional=true }
thiserror = "1.0.50"
lightningcss = { version = "1.0.0-alpha.54", optional=true }
# Keep dashmap back; 5.5 has a higher MSRV.
dashmap = { version = "~5.4", optional=true }
log = { version = "0.4.20", optional = true }
nom = "7.1.3"

[features]
html_trace = ["dep:log"]
html_trace_bt = ["html_trace", "dep:backtrace"]
default = []
css = ["dep:lightningcss"]
css = []

[[example]]
name = "html2term"
Expand Down
Loading

0 comments on commit 7211564

Please sign in to comment.