Skip to content

Commit

Permalink
Hotfix: get tests passing again (#219)
Browse files Browse the repository at this point in the history
  • Loading branch information
emwalker authored Nov 2, 2023
1 parent 7f5b94e commit 25e60f0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions examples/html5-parser.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
use gosub_engine::html5::parser::document::{Document, DocumentBuilder};
use gosub_engine::html5::{
input_stream::{Encoding, InputStream},
parser::Html5Parser,
use gosub_engine::{
bytes::{CharIterator, Encoding},
html5::parser::Html5Parser,
};

fn main() {
// Creates an input stream
let mut stream = InputStream::new();
stream.read_from_str("<p>Hello<b>world</b></p>", Some(Encoding::UTF8));
let mut chars = CharIterator::new();
chars.read_from_str("<p>Hello<b>world</b></p>", Some(Encoding::UTF8));

// Initialize a document and feed it together with the stream to the html5 parser
let document = DocumentBuilder::new_document();
let _ = Html5Parser::parse_document(&mut stream, Document::clone(&document), None);
let _ = Html5Parser::parse_document(&mut chars, Document::clone(&document), None);

// document now contains the html5 node tree
println!("Generated tree: \n\n {}", document);
Expand Down

0 comments on commit 25e60f0

Please sign in to comment.