diff --git a/src/main.rs b/src/main.rs index 4198cdf..4e3b951 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,7 +11,8 @@ use opts::Opts; use std::error::Error; use std::fs::File; use std::io; -use std::io::{stdin, Read}; +use std::io::Write; +use std::io::{stdin, stdout, Read}; use std::path::PathBuf; extern crate kuchiki; @@ -74,9 +75,9 @@ fn main() -> Result<(), Box> { // Let's get the actual text in this text node. A text node wraps around // a RefCell, so we need to call borrow() to get a &str out. //let text = text_node.as_text().unwrap().borrow(); + write!(stdout(), "{}", serialize_node(as_node)?); + /*if let Some(child) = as_node.first_child() { - if let Some(child) = as_node.first_child() { - dbg!(serialize_node(&child)); //TODO: Convert Nodes to String, as this only works for Nodes containing plain text if let Some(text) = child.as_text() { // Prints: @@ -85,7 +86,7 @@ fn main() -> Result<(), Box> { // "I love HTML" println!("{:?}", text.borrow()); } - } + }*/ } Ok(()) }