Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Termion 2.0. #107

Merged
merged 2 commits into from
Dec 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ Possible log types:
- `[fixed]` for any bug fixes.
- `[security]` to invite users to upgrade in case of vulnerabilities.

### 0.9.4

- [changed] Updated the termion dev-dependency to 2.0.

### 0.9.3

- [changed] Added cargo categories and update to 2021 edition.
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "html2text"
version = "0.9.3"
version = "0.9.4"
authors = ["Chris Emerson <[email protected]>"]
description = "Render HTML as plain text."
repository = "https://github.com/jugglerchris/rust-html2text/"
Expand Down Expand Up @@ -41,4 +41,4 @@ path = "examples/html2text.rs"
argparse = "0.2.2"

[target.'cfg(unix)'.dev-dependencies]
termion = "1.5"
termion = "2.0"
8 changes: 6 additions & 2 deletions examples/html2term.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ mod top {
use termion::event::Key;
use termion::input::TermRead;
use termion::raw::IntoRawMode;
use termion::screen::AlternateScreen;
use termion::screen::IntoAlternateScreen;
use unicode_width::UnicodeWidthStr;

fn to_style(tag: &Vec<RichAnnotation>) -> String {
Expand Down Expand Up @@ -170,7 +170,11 @@ mod top {
let mut doc_x = 0;
let mut doc_y = 0;

let mut screen = AlternateScreen::from(io::stdout().into_raw_mode().unwrap());
let mut screen = io::stdout()
.into_raw_mode()
.unwrap()
.into_alternate_screen()
.unwrap();

loop {
// Sanity-check the current screen position. max_y should
Expand Down
Loading