diff --git a/Cargo.lock b/Cargo.lock index 9777ce4..14a1d89 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -207,7 +207,7 @@ checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" [[package]] name = "kuchikiki" version = "0.8.2" -source = "git+https://github.com/brave/kuchikiki.git?rev=28e1ec0#28e1ec017284f2b1dd7578ff90dd82799977baab" +source = "git+https://github.com/xusd320/kuchikiki.git?rev=c671c7b#c671c7b88bb3256ac74995cda83f37c782f6d4ab" dependencies = [ "cssparser", "html5ever", diff --git a/crates/niddle_napi/Cargo.toml b/crates/niddle_napi/Cargo.toml index 6d666f6..c362bc5 100644 --- a/crates/niddle_napi/Cargo.toml +++ b/crates/niddle_napi/Cargo.toml @@ -9,7 +9,7 @@ crate-type = ["cdylib"] [dependencies] html5ever = "0.27.0" indexmap = "2.2.6" -kuchikiki = { git = "https://github.com/brave/kuchikiki.git", rev = "28e1ec0" } +kuchikiki = { git = "https://github.com/xusd320/kuchikiki.git", rev = "c671c7b" } # Default enable napi4 feature, see https://nodejs.org/api/n-api.html#node-api-version-matrix napi = { version = "3.0.0-alpha.7", default-features = false, features = ["object_indexmap"] } napi-derive = "3.0.0-alpha.6" diff --git a/crates/niddle_napi/src/node_repr/modify.rs b/crates/niddle_napi/src/node_repr/modify.rs index 02bfd7f..ab5aabf 100644 --- a/crates/niddle_napi/src/node_repr/modify.rs +++ b/crates/niddle_napi/src/node_repr/modify.rs @@ -1,4 +1,4 @@ -use html5ever::LocalName; +use html5ever::{tendril::StrTendril, LocalName}; use indexmap::IndexMap; use super::NodeRepr; @@ -83,7 +83,7 @@ impl NodeRepr { ele .attributes .borrow_mut() - .insert(LocalName::from(name), value); + .insert(LocalName::from(name), StrTendril::from(value)); } } @@ -94,7 +94,7 @@ impl NodeRepr { ele .attributes .borrow_mut() - .insert(LocalName::from(name), value); + .insert(LocalName::from(name), StrTendril::from(value)); }); } } diff --git a/crates/niddle_napi/src/node_repr/query.rs b/crates/niddle_napi/src/node_repr/query.rs index 1deba19..e9bc772 100644 --- a/crates/niddle_napi/src/node_repr/query.rs +++ b/crates/niddle_napi/src/node_repr/query.rs @@ -43,7 +43,7 @@ impl NodeRepr { .iter() .map(|(expanded_name, attr)| { let ExpandedName { local, ns: _ } = expanded_name; - (local.to_string(), attr.value.clone()) + (local.to_string(), attr.value.to_string()) }) .collect::>() })