diff --git a/Cargo.lock b/Cargo.lock index 6507e80..fd75393 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -306,9 +306,9 @@ checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "html5gum" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d4c69595eca3d5d246be4c0be51577b0c39c5f8c75d27a06c8a69c7b594cd37" +checksum = "91b361633dcc40096d01de35ed535b6089be91880be47b6fd8f560497af7f716" dependencies = [ "jetscii", ] diff --git a/Cargo.toml b/Cargo.toml index 7428302..05a74cd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,7 @@ rayon = "1.5.1" pulldown-cmark = "0.12.2" blake3 = "1.0.0" -html5gum = "0.6.0" +html5gum = "0.6.1" jwalk = "0.8.1" bumpalo = { version = "3.11.1", features = ["collections"] } percent-encoding = "2.1.0" diff --git a/src/html/mod.rs b/src/html/mod.rs index 2f5f18b..8e68edb 100644 --- a/src/html/mod.rs +++ b/src/html/mod.rs @@ -570,3 +570,26 @@ fn test_document_join_bare_html() { Href("locations/oslo#grünerløkka") ); } + +#[test] +fn test_json_script() { + use crate::paragraph::ParagraphHasher; + + let doc = Document::new( + Path::new("/"), + Path::new("/html5gum/struct.Tokenizer.html"), + ); + + let html = r#""#; + + let mut doc_buf = DocumentBuffers::default(); + + let links = doc + .links_from_read::<_, ParagraphHasher>(&mut doc_buf, html.as_bytes(), false) + .unwrap(); + + assert_eq!( + links.collect::>(), + &[] + ); +}