From a9feed56fe0f296e7a8a4e01df62e943438817ce Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Wed, 6 Jun 2018 15:28:44 +0300 Subject: [PATCH] Replace html2pango with html2text. --- hammond-gtk/Cargo.toml | 2 +- hammond-gtk/src/main.rs | 2 +- hammond-gtk/src/widgets/show.rs | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/hammond-gtk/Cargo.toml b/hammond-gtk/Cargo.toml index d8cd1bd..76169ce 100644 --- a/hammond-gtk/Cargo.toml +++ b/hammond-gtk/Cargo.toml @@ -24,7 +24,7 @@ failure_derive = "0.1.1" regex = "1.0.0" reqwest = "0.8.5" serde_json = "1.0.17" -html2pango = { git = "https://gitlab.gnome.org/World/html2pango" } +html2text = "0.1.7" [dependencies.gtk] features = ["v3_22"] diff --git a/hammond-gtk/src/main.rs b/hammond-gtk/src/main.rs index 083f19c..a102303 100644 --- a/hammond-gtk/src/main.rs +++ b/hammond-gtk/src/main.rs @@ -29,7 +29,7 @@ extern crate chrono; extern crate crossbeam_channel; extern crate hammond_data; extern crate hammond_downloader; -extern crate html2pango; +extern crate html2text; extern crate humansize; extern crate loggerv; extern crate open; diff --git a/hammond-gtk/src/widgets/show.rs b/hammond-gtk/src/widgets/show.rs index fc3ac7f..642eb39 100644 --- a/hammond-gtk/src/widgets/show.rs +++ b/hammond-gtk/src/widgets/show.rs @@ -4,7 +4,7 @@ use gtk::prelude::*; use crossbeam_channel::{SendError, Sender}; use failure::Error; -use html2pango::markup_from_raw; +use html2text; use open; use rayon; use send_cell::SendCell; @@ -124,7 +124,8 @@ impl ShowWidget { /// Set the descripton text. fn set_description(&self, text: &str) { - self.description.set_markup(&markup_from_raw(text)); + self.description + .set_markup(&html2text::from_read(text.as_bytes(), 70)); } /// Save the scrollabar vajustment to the cache.