diff --git a/Cargo.toml b/Cargo.toml index 2fbd135..80be517 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,4 +8,5 @@ edition = "2021" [dependencies] epub = "1.2.2" ncurses = "5.101.0" -soup = "0.5.1" +scraper = "0.17.1" + diff --git a/src/html_module.rs b/src/html_module.rs index e80b9b5..c893443 100644 --- a/src/html_module.rs +++ b/src/html_module.rs @@ -4,20 +4,17 @@ Language: Rustc 1.69.0 ide: CLion Operating system: Fedora 38/WSL Purpose: This class is meant to process and return HTML formatted text as strings. -Last edited: 5/20/23 +Last edited: 6/28/23 */ -//TODO: I received a warning that soup is going to be incompatible in a future version, as it uses an old version of html5ever. -/*Possible solutions: - - Convert to html5ever - - find alternative library/framework - - convert html module to python script, use python version of soup - - convert html by hand(absolutely not) - */ -use soup::{Soup}; + +use scraper::{Html, Selector}; pub fn main(content: String) -> String { let str_content = content; - let soup = Soup::new(&str_content); - let page = soup.text(); + + println!("{}", str_content); + + let page = str_content; + return page; } \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index 1ed2a5a..ecce242 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,7 +9,7 @@ Last edited: 5/19/23 mod html_module; -mod ncurses_module; + use epub::doc::EpubDoc; //library for navigating epubs use std::env; @@ -25,7 +25,7 @@ fn main() { else { let args: Vec = env::args().collect(); let filename = &args[1]; - ncurses_module::main(); + epub_func(filename); } }