Skip to content
Discussion options

You must be logged in to vote

Hey Jonas, there's currently no way to include your own jobs as parts of the set of Jobs, however you can still run your visitor alongside it.

You should be able to do something like the following (note I haven't checked if this compiles)

let mut jobs = Jobs::default();
let arena = typed_arena::Arena::new();
let dom = parse(
    r#"<svg xmlns="http://www.w3.org/2000/svg">
        test
    </svg>"#,
    &arena,
)
.unwrap();
let info = Info::<Element>::new(&arena);

// You can run your own jobs before/after `Jobs`.
let extract_dimensions = ExtractDimentions::new();
extract_dimensions.start(&mut Element::from_parent(dom.clone()), &info, None); // `start` as a method of the `Visitor` trait
//…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jonasgeiler
Comment options

Answer selected by jonasgeiler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants