Skip to content

Commit

Permalink
Merge pull request #78 from kitsuyui/update-html5ever
Browse files Browse the repository at this point in the history
Update html5ever to 0.29.0
  • Loading branch information
kitsuyui authored Oct 15, 2024
2 parents a0b695b + 2d882ed commit bfef561
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ keywords = ["sxd_document", "sxd_xpath", "html5ever"]
repository = "https://github.com/kitsuyui/sxd_html"

[dependencies]
html5ever = "0.28.0"
html5ever = "0.29.0"
sxd-document = "0.3.2"

[dev-dependencies]
Expand Down
5 changes: 3 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ use std::{
convert::TryFrom,
};

use html5ever::driver::ParseOpts;
use html5ever::tendril::TendrilSink;
use html5ever::tree_builder::TreeBuilderOpts;
use html5ever::{driver::ParseOpts, ExpandedName};

pub use error::Error;
pub(crate) use handle::Handle;
Expand Down Expand Up @@ -46,6 +46,7 @@ impl<'d> DocHtmlSink<'d> {
}

impl<'d> TreeSink for DocHtmlSink<'d> {
type ElemName<'a> = ExpandedName<'a> where Self: 'a;
type Handle = Handle<'d>;
type Output = Vec<Error>;

Expand All @@ -67,7 +68,7 @@ impl<'d> TreeSink for DocHtmlSink<'d> {
}

// this is only called on elements
fn elem_name<'h>(&'h self, target: &'h Self::Handle) -> html5ever::ExpandedName<'h> {
fn elem_name<'h>(&'h self, target: &'h Self::Handle) -> Self::ElemName<'h> {
match target {
Handle::Element(_, qualname, _) => qualname.expanded(),
_ => panic!("not an element"),
Expand Down

0 comments on commit bfef561

Please sign in to comment.